Minor UI polishing

- don't display "last access" (always =current time)
 - don't display expires if entry doesn't expire
 - don't view file name in password screen when only one file has ever been opened
This commit is contained in:
Philipp Crocoll 2013-11-09 06:51:54 +01:00
parent 500bcfcce7
commit fd45e68b2f
11 changed files with 1986 additions and 4840 deletions

View File

@ -20,7 +20,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>False</Optimize> <Optimize>False</Optimize>
<OutputPath>bin\Debug</OutputPath> <OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;EXCLUDE_TWOFISH;INCLUDE_KEYBOARD;EXCLUDE_KEYTRANSFORM;INCLUDE_FILECHOOSER;INCLUDE_JAVAFILESTORAGE</DefineConstants> <DefineConstants>DEBUG;EXCLUDE_TWOFISH;EXCLUDE_KEYBOARD;EXCLUDE_KEYTRANSFORM;EXCLUDE_FILECHOOSER;EXCLUDE_JAVAFILESTORAGE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause> <ConsolePause>False</ConsolePause>

View File

@ -20,7 +20,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;EXCLUDE_TWOFISH;INCLUDE_KEYBOARD;EXCLUDE_KEYTRANSFORM;INCLUDE_FILECHOOSER;INCLUDE_JAVAFILESTORAGE</DefineConstants> <DefineConstants>TRACE;DEBUG;EXCLUDE_TWOFISH;EXCLUDE_KEYBOARD;EXCLUDE_KEYTRANSFORM;EXCLUDE_FILECHOOSER;EXCLUDE_JAVAFILESTORAGE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>

View File

@ -405,14 +405,19 @@ namespace keepass2android
PopulateText(Resource.Id.entry_created, Resource.Id.entry_created_label, getDateTime(Entry.CreationTime)); PopulateText(Resource.Id.entry_created, Resource.Id.entry_created_label, getDateTime(Entry.CreationTime));
PopulateText(Resource.Id.entry_modified, Resource.Id.entry_modified_label, getDateTime(Entry.LastModificationTime)); PopulateText(Resource.Id.entry_modified, Resource.Id.entry_modified_label, getDateTime(Entry.LastModificationTime));
PopulateText(Resource.Id.entry_accessed, Resource.Id.entry_accessed_label, getDateTime(Entry.LastAccessTime));
if (Entry.Expires) if (Entry.Expires)
{ {
FindViewById(Resource.Id.entry_expires).Visibility = ViewStates.Visible;
FindViewById(Resource.Id.entry_expires_label).Visibility = ViewStates.Visible;
PopulateText(Resource.Id.entry_expires, Resource.Id.entry_expires_label, getDateTime(Entry.ExpiryTime)); PopulateText(Resource.Id.entry_expires, Resource.Id.entry_expires_label, getDateTime(Entry.ExpiryTime));
} else
}
else
{ {
PopulateText(Resource.Id.entry_expires, Resource.Id.entry_expires_label, Resource.String.never); FindViewById(Resource.Id.entry_expires).Visibility = ViewStates.Gone;
FindViewById(Resource.Id.entry_expires_label).Visibility = ViewStates.Gone;
} }
PopulateText(Resource.Id.entry_comment, Resource.Id.entry_comment_label, Entry.Strings.ReadSafe(PwDefs.NotesField)); PopulateText(Resource.Id.entry_comment, Resource.Id.entry_comment_label, Entry.Strings.ReadSafe(PwDefs.NotesField));

View File

@ -510,6 +510,14 @@ namespace keepass2android
private void PopulateView() { private void PopulateView() {
SetEditText(Resource.Id.filename, App.Kp2a.GetFileStorage(_ioConnection).GetDisplayName(_ioConnection)); SetEditText(Resource.Id.filename, App.Kp2a.GetFileStorage(_ioConnection).GetDisplayName(_ioConnection));
if (App.Kp2a.FileDbHelper.NumberOfRecentFiles() < 2)
{
FindViewById(Resource.Id.filename_group).Visibility = ViewStates.Gone;
}
else
{
FindViewById(Resource.Id.filename_group).Visibility = ViewStates.Visible;
}
SetEditText(Resource.Id.pass_keyfile, _keyFile); SetEditText(Resource.Id.pass_keyfile, _keyFile);
} }

