diff options
author | cretin45 <cretin45@gmail.com> | 2015-03-19 15:05:23 -0700 |
---|---|---|
committer | Ed Carrigan <cretin45@gmail.com> | 2015-04-01 02:02:23 +0000 |
commit | 2a01a24066e652b85cd4c6ddefcb93178fcef9fe (patch) | |
tree | 7fff5915da40876842b2836538b0af216cd666e1 /src/com/cyanogenmod/setupwizard/setup | |
parent | d0389e4e6ec9bfaaf2e95b5c2c2afde029fd4571 (diff) | |
download | packages_apps_SetupWizard-2a01a24066e652b85cd4c6ddefcb93178fcef9fe.zip packages_apps_SetupWizard-2a01a24066e652b85cd4c6ddefcb93178fcef9fe.tar.gz packages_apps_SetupWizard-2a01a24066e652b85cd4c6ddefcb93178fcef9fe.tar.bz2 |
SetupWizard: Fix regression for devices without custom default theme
Change-Id: Ia223c1b118dbb68e596ff01cf944bc870a321752
(cherry picked from commit 838248ab868a91948fe5d63a0aba50e6dea13643)
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup')
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java index 3b13d7a..f92e753 100644 --- a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java @@ -218,6 +218,10 @@ public class CyanogenSettingsPage extends SetupPage { private CheckBox mNavKeys; private CheckBox mSecureSms; + private boolean mHideNavKeysRow = false; + private boolean mHideThemeRow = false; + private boolean mHideSmsRow = false; + private View.OnClickListener mMetricsClickListener = new View.OnClickListener() { @Override @@ -289,7 +293,8 @@ public class CyanogenSettingsPage extends SetupPage { mMetrics = (CheckBox) mRootView.findViewById(R.id.enable_metrics_checkbox); mDefaultThemeRow = mRootView.findViewById(R.id.theme); - if (hideThemeSwitch(getActivity())) { + mHideThemeRow = hideThemeSwitch(getActivity()); + if (mHideThemeRow) { mDefaultThemeRow.setVisibility(View.GONE); } else { mDefaultThemeRow.setOnClickListener(mDefaultThemeClickListener); @@ -316,7 +321,8 @@ public class CyanogenSettingsPage extends SetupPage { needsNavBar = windowManager.needsNavigationBar(); } catch (RemoteException e) { } - if (hideKeyDisabler(getActivity()) || needsNavBar) { + mHideNavKeysRow = hideKeyDisabler(getActivity()); + if (mHideNavKeysRow || needsNavBar) { mNavKeysRow.setVisibility(View.GONE); } else { boolean navKeysDisabled = @@ -335,7 +341,8 @@ public class CyanogenSettingsPage extends SetupPage { 0, useSecureSms.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); TextView secureSms = (TextView) mRootView.findViewById(R.id.secure_sms_summary); secureSms.setText(secureSmsSpan); - if (hideWhisperPush(getActivity())) { + mHideSmsRow = hideWhisperPush(getActivity()); + if (mHideSmsRow) { mSecureSmsRow.setVisibility(View.GONE); } mSecureSms = (CheckBox) mRootView.findViewById(R.id.secure_sms_checkbox); @@ -365,30 +372,36 @@ public class CyanogenSettingsPage extends SetupPage { } private void updateThemeOption() { - final Bundle myPageBundle = mPage.getData(); - boolean themesChecked = - !myPageBundle.containsKey(KEY_APPLY_DEFAULT_THEME) || myPageBundle - .getBoolean(KEY_APPLY_DEFAULT_THEME); - mDefaultTheme.setChecked(themesChecked); - myPageBundle.putBoolean(KEY_APPLY_DEFAULT_THEME, themesChecked); + if (!mHideThemeRow) { + final Bundle myPageBundle = mPage.getData(); + boolean themesChecked = + !myPageBundle.containsKey(KEY_APPLY_DEFAULT_THEME) || myPageBundle + .getBoolean(KEY_APPLY_DEFAULT_THEME); + mDefaultTheme.setChecked(themesChecked); + myPageBundle.putBoolean(KEY_APPLY_DEFAULT_THEME, themesChecked); + } } private void updateSmsOption() { - final Bundle myPageBundle = mPage.getData(); - boolean smsChecked = myPageBundle.containsKey(KEY_REGISTER_WHISPERPUSH) ? - myPageBundle.getBoolean(KEY_REGISTER_WHISPERPUSH) : - false; - mSecureSms.setChecked(smsChecked); - myPageBundle.putBoolean(KEY_REGISTER_WHISPERPUSH, smsChecked); + if (!mHideSmsRow) { + final Bundle myPageBundle = mPage.getData(); + boolean smsChecked = myPageBundle.containsKey(KEY_REGISTER_WHISPERPUSH) ? + myPageBundle.getBoolean(KEY_REGISTER_WHISPERPUSH) : + false; + mSecureSms.setChecked(smsChecked); + myPageBundle.putBoolean(KEY_REGISTER_WHISPERPUSH, smsChecked); + } } private void updateDisableNavkeysOption() { - boolean enabled = Settings.Secure.getInt(getActivity().getContentResolver(), - Settings.Secure.DEV_FORCE_SHOW_NAVBAR, 0) != 0; - boolean checked = mPage.getData().containsKey(KEY_ENABLE_NAV_KEYS) ? - mPage.getData().getBoolean(KEY_ENABLE_NAV_KEYS) : - enabled; - mNavKeys.setChecked(checked); + if (!mHideNavKeysRow) { + boolean enabled = Settings.Secure.getInt(getActivity().getContentResolver(), + Settings.Secure.DEV_FORCE_SHOW_NAVBAR, 0) != 0; + boolean checked = mPage.getData().containsKey(KEY_ENABLE_NAV_KEYS) ? + mPage.getData().getBoolean(KEY_ENABLE_NAV_KEYS) : + enabled; + mNavKeys.setChecked(checked); + } } } |