Make the text appearance consistant in add vpn dialog

Set the password fields text appearance programatically to get the
appearance consistant.

The style set in xml will be overriden if the field is set to password.

I set the text appearance programmatically in order to keep the
appearance consistent with the others.  The color of the text become
gray after setting the text appearance for some reason.

Note that I also do changes to the password field which is not mentioned
in the bug.

Test: visual inspection.
Bug: 127728228
Change-Id: Ie206f60877eb39addc1370ae4e2aee379597960e
This commit is contained in:
lindatseng
2019-03-27 16:25:12 -07:00
parent 200fe62814
commit e0f24e6f5e

View File

@@ -143,6 +143,7 @@ class ConfigDialog extends AlertDialog implements TextWatcher,
} }
mMppe.setChecked(mProfile.mppe); mMppe.setChecked(mProfile.mppe);
mL2tpSecret.setText(mProfile.l2tpSecret); mL2tpSecret.setText(mProfile.l2tpSecret);
mL2tpSecret.setTextAppearance(android.R.style.TextAppearance_DeviceDefault_Medium);
mIpsecIdentifier.setText(mProfile.ipsecIdentifier); mIpsecIdentifier.setText(mProfile.ipsecIdentifier);
mIpsecSecret.setText(mProfile.ipsecSecret); mIpsecSecret.setText(mProfile.ipsecSecret);
loadCertificates(mIpsecUserCert, Credentials.USER_PRIVATE_KEY, 0, mProfile.ipsecUserCert); loadCertificates(mIpsecUserCert, Credentials.USER_PRIVATE_KEY, 0, mProfile.ipsecUserCert);
@@ -152,6 +153,7 @@ class ConfigDialog extends AlertDialog implements TextWatcher,
R.string.vpn_no_server_cert, mProfile.ipsecServerCert); R.string.vpn_no_server_cert, mProfile.ipsecServerCert);
mSaveLogin.setChecked(mProfile.saveLogin); mSaveLogin.setChecked(mProfile.saveLogin);
mAlwaysOnVpn.setChecked(mProfile.key.equals(VpnUtils.getLockdownVpn())); mAlwaysOnVpn.setChecked(mProfile.key.equals(VpnUtils.getLockdownVpn()));
mPassword.setTextAppearance(android.R.style.TextAppearance_DeviceDefault_Medium);
// Hide lockdown VPN on devices that require IMS authentication // Hide lockdown VPN on devices that require IMS authentication
if (SystemProperties.getBoolean("persist.radio.imsregrequired", false)) { if (SystemProperties.getBoolean("persist.radio.imsregrequired", false)) {