Apply password font in EditText views, closes #404

This commit is contained in:
Philipp Crocoll
2020-02-15 10:05:27 +01:00
parent ff95c32c2d
commit e1416b984e

View File

@@ -63,6 +63,8 @@ namespace keepass2android
const string IntentContinueWithEditing = "ContinueWithEditing";
private PasswordFont _passwordFont = new PasswordFont();
EntryEditActivityState State
{
get { return App.Kp2a.EntryEditActivityState; }
@@ -401,6 +403,7 @@ namespace keepass2android
if (State.ShowPassword)
{
password.InputType = InputTypes.ClassText | InputTypes.TextVariationVisiblePassword;
_passwordFont.ApplyTo(password);
confpassword.Visibility = ViewStates.Gone;
}
else
@@ -569,6 +572,8 @@ namespace keepass2android
continue;
TextView valueView = (TextView)view.FindViewById(Resource.Id.value);
String value = valueView.Text;
bool protect = ((CheckBox) view.FindViewById(Resource.Id.protection))?.Checked ?? State.EntryInDatabase.Strings.GetSafe(key).IsProtected;
@@ -1043,7 +1048,7 @@ namespace keepass2android
titleView.Text = title;
((TextView)ees.FindViewById(Resource.Id.value)).Text = pair.Value.ReadString();
((TextView)ees.FindViewById(Resource.Id.value)).TextChanged += (sender, e) => State.EntryModified = true;
_passwordFont.ApplyTo(((TextView)ees.FindViewById(Resource.Id.value)));
((CheckBox)ees.FindViewById(Resource.Id.protection)).Checked = pair.Value.IsProtected;
//ees.FindViewById(Resource.Id.edit_extra).Click += (sender, e) => DeleteAdvancedString((View)sender);
@@ -1105,6 +1110,7 @@ namespace keepass2android
View ees = (View) sender.Parent;
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;
_passwordFont.ApplyTo(dlgView.FindViewById<EditText>(Resource.Id.value));
Util.SetNoPersonalizedLearning(dlgView);
dlgView.FindViewById<CheckBox>(Resource.Id.protection).Checked = ees.FindViewById<CheckBox>(Resource.Id.protection).Checked;
@@ -1152,6 +1158,10 @@ namespace keepass2android
PopulateText(Resource.Id.entry_password, password);
PopulateText(Resource.Id.entry_confpassword, password);
_passwordFont.ApplyTo(FindViewById<EditText>(Resource.Id.entry_password));
PopulateText(Resource.Id.entry_comment, State.Entry.Strings.ReadSafe (PwDefs.NotesField));
LinearLayout container = (LinearLayout) FindViewById(Resource.Id.advanced_container);