Simplifiy themes

This commit is contained in:
Andrew Rabert 2019-12-22 14:17:26 -05:00
parent f56c976de7
commit c5c4185e2f
3 changed files with 42 additions and 94 deletions

View File

@ -58,24 +58,13 @@ public final class ThemeUtil {
} }
private static int getThemeRes(Context context, String theme) { private static int getThemeRes(Context context, String theme) {
if (context instanceof SubsonicFragmentActivity || context instanceof SettingsActivity) { switch (theme) {
switch (theme) { case THEME_DARK:
case THEME_DARK: return R.style.Theme_Audinaut_Dark;
return R.style.Theme_Audinaut_Dark_No_Color; case THEME_BLACK:
case THEME_BLACK: return R.style.Theme_Audinaut_Black;
return R.style.Theme_Audinaut_Black_No_Color; default:
default: return R.style.Theme_Audinaut_Light;
return R.style.Theme_Audinaut_Light_No_Color;
}
} else {
switch (theme) {
case THEME_DARK:
return R.style.Theme_Audinaut_Dark;
case THEME_BLACK:
return R.style.Theme_Audinaut_Black;
default:
return R.style.Theme_Audinaut_Light;
}
} }
} }

View File

@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:background="?attr/actionModeBackground" android:background="?attr/colorPrimaryDark"
android:orientation="vertical"> android:orientation="vertical">
<View <View

View File

