diff options
author | pachecosf <austinwim@gmail.com> | 2019-01-18 12:09:24 -0800 |
---|---|---|
committer | pachecosf <austinwim@gmail.com> | 2019-01-18 12:09:24 -0800 |
commit | a80435a03becc7ae874541dec77594caca4e11d0 (patch) | |
tree | ed98afd64e214301f89932732659cf1b5582c40f /core/src/main | |
parent | fd83665970569d44e25a6ac3d199300e75ec6e46 (diff) | |
download | AntennaPod-a80435a03becc7ae874541dec77594caca4e11d0.zip |
switched implementation to ussing attr
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java | 32 | ||||
-rw-r--r-- | core/src/main/res/values/attrs.xml | 1 | ||||
-rw-r--r-- | core/src/main/res/values/colors.xml | 4 | ||||
-rw-r--r-- | core/src/main/res/values/styles.xml | 10 |
4 files changed, 11 insertions, 36 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java index dd03f0176..14f091249 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java @@ -29,38 +29,6 @@ public class ThemeUtils { } } - public static int getSelectionDrawerActivatedColor() { - int theme = UserPreferences.getTheme(); - if (theme == R.style.Theme_AntennaPod_Dark) { - return R.color.overlay_dark; - } else if (theme == R.style.Theme_AntennaPod_TrueBlack){ - return R.color.highlight_trueblack; - } else if (theme == R.style.Theme_AntennaPod_Light) { - return R.color.highlight_light; - } else { - Log.e(TAG, - "getSelectionDrawerActivatedColor could not match the current theme to any color!"); - return R.color.highlight_light; - } - - } - - public static int getSelectionDrawerNotActivatedColor() { - int theme = UserPreferences.getTheme(); - if (theme == R.style.Theme_AntennaPod_Dark) { - return R.color.darktheme_drawer; - } else if (theme == R.style.Theme_AntennaPod_TrueBlack){ - return R.color.black; - } else if (theme == R.style.Theme_AntennaPod_Light) { - return R.color.primary_light; - } else { - Log.e(TAG, - "getSelectionDrawerNotActivatedColor could not match the current theme to any color!"); - return R.color.highlight_light; - } - } - - public static @ColorInt int getColorFromAttr(Context context, @AttrRes int attr) { TypedValue typedValue = new TypedValue(); context.getTheme().resolveAttribute(attr, typedValue, true); diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index 16a6d9185..48e55768e 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -67,6 +67,7 @@ <attr name="overlay_background" format="color"/> <attr name="nav_drawer_background" format="color"/> + <attr name="drawer_activated_color" format="color"/> <attr name="about_screen_background" format="color"/> <attr name="about_screen_card_background" format="color"/> diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 75c3169fb..5d820f3cf 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -29,8 +29,8 @@ <!-- Theme colors --> <color name="primary_light">#FFFFFF</color> <color name="primary_darktheme">#212121</color> - <color name="darktheme_drawer">#3B3B3B</color> - + <color name="nav_drawer_background_dark">#3B3B3B</color> + <color name="nav_drawer_highlighted_dark">#212121</color> <color name="highlight_light">#DDDDDD</color> <color name="highlight_dark">#414141</color> <color name="highlight_trueblack">#414141</color> diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 79773619f..363a69a63 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -43,6 +43,7 @@ <item type="attr" name="dragview_background">@drawable/ic_drag_vertical_grey600_48dp</item> <item type="attr" name="dragview_float_background">@color/white</item> <item type="attr" name="nav_drawer_background">@color/white</item> + <item type="attr" name="drawer_activated_color">@color/highlight_light</item> <item type="attr" name="ic_new">@drawable/ic_new_releases_grey600_24dp</item> <item type="attr" name="ic_history">@drawable/ic_history_grey600_24dp</item> <item type="attr" name="ic_folder">@drawable/ic_folder_grey600_24dp</item> @@ -125,7 +126,8 @@ <item type="attr" name="overlay_drawable">@drawable/overlay_drawable_dark</item> <item type="attr" name="dragview_background">@drawable/ic_drag_vertical_white_48dp</item> <item type="attr" name="dragview_float_background">@color/black</item> - <item type="attr" name="nav_drawer_background">#3B3B3B</item> + <item type="attr" name="nav_drawer_background">@color/nav_drawer_background_dark</item> + <item type="attr" name="drawer_activated_color">@color/nav_drawer_highlighted_dark</item> <item type="attr" name="ic_new">@drawable/ic_new_releases_white_24dp</item> <item type="attr" name="ic_history">@drawable/ic_history_white_24dp</item> <item type="attr" name="ic_folder">@drawable/ic_folder_white_24dp</item> @@ -175,6 +177,7 @@ <item type="attr" name="dragview_background">@drawable/ic_drag_vertical_white_48dp</item> <item type="attr" name="dragview_float_background">@color/black</item> <item type="attr" name="nav_drawer_background">@color/black</item> + <item type="attr" name="drawer_activated_color">@color/highlight_trueblack</item> <item name="android:textColorPrimary">@color/white</item> <item name="android:color">@color/white</item> <item name="android:colorBackground">@color/black</item> @@ -228,6 +231,7 @@ <item type="attr" name="dragview_background">@drawable/ic_drag_vertical_grey600_48dp</item> <item type="attr" name="dragview_float_background">@color/white</item> <item type="attr" name="nav_drawer_background">@color/white</item> + <item type="attr" name="drawer_activated_color">@color/highlight_light</item> <item type="attr" name="ic_new">@drawable/ic_new_releases_grey600_24dp</item> <item type="attr" name="ic_history">@drawable/ic_history_grey600_24dp</item> <item type="attr" name="ic_folder">@drawable/ic_folder_grey600_24dp</item> @@ -309,7 +313,8 @@ <item type="attr" name="overlay_drawable">@drawable/overlay_drawable_dark</item> <item type="attr" name="dragview_background">@drawable/ic_drag_vertical_white_48dp</item> <item type="attr" name="dragview_float_background">@color/black</item> - <item type="attr" name="nav_drawer_background">#3B3B3B</item> + <item type="attr" name="nav_drawer_background">@color/nav_drawer_background_dark</item> + <item type="attr" name="drawer_activated_color">@color/nav_drawer_highlighted_dark</item> <item type="attr" name="ic_new">@drawable/ic_new_releases_white_24dp</item> <item type="attr" name="ic_history">@drawable/ic_history_white_24dp</item> <item type="attr" name="ic_folder">@drawable/ic_folder_white_24dp</item> @@ -359,6 +364,7 @@ <item type="attr" name="dragview_background">@drawable/ic_drag_vertical_white_48dp</item> <item type="attr" name="dragview_float_background">@color/black</item> <item type="attr" name="nav_drawer_background">@color/black</item> + <item type="attr" name="drawer_activated_color">@color/highlight_trueblack</item> <item type="attr" name="currently_playing_background">@color/highlight_trueblack</item> <item name="android:textColorPrimary">@color/white</item> <item name="android:color">@color/white</item> |