Restore password visibility on screen rotation in Hotspot/Wifi setup.

Bug: 16237425
Change-Id: I2bf0aaaa657d60f007858c6635d2a17326562c66
This commit is contained in:
Sanket Padawe
2015-03-20 10:07:50 -07:00
parent 736d29b87c
commit 3eb3b104d7
3 changed files with 21 additions and 9 deletions

View File

@@ -999,14 +999,12 @@ public class WifiConfigController implements TextWatcher,
/**
* Make the characters of the password visible if show_password is checked.
*/
private void updatePasswordVisibility(boolean checked) {
int pos = mPasswordView.getSelectionEnd();
mPasswordView.setInputType(
InputType.TYPE_CLASS_TEXT | (checked ?
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD :
InputType.TYPE_TEXT_VARIATION_PASSWORD));
if (pos >= 0) {
((EditText)mPasswordView).setSelection(pos);
}
public void updatePassword() {
TextView passwdView = (TextView) mView.findViewById(R.id.password);
passwdView.setInputType(
InputType.TYPE_CLASS_TEXT |
(((CheckBox) mView.findViewById(R.id.show_password)).isChecked() ?
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD :
InputType.TYPE_TEXT_VARIATION_PASSWORD));
}
}