@ -7,7 +7,6 @@
<style name="Theme.Audinaut.Light" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <style name="Theme.Audinaut.Light" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="element_color">@color/lightElement</item> <item name="element_color">@color/lightElement</item>
<item name="actionbar_element_color">@color/darkElement</item>
<item name="offline_icon">@drawable/main_offline</item> <item name="offline_icon">@drawable/main_offline</item>
<item name="media_button_backward">@drawable/media_backward</item> <item name="media_button_backward">@drawable/media_backward</item>
<item name="media_button_forward">@drawable/media_forward</item> <item name="media_button_forward">@drawable/media_forward</item>
@ -19,29 +18,14 @@
<item name="media_button_repeat_all">@drawable/media_repeat_all</item> <item name="media_button_repeat_all">@drawable/media_repeat_all</item>
<item name="media_button_start">@drawable/media_start</item> <item name="media_button_start">@drawable/media_start</item>
<item name="media_button_stop">@drawable/media_stop</item> <item name="media_button_stop">@drawable/media_stop</item>
<item name="actionbar_backward">@drawable/media_backward</item>
<item name="actionbar_forward">@drawable/media_forward</item>
<item name="actionbar_pause">@drawable/media_pause</item>
<item name="actionbar_start">@drawable/media_start</item>
<item name="actionbar_stop">@drawable/media_stop</item>
<item name="actionbar_rewind">@drawable/media_rewind</item>
<item name="actionbar_fastforward">@drawable/media_fastforward</item>
<item name="add">@drawable/ic_action_add</item>
<item name="download_none">@drawable/download_none</item> <item name="download_none">@drawable/download_none</item>
<item name="shuffle">@drawable/ic_menu_shuffle</item>
<item name="shuffle_button">@drawable/ic_menu_shuffle</item> <item name="shuffle_button">@drawable/ic_menu_shuffle</item>
<item name="refresh">@drawable/actionbar_refresh</item>
<item name="search">@drawable/actionbar_search</item>
<item name="remove">@drawable/ic_menu_remove</item>
<item name="save">@drawable/actionbar_save</item>
<item name="volume">@drawable/ic_action_volume</item> <item name="volume">@drawable/ic_action_volume</item>
<item name="toggle_list">@drawable/action_toggle_list</item> <item name="toggle_list">@drawable/action_toggle_list</item>
<item name="select_server">@drawable/main_select_server</item> <item name="select_server">@drawable/main_select_server</item>
<item name="select_tabs">@drawable/main_select_tabs</item> <item name="select_tabs">@drawable/main_select_tabs</item>
<item name="playing">@drawable/playing</item> <item name="playing">@drawable/playing</item>
<item name="downloading">@drawable/downloading</item> <item name="downloading">@drawable/downloading</item>
<item name="add_person">@drawable/ic_menu_add_person</item>
<item name="download">@drawable/ic_menu_download</item>
<item name="drawerLibrary">@drawable/ic_menu_library</item> <item name="drawerLibrary">@drawable/ic_menu_library</item>
<item name="drawerPlaylists">@drawable/ic_menu_playlist</item> <item name="drawerPlaylists">@drawable/ic_menu_playlist</item>
<item name="drawerDownloading">@drawable/ic_menu_download</item> <item name="drawerDownloading">@drawable/ic_menu_download</item>
@ -51,27 +35,46 @@
<item name="colorPrimaryDark">@color/background_material_light</item> <item name="colorPrimaryDark">@color/background_material_light</item>
<item name="colorAccent">@color/lightAccent</item> <item name="colorAccent">@color/lightAccent</item>
<item name="actionbarBackgroundColor">@android:color/transparent</item> <item name="actionbarBackgroundColor">@android:color/transparent</item>
<item name="actionbarTitleStyle"> <item name="actionbarPopupStyle">@style/ThemeOverlay.AppCompat.Light</item>
@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse <item name="windowActionModeOverlay">true</item>
<item name="actionModeBackground">@color/background_material_light</item>
<item name="card_background">@android:color/white</item>
<item name="cardBackgroundDrawable">@drawable/card_rounded_corners</item>
<item name="drawerHeaderBackground">@color/lightPrimary</item>
<item name="android:windowLightStatusBar">true</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="actionbar_element_color">@color/lightElement</item>
<item name="actionbarThemeStyle">@style/ThemeOverlay.AppCompat.ActionBar</item>
<item name="actionbarTitleStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Title
</item> </item>
<item name="actionbarSubtitleStyle"> <item name="actionbarSubtitleStyle">
@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle.Inverse @style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle
</item> </item>
<item name="actionbarPopupStyle">@style/ThemeOverlay.AppCompat.Light</item> <item name="android:spinnerItemStyle">@style/LightSpinnerItem</item>
<item name="actionbarThemeStyle">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
<item name="android:spinnerItemStyle">@style/DarkSpinnerItem</item>
<item name="drawerTitleStyle"> <item name="drawerTitleStyle">
@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse @style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse
</item> </item>
<item name="drawerSubtitleStyle"> <item name="drawerSubtitleStyle">
@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle.Inverse @style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle.Inverse
</item> </item>
<item name="windowActionModeOverlay">true</item> <item name="actionbar_backward">@drawable/media_backward</item>
<item name="actionModeBackground">?attr/colorPrimary</item> <item name="actionbar_forward">@drawable/media_forward</item>
<item name="card_background">@android:color/white</item> <item name="actionbar_pause">@drawable/media_pause</item>
<item name="cardBackgroundDrawable">@drawable/card_rounded_corners</item> <item name="actionbar_start">@drawable/media_start</item>
<item name="drawerHeaderBackground">@color/lightPrimary</item> <item name="actionbar_stop">@drawable/media_stop</item>
<item name="android:windowLightStatusBar">true</item> <item name="actionbar_rewind">@drawable/media_rewind</item>
<item name="actionbar_fastforward">@drawable/media_fastforward</item>
<item name="add">@drawable/ic_action_add</item>
<item name="shuffle">@drawable/ic_menu_shuffle</item>
<item name="refresh">@drawable/actionbar_refresh</item>
<item name="search">@drawable/actionbar_search</item>
<item name="remove">@drawable/ic_menu_remove</item>
<item name="save">@drawable/actionbar_save</item>
<item name="add_person">@drawable/ic_menu_add_person</item>
<item name="download">@drawable/ic_menu_download</item>
<item name="actionModeStyle">@style/LightActionMode</item>
<item name="actionModeCloseButtonStyle">@style/DarkCloseButton</item>
</style> </style>
<style name="Theme.Audinaut.Dark" parent="@style/Theme.AppCompat"> <style name="Theme.Audinaut.Dark" parent="@style/Theme.AppCompat">
@ -131,65 +134,21 @@
<item name="drawerSubtitleStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle <item name="drawerSubtitleStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle
</item> </item>
<item name="windowActionModeOverlay">true</item> <item name="windowActionModeOverlay">true</item>
<item name="actionModeBackground">?attr/colorPrimary</item> <item name="actionModeBackground">@color/background_material_dark</item>
<item name="card_background">@android:color/black</item> <item name="card_background">@android:color/black</item>
<item name="cardBackgroundDrawable">@drawable/card_rounded_corners</item> <item name="cardBackgroundDrawable">@drawable/card_rounded_corners</item>
<item name="drawerHeaderBackground">@color/lightPrimaryDark</item> <item name="drawerHeaderBackground">@color/lightPrimaryDark</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style> </style>
<style name="Theme.Audinaut.Black" parent="Theme.Audinaut.Dark"> <style name="Theme.Audinaut.Black" parent="Theme.Audinaut.Dark">
<item name="android:windowBackground">@android:color/black</item> <item name="android:windowBackground">@android:color/black</item>
<item name="colorPrimaryDark">@android:color/black</item> <item name="colorPrimaryDark">@android:color/black</item>
</style>
<style name="Theme.Audinaut.Black.No_Color" parent="Theme.Audinaut.Black">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="actionModeBackground">@android:color/black</item> <item name="actionModeBackground">@android:color/black</item>
</style> </style>
<style name="Theme.Audinaut.Dark.No_Color" parent="Theme.Audinaut.Dark">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="actionModeBackground">@color/background_material_dark</item>
</style>
<style name="Theme.Audinaut.Light.No_Color" parent="Theme.Audinaut.Light"> <style name="Theme.Audinaut.Light.No_Color" parent="Theme.Audinaut.Light">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="actionbar_element_color">@color/lightElement</item>
<item name="actionbarThemeStyle">@style/ThemeOverlay.AppCompat.ActionBar</item>
<item name="actionbarBackgroundColor">@android:color/transparent</item>
<item name="actionbarTitleStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Title
</item>
<item name="actionbarSubtitleStyle">
@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle
</item>
<item name="android:spinnerItemStyle">@style/LightSpinnerItem</item>
<item name="drawerTitleStyle">
@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse
</item>
<item name="drawerSubtitleStyle">
@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle.Inverse
</item>
<item name="actionbar_backward">@drawable/media_backward</item>
<item name="actionbar_forward">@drawable/media_forward</item>
<item name="actionbar_pause">@drawable/media_pause</item>
<item name="actionbar_start">@drawable/media_start</item>
<item name="actionbar_stop">@drawable/media_stop</item>
<item name="actionbar_rewind">@drawable/media_rewind</item>
<item name="actionbar_fastforward">@drawable/media_fastforward</item>
<item name="add">@drawable/ic_action_add</item>
<item name="shuffle">@drawable/ic_menu_shuffle</item>
<item name="refresh">@drawable/actionbar_refresh</item>
<item name="search">@drawable/actionbar_search</item>
<item name="remove">@drawable/ic_menu_remove</item>
<item name="save">@drawable/actionbar_save</item>
<item name="add_person">@drawable/ic_menu_add_person</item>
<item name="download">@drawable/ic_menu_download</item>
<item name="actionModeBackground">@color/background_material_light</item>
<item name="actionModeStyle">@style/LightActionMode</item>
<item name="actionModeCloseButtonStyle">@style/DarkCloseButton</item>
</style> </style>
<style name="Audinaut.DrawerArrow" parent="Widget.AppCompat.DrawerArrowToggle"> <style name="Audinaut.DrawerArrow" parent="Widget.AppCompat.DrawerArrowToggle">