File diff suppressed because it is too large Load Diff

View File

@ -149,19 +149,6 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/EntryItem" /> style="@style/EntryItem" />
<!-- Accessed -->
<TextView
android:id="@+id/entry_accessed_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_accessed"
style="@style/EntryFieldHeader"
/>
<TextView
android:id="@+id/entry_accessed"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/EntryItem" />
<!-- Expires --> <!-- Expires -->
<TextView <TextView
android:id="@+id/entry_expires_label" android:id="@+id/entry_expires_label"

View File

@ -5,46 +5,51 @@
android:layout_marginLeft="12dip" android:layout_marginLeft="12dip"
android:layout_marginRight="12dip" android:layout_marginRight="12dip"
android:layout_marginBottom="12dip"> android:layout_marginBottom="12dip">
<TextView <RelativeLayout
android:id="@+id/filename_label" android:id="@+id/filename_group"
android:layout_width="wrap_content" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
style="@style/TextAppearance_SmallHeading" <TextView
android:text="@string/pass_filename" /> android:id="@+id/filename_label"
<ImageView android:layout_width="wrap_content"
android:id="@+id/divider1" android:layout_height="wrap_content"
android:layout_width="fill_parent" style="@style/TextAppearance_SmallHeading"
android:layout_height="wrap_content" android:text="@string/pass_filename" />
android:layout_below="@id/filename_label" <ImageView
android:scaleType="fitXY" android:id="@+id/divider1"
android:src="@android:drawable/divider_horizontal_dark" /> android:layout_width="fill_parent"
<HorizontalScrollView android:layout_height="wrap_content"
android:id="@+id/filenamescroll" android:layout_below="@id/filename_label"
android:layout_width="fill_parent" android:scaleType="fitXY"
android:layout_height="wrap_content" android:src="@android:drawable/divider_horizontal_dark" />
android:layout_below="@id/divider1"> <HorizontalScrollView
<TextView android:id="@+id/filenamescroll"
android:id="@+id/filename" android:layout_width="fill_parent"
style="@style/GroupText" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_below="@id/divider1">
android:layout_height="wrap_content" <TextView
android:singleLine="true" android:id="@+id/filename"
android:ellipsize="none" style="@style/GroupText"
android:focusable="true" android:layout_width="fill_parent"
android:focusableInTouchMode="true" /> android:layout_height="wrap_content"
</HorizontalScrollView> android:singleLine="true"
<ImageView android:ellipsize="none"
android:id="@+id/divider2" android:focusable="true"
android:layout_width="fill_parent" android:focusableInTouchMode="true" />
android:layout_height="wrap_content" </HorizontalScrollView>
android:layout_below="@id/filenamescroll" <ImageView
android:scaleType="fitXY" android:id="@+id/divider2"
android:src="@android:drawable/divider_horizontal_dark" /> android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/filenamescroll"
android:scaleType="fitXY"
android:src="@android:drawable/divider_horizontal_dark" />
</RelativeLayout>
<TextView <TextView
android:id="@+id/password_label" android:id="@+id/password_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/divider2" android:layout_below="@id/filename_group"
android:text="" /> android:text="" />
<LinearLayout <LinearLayout
android:id="@+id/passwordLine" android:id="@+id/passwordLine"

View File

@ -138,19 +138,6 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/EntryItem" /> style="@style/EntryItem" />
<!-- Accessed -->
<TextView
android:id="@+id/entry_accessed_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/entry_accessed"
style="@style/EntryFieldHeader"
/>
<TextView
android:id="@+id/entry_accessed"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/EntryItem" />
<!-- Expires --> <!-- Expires -->
<TextView <TextView
android:id="@+id/entry_expires_label" android:id="@+id/entry_expires_label"

