Merge "Restore password visibility on screen rotation in Hotspot/Wifi setup." into m-wireless-dev
This commit is contained in:
@@ -184,6 +184,15 @@ public class WifiApDialog extends AlertDialog implements View.OnClickListener,
|
||||
validate();
|
||||
}
|
||||
|
||||
public void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
mPassword.setInputType(
|
||||
InputType.TYPE_CLASS_TEXT |
|
||||
(((CheckBox) mView.findViewById(R.id.show_password)).isChecked() ?
|
||||
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD :
|
||||
InputType.TYPE_TEXT_VARIATION_PASSWORD));
|
||||
}
|
||||
|
||||
private void validate() {
|
||||
if ((mSsid != null && mSsid.length() == 0) ||
|
||||
((mSecurityTypeIndex == WPA2_INDEX)&&
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
|
@@ -74,6 +74,11 @@ class WifiDialog extends AlertDialog implements WifiConfigUiBase {
|
||||
}
|
||||
}
|
||||
|
||||
public void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
mController.updatePassword();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEdit() {
|
||||
return mEdit;
|
||||
|
Reference in New Issue
Block a user