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();
|
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() {
|
private void validate() {
|
||||||
if ((mSsid != null && mSsid.length() == 0) ||
|
if ((mSsid != null && mSsid.length() == 0) ||
|
||||||
((mSecurityTypeIndex == WPA2_INDEX)&&
|
((mSecurityTypeIndex == WPA2_INDEX)&&
|
||||||
|
@@ -999,14 +999,12 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
/**
|
/**
|
||||||
* Make the characters of the password visible if show_password is checked.
|
* Make the characters of the password visible if show_password is checked.
|
||||||
*/
|
*/
|
||||||
private void updatePasswordVisibility(boolean checked) {
|
public void updatePassword() {
|
||||||
int pos = mPasswordView.getSelectionEnd();
|
TextView passwdView = (TextView) mView.findViewById(R.id.password);
|
||||||
mPasswordView.setInputType(
|
passwdView.setInputType(
|
||||||
InputType.TYPE_CLASS_TEXT | (checked ?
|
InputType.TYPE_CLASS_TEXT |
|
||||||
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD :
|
(((CheckBox) mView.findViewById(R.id.show_password)).isChecked() ?
|
||||||
InputType.TYPE_TEXT_VARIATION_PASSWORD));
|
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD :
|
||||||
if (pos >= 0) {
|
InputType.TYPE_TEXT_VARIATION_PASSWORD));
|
||||||
((EditText)mPasswordView).setSelection(pos);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -74,6 +74,11 @@ class WifiDialog extends AlertDialog implements WifiConfigUiBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||||
|
super.onRestoreInstanceState(savedInstanceState);
|
||||||
|
mController.updatePassword();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEdit() {
|
public boolean isEdit() {
|
||||||
return mEdit;
|
return mEdit;
|
||||||
|
Reference in New Issue
Block a user