View File

@ -2,45 +2,50 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent"> android:layout_height="fill_parent">
<TextView <RelativeLayout
android:id="@+id/filename_label" android:id="@+id/filename_group"
android:layout_width="wrap_content" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:text="@string/pass_filename" /> <TextView
<ImageView android:id="@+id/filename_label"
android:id="@+id/divider1" android:layout_width="wrap_content"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/pass_filename" />
android:layout_below="@id/filename_label" <ImageView
android:scaleType="fitXY" android:id="@+id/divider1"
android:src="@android:drawable/divider_horizontal_dark" /> android:layout_width="fill_parent"
<HorizontalScrollView android:layout_height="wrap_content"
android:id="@+id/filenamescroll" android:layout_below="@id/filename_label"
android:layout_width="fill_parent" android:scaleType="fitXY"
android:layout_height="wrap_content" android:src="@android:drawable/divider_horizontal_dark" />
android:layout_below="@id/divider1"> <HorizontalScrollView
<TextView android:id="@+id/filenamescroll"
android:id="@+id/filename" android:layout_width="fill_parent"
style="@style/GroupText" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_below="@id/divider1">
android:layout_height="wrap_content" <TextView
android:singleLine="true" android:id="@+id/filename"
android:ellipsize="none" style="@style/GroupText"
android:focusable="true" android:layout_width="fill_parent"
android:focusableInTouchMode="true" /> android:layout_height="wrap_content"
</HorizontalScrollView> android:singleLine="true"
<ImageView android:ellipsize="none"
android:id="@+id/divider2" android:focusable="true"
android:layout_width="fill_parent" android:focusableInTouchMode="true" />
android:layout_height="wrap_content" </HorizontalScrollView>
android:layout_below="@id/filenamescroll" <ImageView
android:scaleType="fitXY" android:id="@+id/divider2"
android:src="@android:drawable/divider_horizontal_dark" /> android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/filenamescroll"
android:scaleType="fitXY"
android:src="@android:drawable/divider_horizontal_dark" />
</RelativeLayout>
<TextView <TextView
android:id="@+id/password_label" android:id="@+id/password_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/divider2" android:layout_below="@id/filename_group"
android:text="" /> android:text="" />
<ImageButton <ImageButton
android:id="@+id/toggle_password" android:id="@+id/toggle_password"

View File

@ -250,13 +250,19 @@ namespace keepass2android
return keyfileFilename; return keyfileFilename;
} }
public bool HasRecentFiles() { public bool HasRecentFiles()
{
return NumberOfRecentFiles() > 0;
}
public int NumberOfRecentFiles()
{
ICursor cursor = FetchAllFiles(); ICursor cursor = FetchAllFiles();
bool hasRecent = cursor.Count > 0; int numRecent = cursor.Count;
cursor.Close(); cursor.Close();
return hasRecent; return numRecent;
} }
public IOConnectionInfo CursorToIoc(ICursor cursor) public IOConnectionInfo CursorToIoc(ICursor cursor)

View File

@ -24,7 +24,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>False</Optimize> <Optimize>False</Optimize>
<OutputPath>bin\Debug</OutputPath> <OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;EXCLUDE_TWOFISH;INCLUDE_KEYBOARD;EXCLUDE_KEYTRANSFORM;INCLUDE_FILECHOOSER;INCLUDE_JAVAFILESTORAGE</DefineConstants> <DefineConstants>DEBUG;EXCLUDE_TWOFISH;EXCLUDE_KEYBOARD;EXCLUDE_KEYTRANSFORM;EXCLUDE_FILECHOOSER;EXCLUDE_JAVAFILESTORAGE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause> <ConsolePause>False</ConsolePause>