Add groupname in entry view

This commit is contained in:
Jareth Lomson 2014-05-26 12:09:41 +02:00
parent 96b5aba684
commit 917dc585b0
4 changed files with 1477 additions and 1430 deletions

View File

@ -50,6 +50,7 @@ namespace keepass2android
public const String KeyEntry = "entry";
public const String KeyRefreshPos = "refresh_pos";
public const String KeyCloseAfterCreate = "close_after_create";
public const String KeyGroupFullPath = "groupfullpath_key";
public static void Launch(Activity act, PwEntry pw, int pos, AppTask appTask, ActivityFlags? flags = null)
{
@ -669,14 +670,20 @@ namespace keepass2android
ActionBar.Title = Entry.Strings.ReadSafe(PwDefs.TitleField);
ActionBar.SetDisplayHomeAsUpEnabled(true);
PopulateGroupText (Resource.Id.entry_group_name, Resource.Id.entryfield_group_container, KeyGroupFullPath);
PopulateStandardText(Resource.Id.entry_user_name, Resource.Id.entryfield_container_username, PwDefs.UserNameField);
PopulateStandardText(Resource.Id.entry_url, Resource.Id.entryfield_container_url, PwDefs.UrlField);
PopulateStandardText(Resource.Id.entry_password, Resource.Id.entryfield_container_password, PwDefs.PasswordField);
RegisterProtectedTextView(FindViewById<TextView>(Resource.Id.entry_password));
SetPasswordTypeface(FindViewById<TextView>(Resource.Id.entry_password));
RegisterTextPopup(FindViewById<RelativeLayout> (Resource.Id.groupname_container),
FindViewById (Resource.Id.entry_group_name), KeyGroupFullPath);
RegisterTextPopup(FindViewById<RelativeLayout>(Resource.Id.username_container),
FindViewById(Resource.Id.username_vdots), PwDefs.UserNameField);
RegisterTextPopup(FindViewById<RelativeLayout>(Resource.Id.url_container),
FindViewById(Resource.Id.url_vdots), PwDefs.UrlField)
.Add(new GotoUrlMenuItem(this));
@ -796,6 +803,12 @@ namespace keepass2android
_stringViews.Add(key, new StandardStringView(viewId, containerViewId, this));
}
private void PopulateGroupText(int viewId, int containerViewId, String key)
{
PopulateText(viewId, containerViewId, Entry.ParentGroup.GetFullPath());
_stringViews.Add (key, new StandardStringView (viewId, containerViewId, this));
}
private void RequiresRefresh()
{
Intent ret = new Intent();

File diff suppressed because it is too large Load Diff

View File

@ -1,261 +1,276 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/entry_table"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<LinearLayout android:id="@+id/entryfield_container_username"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<TextView
android:id="@+id/entry_user_name_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_user_name"
style="@style/EntryFieldHeader"
/>
<!-- Username -->
<RelativeLayout android:id="@+id/username_container"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:clickable="true"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/username_vdots"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:src="@drawable/vdots"
android:gravity="right|bottom"
android:layout_alignParentRight="true"
/>
<TextView
android:id="@+id/entry_user_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/username_vdots"
style="@style/EntryItem" />
</RelativeLayout>
</LinearLayout>
<LinearLayout android:id="@+id/entryfield_container_url"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- URL -->
<TextView
android:id="@+id/entry_url_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_url"
style="@style/EntryFieldHeader"
/>
<RelativeLayout android:id="@+id/url_container"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:clickable="true"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/url_vdots"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:src="@drawable/vdots"
android:gravity="right|bottom"
android:layout_alignParentRight="true"
/>
<TextView
android:id="@+id/entry_url"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="all"
android:layout_toLeftOf="@id/url_vdots"
style="@style/EntryItem" />
</RelativeLayout>
</LinearLayout>
<LinearLayout android:id="@+id/entryfield_container_password"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- Password -->
<TextView
android:id="@+id/entry_password_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_password"
style="@style/EntryFieldHeader"
/>
<RelativeLayout android:id="@+id/password_container"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:clickable="true"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/password_vdots"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:src="@drawable/vdots"
android:gravity="right|bottom"
android:layout_alignParentRight="true"
/>
<TextView
android:id="@+id/entry_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:password="true"
android:typeface="monospace"
android:layout_toLeftOf="@id/password_vdots"
style="@style/EntryItem" />
</RelativeLayout>
</LinearLayout>
<LinearLayout android:id="@+id/entryfield_container_comment"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- Comment -->
<TextView
android:id="@+id/entry_comment_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_comment"
style="@style/EntryFieldHeader"
/>
<TextView
android:id="@+id/entry_comment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textIsSelectable="true"
style="@style/EntryItem" />
</LinearLayout>
<LinearLayout
android:id="@+id/extra_strings"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="vertical" />
<!-- file attachments -->
<TextView
android:id="@+id/entry_binaries_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_binaries"
style="@style/EntryFieldHeader"
/>
<LinearLayout
android:id="@+id/binaries"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<!--Tags -->
<LinearLayout android:id="@+id/entryfield_container_tags"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<TextView
android:id="@+id/entry_tags_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_tags"
style="@style/EntryFieldHeader"
/>
<TextView
android:id="@+id/entry_tags"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textIsSelectable="true"
style="@style/EntryItem" />
</LinearLayout>
<LinearLayout android:id="@+id/entryfield_container_overrideurl"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!--Override URL-->
<TextView
android:id="@+id/entry_override_url_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_override_url"
style="@style/EntryFieldHeader"
/>
<TextView
android:id="@+id/entry_override_url"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="all"
android:textIsSelectable="true"
style="@style/EntryItem" />
</LinearLayout>
<LinearLayout android:id="@+id/entryfield_container_created"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- Created -->
<TextView
android:id="@+id/entry_created_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_created"
style="@style/EntryFieldHeader"
/>
<TextView
android:id="@+id/entry_created"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/EntryItem" />
</LinearLayout>
<LinearLayout android:id="@+id/entryfield_container_modified"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- Modified -->
<TextView
android:id="@+id/entry_modified_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_modified"
style="@style/EntryFieldHeader"
/>
<TextView
android:id="@+id/entry_modified"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/EntryItem" />
</LinearLayout>
<LinearLayout android:id="@+id/entryfield_container_expires"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- Expires -->
<TextView
android:id="@+id/entry_expires_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_expires"
style="@style/EntryFieldHeader"
/>
<TextView
android:id="@+id/entry_expires"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/EntryItem" />
</LinearLayout>
<LinearLayout
android:id="@+id/entryfield_group_container"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- Group -->
<TextView
android:id="@+id/entry_group_name_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_group_name"
style="@style/EntryFieldHeader" />
<RelativeLayout
android:id="@+id/groupname_container"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:clickable="true"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/group_name_vdots"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:src="@drawable/vdots"
android:gravity="right|bottom"
android:layout_alignParentRight="true" />
<TextView
android:id="@+id/entry_group_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/group_name_vdots"
style="@style/EntryItem" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/entryfield_container_username"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<TextView
android:id="@+id/entry_user_name_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_user_name"
style="@style/EntryFieldHeader" />
<!-- Username -->
<RelativeLayout
android:id="@+id/username_container"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:clickable="true"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/username_vdots"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:src="@drawable/vdots"
android:gravity="right|bottom"
android:layout_alignParentRight="true" />
<TextView
android:id="@+id/entry_user_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/username_vdots"
style="@style/EntryItem" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/entryfield_container_url"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- URL -->
<TextView
android:id="@+id/entry_url_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_url"
style="@style/EntryFieldHeader" />
<RelativeLayout
android:id="@+id/url_container"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:clickable="true"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/url_vdots"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:src="@drawable/vdots"
android:gravity="right|bottom"
android:layout_alignParentRight="true" />
<TextView
android:id="@+id/entry_url"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="all"
android:layout_toLeftOf="@id/url_vdots"
style="@style/EntryItem" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/entryfield_container_password"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- Password -->
<TextView
android:id="@+id/entry_password_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_password"
style="@style/EntryFieldHeader" />
<RelativeLayout
android:id="@+id/password_container"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:clickable="true"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/password_vdots"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:src="@drawable/vdots"
android:gravity="right|bottom"
android:layout_alignParentRight="true" />
<TextView
android:id="@+id/entry_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:password="true"
android:typeface="monospace"
android:layout_toLeftOf="@id/password_vdots"
style="@style/EntryItem" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/entryfield_container_comment"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- Comment -->
<TextView
android:id="@+id/entry_comment_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_comment"
style="@style/EntryFieldHeader" />
<TextView
android:id="@+id/entry_comment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textIsSelectable="true"
style="@style/EntryItem" />
</LinearLayout>
<LinearLayout
android:id="@+id/extra_strings"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="vertical" />
<!-- file attachments -->
<TextView
android:id="@+id/entry_binaries_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_binaries"
style="@style/EntryFieldHeader" />
<LinearLayout
android:id="@+id/binaries"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<!--Tags -->
<LinearLayout
android:id="@+id/entryfield_container_tags"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<TextView
android:id="@+id/entry_tags_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_tags"
style="@style/EntryFieldHeader" />
<TextView
android:id="@+id/entry_tags"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textIsSelectable="true"
style="@style/EntryItem" />
</LinearLayout>
<LinearLayout
android:id="@+id/entryfield_container_overrideurl"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!--Override URL-->
<TextView
android:id="@+id/entry_override_url_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_override_url"
style="@style/EntryFieldHeader" />
<TextView
android:id="@+id/entry_override_url"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="all"
android:textIsSelectable="true"
style="@style/EntryItem" />
</LinearLayout>
<LinearLayout
android:id="@+id/entryfield_container_created"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- Created -->
<TextView
android:id="@+id/entry_created_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_created"
style="@style/EntryFieldHeader" />
<TextView
android:id="@+id/entry_created"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/EntryItem" />
</LinearLayout>
<LinearLayout
android:id="@+id/entryfield_container_modified"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- Modified -->
<TextView
android:id="@+id/entry_modified_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_modified"
style="@style/EntryFieldHeader" />
<TextView
android:id="@+id/entry_modified"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/EntryItem" />
</LinearLayout>
<LinearLayout
android:id="@+id/entryfield_container_expires"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<!-- Expires -->
<TextView
android:id="@+id/entry_expires_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_expires"
style="@style/EntryFieldHeader" />
<TextView
android:id="@+id/entry_expires"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/EntryItem" />
</LinearLayout>
</LinearLayout>

View File

@ -65,6 +65,7 @@
<string name="entry_confpassword">Confirm password</string>
<string name="entry_created">Created</string>
<string name="entry_expires">Expires</string>
<string name="entry_group_name">Group Name</string>
<string name="entry_keyfile">Key file (optional)</string>
<string name="entry_modified">Modified</string>
<string name="entry_password">Password</string>