Fix the way we select and apply Themes
- do not override the DialogWhenLarge ones (they have their purpose) - apply the correct Theme to SubSettings and then as a consequence to the SwitchBar Change-Id: I83adabf72da03051f03fbd2121e1e71217fc0c6a
This commit is contained in:
@@ -482,12 +482,17 @@ public class SettingsActivity extends Activity
|
|||||||
mIsShowingDashboard = className.equals(Settings.class.getName());
|
mIsShowingDashboard = className.equals(Settings.class.getName());
|
||||||
final boolean isSubSettings = className.equals(SubSettings.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
|
// If this is a sub settings or not the main Dashboard and not a Shortcut and an initial
|
||||||
// Fragment then apply the correct theme for the ActionBar content inset
|
// Fragment then apply the SubSettings theme for the ActionBar content insets
|
||||||
if (isSubSettings ||
|
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);
|
setTheme(R.style.Theme_SubSettings);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setContentView(mIsShowingDashboard ?
|
setContentView(mIsShowingDashboard ?
|
||||||
R.layout.settings_main_dashboard : R.layout.settings_main_prefs);
|
R.layout.settings_main_dashboard : R.layout.settings_main_prefs);
|
||||||
|
Reference in New Issue
Block a user