Add move button in entry view
This commit is contained in:
@@ -123,6 +123,28 @@ namespace keepass2android
|
||||
|
||||
}
|
||||
|
||||
protected void SetupMoveButtons() {
|
||||
View moveView = FindViewById(Resource.Id.entry_move);
|
||||
if (App.Kp2a.GetDb().CanWrite)
|
||||
{
|
||||
moveView.Visibility = ViewStates.Visible;
|
||||
moveView.Click += (sender, e) =>
|
||||
{
|
||||
NavigateToFolderAndLaunchMoveElementTask navMoveTask =
|
||||
new NavigateToFolderAndLaunchMoveElementTask(Entry.ParentGroup,Entry.Uuid, false);
|
||||
navMoveTask.SetActivityResult(this, KeePass.ExitNormal );
|
||||
Finish();
|
||||
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
moveView.Visibility = ViewStates.Gone;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private class PluginActionReceiver : BroadcastReceiver
|
||||
{
|
||||
private readonly EntryActivity _activity;
|
||||
@@ -349,6 +371,7 @@ namespace keepass2android
|
||||
FillData();
|
||||
|
||||
SetupEditButtons();
|
||||
SetupMoveButtons ();
|
||||
|
||||
App.Kp2a.GetDb().LastOpenedEntry = new PwEntryOutput(Entry, App.Kp2a.GetDb().KpDatabase);
|
||||
|
||||
|
||||
1990
src/keepass2android/Resources/Resource.designer.cs
generated
1990
src/keepass2android/Resources/Resource.designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
@@ -13,9 +13,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:divider="?android:attr/dividerVertical"
|
||||
android:showDividers="middle"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:dividerPadding="12dp">
|
||||
|
||||
<FrameLayout
|
||||
style="?android:attr/actionButtonStyle"
|
||||
android:id="@+id/entry_edit"
|
||||
@@ -33,9 +33,25 @@
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/menu_edit" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/entry_move"
|
||||
style="?android:attr/actionButtonStyle"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
<!-- TODO: Modify move icon -->
|
||||
<TextView
|
||||
style="?android:actionBarTabTextStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:paddingRight="20dp"
|
||||
android:drawableLeft="?attr/NewEntryDrawable"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/menu_move_light" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/entry_divider2"
|
||||
android:layout_width="fill_parent"
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
<string name="menu_db_settings">Database settings</string>
|
||||
<string name="menu_delete">Delete</string>
|
||||
<string name="menu_move">Move to another group</string>
|
||||
<string name="menu_move_light">Move</string>
|
||||
<string name="menu_navigate">Navigate to this group</string>
|
||||
<string name="menu_donate">Donate a beer...</string>
|
||||
<string name="menu_edit">Edit</string>
|
||||
|
||||
Reference in New Issue
Block a user