summaryrefslogtreecommitdiffstats
path: root/packages/DocumentsUI/src/com/android/documentsui/IconUtils.java
diff options
context:
space:
mode:
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);
+ }
}