am a4eebd87: am 595b61eb: am 39a2cbb3: Merge "Fix the way we select and apply Themes" into lmp-dev

* commit 'a4eebd87d29b5e240103eb1f2fa3740efe560633':
  Fix the way we select and apply Themes
This commit is contained in:
Fabrice Di Meglio
2014-07-21 18:22:15 +00:00
committed by Android Git Automerger

View File

@@ -482,12 +482,17 @@ public class SettingsActivity extends Activity
mIsShowingDashboard = className.equals(Settings.class.getName());
final boolean isSubSettings = className.equals(SubSettings.class.getName());
// If this is a sub settings or not the main Dashboard and not a Shortcut and not initial
// Fragment then apply the correct theme for the ActionBar content inset
// If this is a sub settings or not the main Dashboard and not a Shortcut and an initial
// Fragment then apply the SubSettings theme for the ActionBar content insets
if (isSubSettings ||
(!mIsShowingDashboard && !mIsShortcut && (initialFragmentName == null))) {
(!mIsShowingDashboard && !mIsShortcut && (initialFragmentName != null))) {
// Check also that we are not a Theme Dialog as we don't want to override them
final int themeResId = getThemeResId();
if (themeResId != R.style.Theme_DialogWhenLarge &&
themeResId != R.style.Theme_SubSettingsDialogWhenLarge) {
setTheme(R.style.Theme_SubSettings);
}
}
setContentView(mIsShowingDashboard ?
R.layout.settings_main_dashboard : R.layout.settings_main_prefs);