diff options
author | Jason Monk <jmonk@google.com> | 2015-05-19 12:54:53 -0400 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2015-05-19 13:02:41 -0400 |
commit | 7c719ca27ff887903f8890e8181ed8e28bb6e886 (patch) | |
tree | 76cdf3bcc6b958d67d21241e685555845e7c025f /src/com/android/packageinstaller/permission/utils | |
parent | fed504a8ca875d7bba8fd9f4876b7d34fdc1f319 (diff) | |
download | android_packages_apps_PackageInstaller-7c719ca27ff887903f8890e8181ed8e28bb6e886.tar.gz android_packages_apps_PackageInstaller-7c719ca27ff887903f8890e8181ed8e28bb6e886.tar.bz2 android_packages_apps_PackageInstaller-7c719ca27ff887903f8890e8181ed8e28bb6e886.zip |
Handle dark themes in permissions UI
- Settings > Apps > Advanced > Permissions
- Permission icon needed tinting
- Settings > Apps > [App] > Permissions
- Permission icon also needed tinting
- Grant permission dialog
- Needed new base theme
- App name color span needed dark color
- Progress text needed dark color
Bug: 21154903
Change-Id: I34045ac71ca87abbb4ce828435f583f53ab0d3da
Diffstat (limited to 'src/com/android/packageinstaller/permission/utils')
-rw-r--r-- | src/com/android/packageinstaller/permission/utils/Utils.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/packageinstaller/permission/utils/Utils.java b/src/com/android/packageinstaller/permission/utils/Utils.java index 7abb2627..7bbe5982 100644 --- a/src/com/android/packageinstaller/permission/utils/Utils.java +++ b/src/com/android/packageinstaller/permission/utils/Utils.java @@ -17,10 +17,13 @@ package com.android.packageinstaller.permission.utils; import android.Manifest; +import android.content.Context; import android.content.pm.PackageManager; import android.content.res.Resources; +import android.content.res.Resources.Theme; import android.graphics.drawable.Drawable; import android.util.Log; +import android.util.TypedValue; public class Utils { private static final String LOG_TAG = "Utils"; @@ -56,4 +59,12 @@ public class Utils { } } } + + public static Drawable applyTint(Context context, Drawable icon, int attr) { + Theme theme = context.getTheme(); + TypedValue typedValue = new TypedValue(); + theme.resolveAttribute(attr, typedValue, true); + icon.setTint(context.getColor(typedValue.resourceId)); + return icon; + } } |