mirror of
https://github.com/moparisthebest/keepass2android
synced 2024-11-22 17:22:17 -05:00
Username can be displayed in lists
This commit is contained in:
parent
13d7062519
commit
e93e9307de
1565
src/keepass2android/Resources/Resource.designer.cs
generated
1565
src/keepass2android/Resources/Resource.designer.cs
generated
File diff suppressed because it is too large
Load Diff
@ -1,40 +1,36 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
|
||||||
|
|
||||||
|
|
||||||
This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file is based on Keepassdroid, Copyright Brian Pellin.
|
|
||||||
|
|
||||||
Keepass2Android is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
Keepass2Android is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with Keepass2Android. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
-->
|
|
||||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:stretchColumns="1">
|
android:stretchColumns="1">
|
||||||
<TableRow android:layout_width="fill_parent"
|
<TableRow
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:gravity="center_vertical">
|
android:layout_height="wrap_content"
|
||||||
<ImageView android:id="@+id/entry_icon"
|
android:gravity="center_vertical">
|
||||||
android:layout_width="wrap_content"
|
<ImageView
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/entry_icon"
|
||||||
android:padding="5dp"
|
android:layout_width="wrap_content"
|
||||||
android:scaleType="fitXY"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic99_blank"/>
|
android:padding="5dp"
|
||||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
android:scaleType="fitXY"
|
||||||
android:id="@+id/entry_text"
|
android:src="@drawable/ic99_blank" />
|
||||||
android:layout_height="wrap_content"
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
style="@style/ElementTextLarge"/>
|
android:layout_height="wrap_content"
|
||||||
<View/>
|
android:orientation="vertical">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/entry_text"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:text="abc"
|
||||||
|
style="@style/ElementTextLarge" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/entry_text_detail"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:text="abcde"
|
||||||
|
style="@style/ElementTextSmall" />
|
||||||
|
</LinearLayout>
|
||||||
|
<View />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableLayout>
|
</TableLayout>
|
@ -41,6 +41,7 @@
|
|||||||
<string name="sort_key">sort_key</string>
|
<string name="sort_key">sort_key</string>
|
||||||
<string name="timeout_key">timeout_key</string>
|
<string name="timeout_key">timeout_key</string>
|
||||||
<string name="TanExpiresOnUse_key">TanExpiresOnUse_key</string>
|
<string name="TanExpiresOnUse_key">TanExpiresOnUse_key</string>
|
||||||
|
<string name="ShowUsernameInList_key">ShowUsernameInList_key</string>
|
||||||
<string name="default_username_key">defaultUsername</string>
|
<string name="default_username_key">defaultUsername</string>
|
||||||
<string name="database_name_key">databaseName</string>
|
<string name="database_name_key">databaseName</string>
|
||||||
<string name="BinaryDirectory_key">binaryDirectory</string>
|
<string name="BinaryDirectory_key">binaryDirectory</string>
|
||||||
@ -50,6 +51,7 @@
|
|||||||
<bool name="sort_default">true</bool>
|
<bool name="sort_default">true</bool>
|
||||||
<bool name="omitbackup_default">true</bool>
|
<bool name="omitbackup_default">true</bool>
|
||||||
<bool name="TanExpiresOnUse_default">true</bool>
|
<bool name="TanExpiresOnUse_default">true</bool>
|
||||||
|
<bool name="ShowUsernameInList_default">true</bool>
|
||||||
|
|
||||||
<string name="QuickUnlockDefaultEnabled_key">Enable_QuickUnlock_by_default</string>
|
<string name="QuickUnlockDefaultEnabled_key">Enable_QuickUnlock_by_default</string>
|
||||||
<string name="QuickUnlockLength_key">QuickUnlockLength</string>
|
<string name="QuickUnlockLength_key">QuickUnlockLength</string>
|
||||||
|
@ -173,6 +173,8 @@
|
|||||||
<string name="regular_expression">Regular expression</string>
|
<string name="regular_expression">Regular expression</string>
|
||||||
<string name="TanExpiresOnUse_title">Tan expires on use</string>
|
<string name="TanExpiresOnUse_title">Tan expires on use</string>
|
||||||
<string name="TanExpiresOnUse_summary">Mark TAN entries expired when using them</string>
|
<string name="TanExpiresOnUse_summary">Mark TAN entries expired when using them</string>
|
||||||
|
<string name="ShowUsernameInList_title">Display username in list</string>
|
||||||
|
<string name="ShowUsernameInList_summary">Display usernames below entry titles. Useful for multiple accounts or TANs.</string>
|
||||||
<string name="kp2a_findUrl">Keepass2Android: Find password</string>
|
<string name="kp2a_findUrl">Keepass2Android: Find password</string>
|
||||||
<string name="excludeExpiredEntries">Exclude expired entries</string>
|
<string name="excludeExpiredEntries">Exclude expired entries</string>
|
||||||
<string name="search_options">Options</string>
|
<string name="search_options">Options</string>
|
||||||
@ -235,7 +237,7 @@
|
|||||||
<string name="translate_app">Translate KP2A</string>
|
<string name="translate_app">Translate KP2A</string>
|
||||||
<string name="ChangeLog_title">Change log</string>
|
<string name="ChangeLog_title">Change log</string>
|
||||||
<string name="ChangeLog_0_8_2"><b>Version 0.8.2</b>\n
|
<string name="ChangeLog_0_8_2"><b>Version 0.8.2</b>\n
|
||||||
* Support for Digest Authentication in WebDAV
|
* Support for Digest Authentication in WebDAV\n
|
||||||
* Bugfixes (OI File manager, Open URL)
|
* Bugfixes (OI File manager, Open URL)
|
||||||
</string>
|
</string>
|
||||||
<string name="ChangeLog_0_8_1"><b>Version 0.8.1</b>\n
|
<string name="ChangeLog_0_8_1"><b>Version 0.8.1</b>\n
|
||||||
|
@ -82,6 +82,12 @@
|
|||||||
android:summary="@string/TanExpiresOnUse_summary"
|
android:summary="@string/TanExpiresOnUse_summary"
|
||||||
android:defaultValue="@bool/TanExpiresOnUse_default"/>
|
android:defaultValue="@bool/TanExpiresOnUse_default"/>
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="@string/ShowUsernameInList_key"
|
||||||
|
android:title="@string/ShowUsernameInList_title"
|
||||||
|
android:summary="@string/ShowUsernameInList_summary"
|
||||||
|
android:defaultValue="@bool/ShowUsernameInList_default"/>
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:key="@string/list_size_key"
|
android:key="@string/list_size_key"
|
||||||
android:title="@string/list_size_title"
|
android:title="@string/list_size_title"
|
||||||
|
@ -38,6 +38,10 @@ namespace keepass2android
|
|||||||
return float.Parse(prefs.GetString(ctx.GetString(Resource.String.list_size_key), ctx.GetString(Resource.String.list_size_default)));
|
return float.Parse(prefs.GetString(ctx.GetString(Resource.String.list_size_key), ctx.GetString(Resource.String.list_size_default)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public static float getListDetailTextSize(Context ctx) {
|
||||||
|
return (float)Math.Round(getListTextSize(ctx)*3.0f/4.0f);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ using Android.Widget;
|
|||||||
using KeePassLib;
|
using KeePassLib;
|
||||||
using Android.Text;
|
using Android.Text;
|
||||||
using Android.Text.Style;
|
using Android.Text.Style;
|
||||||
|
using Android.Preferences;
|
||||||
|
|
||||||
namespace keepass2android.view
|
namespace keepass2android.view
|
||||||
{
|
{
|
||||||
@ -37,7 +38,11 @@ namespace keepass2android.view
|
|||||||
protected GroupBaseActivity mAct;
|
protected GroupBaseActivity mAct;
|
||||||
protected PwEntry mPw;
|
protected PwEntry mPw;
|
||||||
private TextView mTv;
|
private TextView mTv;
|
||||||
|
private TextView mTvDetails;
|
||||||
private int mPos;
|
private int mPos;
|
||||||
|
|
||||||
|
bool mShowDetail;
|
||||||
|
|
||||||
protected const int MENU_OPEN = Menu.First;
|
protected const int MENU_OPEN = Menu.First;
|
||||||
private const int MENU_DELETE = MENU_OPEN + 1;
|
private const int MENU_DELETE = MENU_OPEN + 1;
|
||||||
|
|
||||||
@ -61,6 +66,11 @@ namespace keepass2android.view
|
|||||||
mTv = (TextView)ev.FindViewById(Resource.Id.entry_text);
|
mTv = (TextView)ev.FindViewById(Resource.Id.entry_text);
|
||||||
mTv.TextSize = PrefsUtil.getListTextSize(act);
|
mTv.TextSize = PrefsUtil.getListTextSize(act);
|
||||||
|
|
||||||
|
mTvDetails = (TextView)ev.FindViewById(Resource.Id.entry_text_detail);
|
||||||
|
mTvDetails.TextSize = PrefsUtil.getListDetailTextSize(act);
|
||||||
|
|
||||||
|
mShowDetail = PreferenceManager.GetDefaultSharedPreferences(act).GetBoolean(act.GetString(Resource.String.ShowUsernameInList_key), Resources.GetBoolean(Resource.Boolean.ShowUsernameInList_default));
|
||||||
|
|
||||||
populateView(ev, pw, pos);
|
populateView(ev, pw, pos);
|
||||||
|
|
||||||
LayoutParams lp = new LayoutParams(LayoutParams.FillParent, LayoutParams.WrapContent);
|
LayoutParams lp = new LayoutParams(LayoutParams.FillParent, LayoutParams.WrapContent);
|
||||||
@ -93,7 +103,25 @@ namespace keepass2android.view
|
|||||||
}
|
}
|
||||||
mTv.TextFormatted = str;
|
mTv.TextFormatted = str;
|
||||||
|
|
||||||
|
String detail = pw.Strings.ReadSafe(PwDefs.UserNameField);
|
||||||
|
|
||||||
|
|
||||||
|
if ((mShowDetail == false) || (String.IsNullOrEmpty(detail)))
|
||||||
|
{
|
||||||
|
mTvDetails.Visibility = ViewStates.Gone;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var strDetail = new SpannableString(detail);
|
||||||
|
|
||||||
|
if (isExpired)
|
||||||
|
{
|
||||||
|
strDetail.SetSpan(new StrikethroughSpan(), 0, detail.Length, SpanTypes.ExclusiveExclusive);
|
||||||
|
}
|
||||||
|
mTvDetails.TextFormatted = strDetail;
|
||||||
|
|
||||||
|
mTvDetails.Visibility = ViewStates.Visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void convertView(PwEntry pw, int pos)
|
public void convertView(PwEntry pw, int pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user