diff options
author | ByteHamster <info@bytehamster.com> | 2018-06-06 16:32:41 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2018-06-06 16:32:41 +0200 |
commit | bb716ce9eadb0b63b0b3dfea269898ef928a6ff0 (patch) | |
tree | b6cf1651aeb87fc3de7296cb3f5d385b5e5748ff /core | |
parent | ca6639892d1c0015390c09971b795ce5b755e690 (diff) | |
download | AntennaPod-bb716ce9eadb0b63b0b3dfea269898ef928a6ff0.zip |
Moved playing background into attr
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java | 13 | ||||
-rw-r--r-- | core/src/main/res/values/attrs.xml | 1 | ||||
-rw-r--r-- | core/src/main/res/values/styles.xml | 5 |
3 files changed, 18 insertions, 1 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 184c3ee54..03d0f10ff 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 @@ -1,7 +1,12 @@ package de.danoeh.antennapod.core.util; +import android.content.Context; +import android.support.annotation.AttrRes; +import android.support.annotation.ColorInt; +import android.support.annotation.ColorRes; import android.util.Log; +import android.util.TypedValue; import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.preferences.UserPreferences; @@ -12,7 +17,7 @@ public class ThemeUtils { int theme = UserPreferences.getTheme(); if (theme == R.style.Theme_AntennaPod_Dark) { return R.color.selection_background_color_dark; - }else if (theme == R.style.Theme_AntennaPod_TrueBlack){ + } else if (theme == R.style.Theme_AntennaPod_TrueBlack){ return R.color.selection_background_color_trueblack; } else if (theme == R.style.Theme_AntennaPod_Light) { return R.color.selection_background_color_light; @@ -22,4 +27,10 @@ public class ThemeUtils { return R.color.selection_background_color_light; } } + + public static @ColorInt int getColorFromAttr(Context context, @AttrRes int attr) { + TypedValue typedValue = new TypedValue(); + context.getTheme().resolveAttribute(attr, typedValue, true); + return typedValue.data; + } } diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index b005d4dc3..f3c2b9b7e 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -56,6 +56,7 @@ <attr name="ic_cast_disconnect" format="reference"/> <attr name="ic_swap" format="reference"/> <attr name="master_switch_background" format="color"/> + <attr name="currently_playing_background" format="color"/> <!-- Used in itemdescription --> <attr name="non_transparent_background" format="reference"/> diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 908f411ee..0314ca431 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -67,6 +67,7 @@ <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_grey600_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_grey600_36dp</item> <item type="attr" name="master_switch_background">@color/master_switch_background_light</item> + <item type="attr" name="currently_playing_background">@color/highlight_light</item> <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> </style> @@ -136,6 +137,7 @@ <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_white_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_white_36dp</item> <item type="attr" name="master_switch_background">@color/master_switch_background_dark</item> + <item type="attr" name="currently_playing_background">@color/highlight_dark</item> <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> </style> @@ -227,6 +229,7 @@ <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_grey600_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_grey600_36dp</item> <item type="attr" name="master_switch_background">@color/master_switch_background_light</item> + <item type="attr" name="currently_playing_background">@color/highlight_light</item> <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> </style> @@ -297,6 +300,7 @@ <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_white_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_white_36dp</item> <item type="attr" name="master_switch_background">@color/master_switch_background_dark</item> + <item type="attr" name="currently_playing_background">@color/highlight_dark</item> <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> </style> @@ -312,6 +316,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="currently_playing_background">@color/highlight_trueblack</item> <item name="android:textColorPrimary">@color/white</item> <item name="android:color">@color/white</item> <item name="android:windowBackground">@color/black</item> |