summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2015-04-01 16:48:56 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-01 16:48:56 +0000
commit49c72c5f917df6ba5592e3b9e5ae116786baaee1 (patch)
tree3e870737f1cd036623fc8caca63a2488379f3222
parent0d73002b7aceed5d7c0338ca74ff25250787ecfa (diff)
parente7b519c1769be4e43fff8c9a909cb1ba15f25ebb (diff)
downloadandroid_frameworks_opt_setupwizard-49c72c5f917df6ba5592e3b9e5ae116786baaee1.tar.gz
android_frameworks_opt_setupwizard-49c72c5f917df6ba5592e3b9e5ae116786baaee1.tar.bz2
android_frameworks_opt_setupwizard-49c72c5f917df6ba5592e3b9e5ae116786baaee1.zip
am e7b519c1: [SetupWizardLib] Fix nav bar button alpha
* commit 'e7b519c1769be4e43fff8c9a909cb1ba15f25ebb': [SetupWizardLib] Fix nav bar button alpha
-rw-r--r--library/main/src/com/android/setupwizardlib/view/NavigationBar.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/library/main/src/com/android/setupwizardlib/view/NavigationBar.java b/library/main/src/com/android/setupwizardlib/view/NavigationBar.java
index 3d88593..bc06976 100644
--- a/library/main/src/com/android/setupwizardlib/view/NavigationBar.java
+++ b/library/main/src/com/android/setupwizardlib/view/NavigationBar.java
@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
+import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.util.AttributeSet;
import android.view.ContextThemeWrapper;
@@ -137,10 +138,18 @@ public class NavigationBar extends LinearLayout implements View.OnClickListener
// alpha value = 0x3b/0xff * 0xde/0xff = 20%.
final int alpha = enabled ? 0xff : 0x3b;
setTextColor(getTextColors().withAlpha(alpha));
+ if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) {
+ final Drawable[] relativeDrawables = getCompoundDrawablesRelative();
+ for (Drawable d : relativeDrawables) {
+ if (d != null) {
+ d.mutate().setAlpha(alpha);
+ }
+ }
+ }
final Drawable[] compoundDrawables = getCompoundDrawables();
for (Drawable d : compoundDrawables) {
if (d != null) {
- d.setAlpha(alpha);
+ d.mutate().setAlpha(alpha);
}
}
}