diff options
author | vbh <code@bindu.io> | 2021-12-01 21:17:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-01 22:17:37 +0100 |
commit | d4769620b74458ba355b2ae72717dca7caa0f132 (patch) | |
tree | b3818ae899d8eb3291185a3be17a0d6ab681e77f /ui/common | |
parent | 561141cfffaacc159660578a46cb393d7be5bc68 (diff) | |
download | AntennaPod-d4769620b74458ba355b2ae72717dca7caa0f132.zip |
Add preference to show subscription title (#5538)
Diffstat (limited to 'ui/common')
-rw-r--r-- | ui/common/src/main/java/de/danoeh/antennapod/ui/common/ThemeUtils.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/common/src/main/java/de/danoeh/antennapod/ui/common/ThemeUtils.java b/ui/common/src/main/java/de/danoeh/antennapod/ui/common/ThemeUtils.java index 392d09e07..12a2f6323 100644 --- a/ui/common/src/main/java/de/danoeh/antennapod/ui/common/ThemeUtils.java +++ b/ui/common/src/main/java/de/danoeh/antennapod/ui/common/ThemeUtils.java @@ -5,6 +5,7 @@ import androidx.annotation.AttrRes; import androidx.annotation.ColorInt; import android.util.TypedValue; import androidx.annotation.DrawableRes; +import androidx.core.content.ContextCompat; public class ThemeUtils { private ThemeUtils() { @@ -14,6 +15,9 @@ public class ThemeUtils { public static @ColorInt int getColorFromAttr(Context context, @AttrRes int attr) { TypedValue typedValue = new TypedValue(); context.getTheme().resolveAttribute(attr, typedValue, true); + if (typedValue.resourceId != 0) { + return ContextCompat.getColor(context, typedValue.resourceId); + } return typedValue.data; } |