[Android] Add a get color from attribute method
Alexandre Perraud
git at videolan.org
Fri Feb 27 14:24:38 CET 2015
vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Fri Feb 27 14:14:34 2015 +0100| [bb50c4dfb04bb4fafa8eee4251c32ca55d7701f2] | committer: Alexandre Perraud
Add a get color from attribute method
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=bb50c4dfb04bb4fafa8eee4251c32ca55d7701f2
---
vlc-android/src/org/videolan/vlc/util/Util.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/util/Util.java b/vlc-android/src/org/videolan/vlc/util/Util.java
index eaa433e..c311ec6 100644
--- a/vlc-android/src/org/videolan/vlc/util/Util.java
+++ b/vlc-android/src/org/videolan/vlc/util/Util.java
@@ -137,6 +137,15 @@ public class Util {
}
/**
+ * Get a color id from an attribute id.
+ * @param context
+ * @param attrId
+ * @return the color id
+ */
+ public static int getColorFromAttribute(Context context, int attrId) {
+ return VLCApplication.getAppResources().getColor(getResourceFromAttribute(context, attrId));
+ }
+ /**
* Set the alignment mode of the specified TextView with the desired align
* mode from preferences.
*
More information about the Android
mailing list