Gray out the selection while the key is not available.

Bug: 15607413

The old logic was simply making it not selectable. This will disable
it and gray it out providing better feedback.

Change-Id: Iaeaae43f28100ba1a1550db0a919172a249054e8
This commit is contained in:
Selim Gurun
2014-06-17 10:24:44 -07:00
parent 48afff27a2
commit 41745a430d

View File

@@ -360,8 +360,10 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
mWebViewDataReductionProxy = findAndInitCheckboxPref(WEBVIEW_DATA_REDUCTION_PROXY_KEY);
String key = Settings.Global.getString(getActivity().getContentResolver(),
Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
// Make it not selectable if the key is not available for some reason.
mWebViewDataReductionProxy.setSelectable(key != null && !key.isEmpty());
// Disable the selection if the key is not available for some reason.
if (key == null || key.isEmpty()) {
disableForUser(mWebViewDataReductionProxy);
}
}
private ListPreference addListPreference(String prefKey) {