diff options
| author | 2018-03-05 19:34:48 +0000 | |
|---|---|---|
| committer | 2018-03-05 19:34:48 +0000 | |
| commit | 94e5d34d4e2143e15b21f6612d97748ef63e6b36 (patch) | |
| tree | ddf1e426763dc2db846cdbded6c8f8bd52994628 | |
| parent | 0bd7631cea650927efc9b703dc8cc9ef24c2447f (diff) | |
| parent | acb0eeda9dded095facd0d8695c028a13bc9709f (diff) | |
Merge "Tint keyguard icons" into pi-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java index 2adb2869e0f6..7572512eac31 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java @@ -179,7 +179,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe / (float) iconDrawable.getIntrinsicHeight() * mIconSize); iconDrawable.setBounds(0, 0, Math.max(width, 1), mIconSize); } - button.setCompoundDrawablesRelative(iconDrawable, null, null, null); + button.setCompoundDrawables(iconDrawable, null, null, null); button.setOnClickListener(this); } @@ -338,5 +338,27 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe setMaxLines(1); setEllipsize(TruncateAt.END); } + + @Override + public void setTextColor(int color) { + super.setTextColor(color); + updateDrawableColors(); + } + + @Override + public void setCompoundDrawables(Drawable left, Drawable top, Drawable right, + Drawable bottom) { + super.setCompoundDrawables(left, top, right, bottom); + updateDrawableColors(); + } + + private void updateDrawableColors() { + final int color = getCurrentTextColor(); + for (Drawable drawable : getCompoundDrawables()) { + if (drawable != null) { + drawable.setTint(color); + } + } + } } } |