diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-03-31 15:25:57 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-03-31 15:25:57 +0200 |
commit | ea7aa63bb951ce8680d28a131f4f7230076708ef (patch) | |
tree | aab6e1b04a55fc7b3a6fee4a8ee5ae28418ba136 /src/main/java/de/pixart/messenger/ui/util | |
parent | dbe8ee40eced09e4721b9e0d9b27d49fe668a12e (diff) |
updated manage account activity to new colors
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/util')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/util/Color.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/util/Color.java b/src/main/java/de/pixart/messenger/ui/util/Color.java index 4a4ec45df..58ce6a465 100644 --- a/src/main/java/de/pixart/messenger/ui/util/Color.java +++ b/src/main/java/de/pixart/messenger/ui/util/Color.java @@ -31,19 +31,18 @@ package de.pixart.messenger.ui.util; import android.content.Context; -import android.content.res.Resources; +import android.content.res.TypedArray; import android.support.annotation.AttrRes; import android.support.annotation.ColorInt; -import android.util.TypedValue; public class Color { public static @ColorInt int get(Context context, @AttrRes int attr) { - TypedValue typedValue = new TypedValue(); - Resources.Theme theme = context.getTheme(); - theme.resolveAttribute(attr, typedValue, true); - return typedValue.data; + TypedArray typedArray = context.obtainStyledAttributes(new int[]{attr}); + int color = typedArray.getColor(0, 0); + typedArray.recycle(); + return color; } }
\ No newline at end of file |