* PasswordActivity: Password field requests focus and keyboard is opened

* Automatic opening of keyboard selection dialog can be turned on/off in settings
This commit is contained in:
Philipp Crocoll 2013-06-01 19:24:42 +02:00
parent 40286f4f43
commit 0c4f7d6aed
6 changed files with 507 additions and 476 deletions

View File

@ -34,6 +34,7 @@ using Android.Content.PM;
using Android.Text.Method;
using KeePassLib.Keys;
using KeePassLib.Serialization;
using Android.Views.InputMethods;
namespace keepass2android
{
@ -341,7 +342,13 @@ namespace keepass2android
SetContentView(Resource.Layout.password);
populateView();
EditText passwordEdit = FindViewById<EditText>(Resource.Id.password);
passwordEdit.RequestFocus();
Window.SetSoftInputMode(SoftInput.StateVisible);
Button confirmButton = (Button)FindViewById(Resource.Id.pass_ok);
confirmButton.Click += (object sender, EventArgs e) =>
{

File diff suppressed because it is too large Load Diff

View File

@ -71,6 +71,9 @@
<string name="UseKp2aKeyboard_key">ShowKp2aKeyboardNotification</string>
<bool name="UseKp2aKeyboard_default">true</bool>
<string name="OpenKp2aKeyboardAutomatically_key">OpenKp2aKeyboardAutomatically</string>
<bool name="OpenKp2aKeyboardAutomatically_default">true</bool>
<string name="clipboard_timeout_default">300000</string>
<string-array name="clipboard_timeout_values">
<item>30000</item>

View File

@ -221,6 +221,8 @@
<string name="ShowCopyToClipboardNotification_summary">Make username and password accessible through the notification bar and clipboard. Beware of password sniffers!</string>
<string name="ShowKp2aKeyboardNotification_title">KP2A keyboard notification</string>
<string name="ShowKp2aKeyboardNotification_summary">Make full entry accessible through the KP2A keyboard (recommended).</string>
<string name="OpenKp2aKeyboardAutomatically_title">Keyboard selection dialog</string>
<string name="OpenKp2aKeyboardAutomatically_summary">Open keyboard selection dialog when entry is available through KP2A keyboard after search.</string>
<string name="AskOverwriteBinary">Do you want to overwrite the existing binary with the same name?</string>
<string name="AskOverwriteBinary_title">Overwrite existing binary?</string>

View File

@ -111,6 +111,13 @@
android:defaultValue="@bool/UseKp2aKeyboard_default"
android:title="@string/ShowKp2aKeyboardNotification_title"
android:key="@string/UseKp2aKeyboard_key" />
<CheckBoxPreference
android:enabled="true"
android:persistent="true"
android:summary="@string/OpenKp2aKeyboardAutomatically_summary"
android:defaultValue="@bool/OpenKp2aKeyboardAutomatically_default"
android:title="@string/OpenKp2aKeyboardAutomatically_title"
android:key="@string/OpenKp2aKeyboardAutomatically_key" />
<CheckBoxPreference

View File

@ -187,7 +187,7 @@ namespace keepass2android
//if the app is about to be closed again (e.g. after searching for a URL and returning to the browser:
// automatically bring up the Keyboard selection dialog
if (closeAfterCreate)
if ((closeAfterCreate) && (prefs.GetBoolean(GetString(Resource.String.OpenKp2aKeyboardAutomatically_key), Resources.GetBoolean(Resource.Boolean.OpenKp2aKeyboardAutomatically_default)) == true))
{
ActivateKp2aKeyboard(this);
}