OSDN Git Service

Make the text appearance consistant in add vpn dialog
authorlindatseng <lindatseng@google.com>
Wed, 27 Mar 2019 23:25:12 +0000 (16:25 -0700)
committerlindatseng <lindatseng@google.com>
Thu, 28 Mar 2019 18:16:35 +0000 (11:16 -0700)
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

src/com/android/settings/vpn2/ConfigDialog.java

index 07e957d..9f2176c 100644 (file)
@@ -143,6 +143,7 @@ class ConfigDialog extends AlertDialog implements TextWatcher,
         }
         mMppe.setChecked(mProfile.mppe);
         mL2tpSecret.setText(mProfile.l2tpSecret);
+        mL2tpSecret.setTextAppearance(android.R.style.TextAppearance_DeviceDefault_Medium);
         mIpsecIdentifier.setText(mProfile.ipsecIdentifier);
         mIpsecSecret.setText(mProfile.ipsecSecret);
         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);
         mSaveLogin.setChecked(mProfile.saveLogin);
         mAlwaysOnVpn.setChecked(mProfile.key.equals(VpnUtils.getLockdownVpn()));
+        mPassword.setTextAppearance(android.R.style.TextAppearance_DeviceDefault_Medium);
 
         // Hide lockdown VPN on devices that require IMS authentication
         if (SystemProperties.getBoolean("persist.radio.imsregrequired", false)) {