Restore cursor position after switching password visibility.
This commit is contained in:
@@ -150,6 +150,7 @@ namespace keepass2android
|
||||
{
|
||||
TextView password = (TextView)FindViewById(Resource.Id.entry_password);
|
||||
TextView confpassword = (TextView)FindViewById(Resource.Id.entry_confpassword);
|
||||
int selStart = password.SelectionStart, selEnd = password.SelectionEnd;
|
||||
if (_showPassword)
|
||||
{
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationVisiblePassword;
|
||||
@@ -161,7 +162,7 @@ namespace keepass2android
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationPassword;
|
||||
confpassword.Visibility = ViewStates.Visible;
|
||||
}
|
||||
|
||||
password.SetSelection(selStart, selEnd);
|
||||
}
|
||||
|
||||
private void CreateDatabase(bool makeCurrent)
|
||||
|
||||
@@ -393,6 +393,7 @@ namespace keepass2android
|
||||
{
|
||||
TextView password = (TextView) FindViewById(Resource.Id.entry_password);
|
||||
TextView confpassword = (TextView) FindViewById(Resource.Id.entry_confpassword);
|
||||
int selStart = password.SelectionStart, selEnd = password.SelectionEnd;
|
||||
if (State.ShowPassword)
|
||||
{
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationVisiblePassword;
|
||||
@@ -403,6 +404,7 @@ namespace keepass2android
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationPassword;
|
||||
confpassword.Visibility = ViewStates.Visible;
|
||||
}
|
||||
password.SetSelection(selStart, selEnd);
|
||||
}
|
||||
|
||||
void SaveEntry()
|
||||
|
||||
@@ -1498,6 +1498,7 @@ namespace keepass2android
|
||||
private void MakePasswordMaskedOrVisible()
|
||||
{
|
||||
TextView password = (TextView) FindViewById(Resource.Id.password_edit);
|
||||
int selStart = password.SelectionStart, selEnd = password.SelectionEnd;
|
||||
if (_showPassword)
|
||||
{
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationVisiblePassword;
|
||||
@@ -1507,7 +1508,7 @@ namespace keepass2android
|
||||
{
|
||||
password.InputType = InputTypes.ClassText | InputTypes.TextVariationPassword;
|
||||
}
|
||||
|
||||
password.SetSelection(selStart, selEnd);
|
||||
}
|
||||
|
||||
protected override void OnPause()
|
||||
|
||||
Reference in New Issue
Block a user