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>
<Optimize>False</Optimize>
<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>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>

View File

@ -20,7 +20,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<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>
<WarningLevel>4</WarningLevel>
</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_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)
{
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));
} 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));

View File

@ -510,6 +510,14 @@ namespace keepass2android
private void PopulateView() {
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);
}

File diff suppressed because it is too large Load Diff

View File

@ -149,19 +149,6 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
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 -->
<TextView
android:id="@+id/entry_expires_label"

View File

@ -5,6 +5,10 @@
android:layout_marginLeft="12dip"
android:layout_marginRight="12dip"
android:layout_marginBottom="12dip">
<RelativeLayout
android:id="@+id/filename_group"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/filename_label"
android:layout_width="wrap_content"
@ -40,11 +44,12 @@
android:layout_below="@id/filenamescroll"
android:scaleType="fitXY"
android:src="@android:drawable/divider_horizontal_dark" />
</RelativeLayout>
<TextView
android:id="@+id/password_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/divider2"
android:layout_below="@id/filename_group"
android:text="" />
<LinearLayout
android:id="@+id/passwordLine"

View File

@ -138,19 +138,6 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
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 -->
<TextView
android:id="@+id/entry_expires_label"

View File

@ -2,6 +2,10 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="@+id/filename_group"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/filename_label"
android:layout_width="wrap_content"
@ -36,11 +40,12 @@
android:layout_below="@id/filenamescroll"
android:scaleType="fitXY"
android:src="@android:drawable/divider_horizontal_dark" />
</RelativeLayout>
<TextView
android:id="@+id/password_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/divider2"
android:layout_below="@id/filename_group"
android:text="" />
<ImageButton
android:id="@+id/toggle_password"

View File

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

View File

@ -24,7 +24,7 @@
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<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>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>