set "no personalized learning" flag for IMEs when entering data to the database, closing #718
This commit is contained in:
@@ -141,8 +141,9 @@ namespace keepass2android
|
|||||||
Android.Graphics.Color color = new Android.Graphics.Color (224, 224, 224);
|
Android.Graphics.Color color = new Android.Graphics.Color (224, 224, 224);
|
||||||
btnTogglePassword.SetColorFilter (color, mMode);
|
btnTogglePassword.SetColorFilter (color, mMode);
|
||||||
|
|
||||||
|
Util.SetNoPersonalizedLearning(FindViewById(Resource.Id.root));
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
readonly PasswordFont _passwordFont = new PasswordFont();
|
readonly PasswordFont _passwordFont = new PasswordFont();
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,8 @@ namespace keepass2android
|
|||||||
SetContentView(Resource.Layout.entry_edit);
|
SetContentView(Resource.Layout.entry_edit);
|
||||||
_closeForReload = false;
|
_closeForReload = false;
|
||||||
|
|
||||||
|
Util.SetNoPersonalizedLearning(FindViewById(Resource.Id.entry_scroll));
|
||||||
|
|
||||||
// Likely the app has been killed exit the activity
|
// Likely the app has been killed exit the activity
|
||||||
if (!App.Kp2a.DatabaseIsUnlocked)
|
if (!App.Kp2a.DatabaseIsUnlocked)
|
||||||
{
|
{
|
||||||
@@ -291,8 +293,10 @@ namespace keepass2android
|
|||||||
State.EntryModified = true;
|
State.EntryModified = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnStart()
|
protected override void OnStart()
|
||||||
{
|
{
|
||||||
@@ -1101,7 +1105,8 @@ namespace keepass2android
|
|||||||
View ees = (View) sender.Parent;
|
View ees = (View) sender.Parent;
|
||||||
dlgView.FindViewById<TextView>(Resource.Id.title).Text = ees.FindViewById<TextView>(Resource.Id.extrakey).Text;
|
dlgView.FindViewById<TextView>(Resource.Id.title).Text = ees.FindViewById<TextView>(Resource.Id.extrakey).Text;
|
||||||
dlgView.FindViewById<EditText>(Resource.Id.value).Text = ees.FindViewById<EditText>(Resource.Id.value).Text;
|
dlgView.FindViewById<EditText>(Resource.Id.value).Text = ees.FindViewById<EditText>(Resource.Id.value).Text;
|
||||||
dlgView.FindViewById<CheckBox>(Resource.Id.protection).Checked = ees.FindViewById<CheckBox>(Resource.Id.protection).Checked;
|
Util.SetNoPersonalizedLearning(dlgView);
|
||||||
|
dlgView.FindViewById<CheckBox>(Resource.Id.protection).Checked = ees.FindViewById<CheckBox>(Resource.Id.protection).Checked;
|
||||||
|
|
||||||
var titleView = ((AutoCompleteTextView)dlgView.FindViewById(Resource.Id.title));
|
var titleView = ((AutoCompleteTextView)dlgView.FindViewById(Resource.Id.title));
|
||||||
titleView.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, Android.Resource.Id.Text1, AdditionalKeys);
|
titleView.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, Android.Resource.Id.Text1, AdditionalKeys);
|
||||||
|
|||||||
@@ -783,10 +783,11 @@ namespace keepass2android
|
|||||||
//database already opened. return the ioc and we're good.
|
//database already opened. return the ioc and we're good.
|
||||||
LaunchNextActivity();
|
LaunchNextActivity();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void InitializeToolbarCollapsing()
|
Util.SetNoPersonalizedLearning(FindViewById<EditText>(Resource.Id.password_edit));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeToolbarCollapsing()
|
||||||
{
|
{
|
||||||
var rootview = FindViewById<MeasuringRelativeLayout>(Resource.Id.relative_layout);
|
var rootview = FindViewById<MeasuringRelativeLayout>(Resource.Id.relative_layout);
|
||||||
rootview.ViewTreeObserver.GlobalLayout += (sender, args2) =>
|
rootview.ViewTreeObserver.GlobalLayout += (sender, args2) =>
|
||||||
|
|||||||
@@ -145,9 +145,11 @@ namespace keepass2android
|
|||||||
filter.AddAction(Intents.DatabaseLocked);
|
filter.AddAction(Intents.DatabaseLocked);
|
||||||
RegisterReceiver(_intentReceiver, filter);
|
RegisterReceiver(_intentReceiver, filter);
|
||||||
|
|
||||||
|
Util.SetNoPersonalizedLearning(FindViewById<EditText>(Resource.Id.QuickUnlock_password));
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnStart()
|
protected override void OnStart()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
android:id="@+id/root"
|
||||||
android:layout_margin="12dip">
|
android:layout_margin="12dip">
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ using Android.Graphics;
|
|||||||
using Android.Graphics.Drawables;
|
using Android.Graphics.Drawables;
|
||||||
using Android.Hardware.Display;
|
using Android.Hardware.Display;
|
||||||
using Android.Util;
|
using Android.Util;
|
||||||
|
using Android.Views.InputMethods;
|
||||||
|
using AndroidX.Core.View.InputMethod;
|
||||||
using KeePassLib.Serialization;
|
using KeePassLib.Serialization;
|
||||||
using Uri = Android.Net.Uri;
|
using Uri = Android.Net.Uri;
|
||||||
|
|
||||||
@@ -634,6 +636,32 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
return hasUnsecureDisplay;
|
return hasUnsecureDisplay;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static void SetNoPersonalizedLearning(EditText editText)
|
||||||
|
{
|
||||||
|
if (editText == null)
|
||||||
|
return;
|
||||||
|
if ((int) Build.VERSION.SdkInt >= 26)
|
||||||
|
editText.ImeOptions = (ImeAction)EditorInfoCompat.ImeFlagNoPersonalizedLearning;
|
||||||
|
;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetNoPersonalizedLearning(View view)
|
||||||
|
{
|
||||||
|
if (view is ViewGroup vg)
|
||||||
|
{
|
||||||
|
for (int i=0;i<vg.ChildCount;i++)
|
||||||
|
{
|
||||||
|
SetNoPersonalizedLearning(vg.GetChildAt(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (view is EditText editText)
|
||||||
|
{
|
||||||
|
SetNoPersonalizedLearning(editText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user