summaryrefslogtreecommitdiffstats
path: root/packages/DocumentsUI/src/com/android/documentsui/IconUtils.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2014-08-29 15:38:27 -0700
committerJeff Sharkey <jsharkey@android.com>2014-08-29 15:40:19 -0700
commitcbce47001e15be85b084c36a64c20039a0c4a667 (patch)
treeafc55b02a68a909194bc3dda03b785dc9f3160ec /packages/DocumentsUI/src/com/android/documentsui/IconUtils.java
parent73a821780334bc7972bca28d848cbce70cc3f825 (diff)
downloadframeworks_base-cbce47001e15be85b084c36a64c20039a0c4a667.zip
frameworks_base-cbce47001e15be85b084c36a64c20039a0c4a667.tar.gz
frameworks_base-cbce47001e15be85b084c36a64c20039a0c4a667.tar.bz2
Final pass at Material DocumentsUI.
Now with treatment for disabled and selected grid items. Inverts text and icons in selected drawer items. Follows upstream color changes to accent color. Disables some verbose logging. Bug: 15836082, 17281688 Change-Id: I97a1c055a2f1a537388a8f5669147618e9698870
Diffstat (limited to 'packages/DocumentsUI/src/com/android/documentsui/IconUtils.java')
-rw-r--r--packages/DocumentsUI/src/com/android/documentsui/IconUtils.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/DocumentsUI/src/com/android/documentsui/IconUtils.java b/packages/DocumentsUI/src/com/android/documentsui/IconUtils.java
index b2e38fc..416aeb0 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/IconUtils.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/IconUtils.java
@@ -266,15 +266,16 @@ public class IconUtils {
}
}
- public static Drawable applyTint(Context context, int drawableId, int tintAttrId) {
- final Resources res = context.getResources();
-
- final TypedValue outValue = new TypedValue();
- context.getTheme().resolveAttribute(tintAttrId, outValue, true);
-
+ public static Drawable applyTintColor(Context context, int drawableId, int tintColorId) {
final Drawable icon = context.getDrawable(drawableId);
icon.mutate();
- icon.setTintList(res.getColorStateList(outValue.resourceId));
+ icon.setTintList(context.getResources().getColorStateList(tintColorId));
return icon;
}
+
+ public static Drawable applyTintAttr(Context context, int drawableId, int tintAttrId) {
+ final TypedValue outValue = new TypedValue();
+ context.getTheme().resolveAttribute(tintAttrId, outValue, true);
+ return applyTintColor(context, drawableId, outValue.resourceId);
+ }
}