summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2016-04-27 18:24:03 -0700
committerMaurice Lam <yukl@google.com>2016-04-30 02:31:21 +0000
commit9a9b0713395fd4b6bbe6d9959f6ddbed8e086eed (patch)
tree4dd115d0bafbf92515d8672fe41f1e59469e755c
parent7f2a6e95f20408e055bb8b965b9e2bc664eec86b (diff)
downloadsetupwizard-9a9b0713395fd4b6bbe6d9959f6ddbed8e086eed.tar.gz
[SuwLib] Move mutate into TintedDrawable
Move mutate() into TintedDrawable to prevent it from being called multiple times, which causes the drawable to disappear on KitKat. Bug: 28391968 Change-Id: Ib1a839344c7cb20f7bde3f21b877a0296391bc52
-rw-r--r--library/eclair-mr1/src/com/android/setupwizardlib/view/NavigationBarButton.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/library/eclair-mr1/src/com/android/setupwizardlib/view/NavigationBarButton.java b/library/eclair-mr1/src/com/android/setupwizardlib/view/NavigationBarButton.java
index 1ffc034..6e555a1 100644
--- a/library/eclair-mr1/src/com/android/setupwizardlib/view/NavigationBarButton.java
+++ b/library/eclair-mr1/src/com/android/setupwizardlib/view/NavigationBarButton.java
@@ -44,7 +44,7 @@ public class NavigationBarButton extends Button {
Drawable[] drawables = getCompoundDrawablesRelative();
for (int i = 0; i < drawables.length; i++) {
if (drawables[i] != null) {
- drawables[i] = TintedDrawable.wrap(drawables[i].mutate());
+ drawables[i] = TintedDrawable.wrap(drawables[i]);
}
}
setCompoundDrawablesRelativeWithIntrinsicBounds(drawables[0], drawables[1],
@@ -54,10 +54,10 @@ public class NavigationBarButton extends Button {
@Override
public void setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom) {
- if (left != null) left = TintedDrawable.wrap(left.mutate());
- if (top != null) top = TintedDrawable.wrap(top.mutate());
- if (right != null) right = TintedDrawable.wrap(right.mutate());
- if (bottom != null) bottom = TintedDrawable.wrap(bottom.mutate());
+ if (left != null) left = TintedDrawable.wrap(left);
+ if (top != null) top = TintedDrawable.wrap(top);
+ if (right != null) right = TintedDrawable.wrap(right);
+ if (bottom != null) bottom = TintedDrawable.wrap(bottom);
super.setCompoundDrawables(left, top, right, bottom);
tintDrawables();
}
@@ -65,10 +65,10 @@ public class NavigationBarButton extends Button {
@Override
public void setCompoundDrawablesRelative(Drawable start, Drawable top, Drawable end,
Drawable bottom) {
- if (start != null) start = TintedDrawable.wrap(start.mutate());
- if (top != null) top = TintedDrawable.wrap(top.mutate());
- if (end != null) end = TintedDrawable.wrap(end.mutate());
- if (bottom != null) bottom = TintedDrawable.wrap(bottom.mutate());
+ if (start != null) start = TintedDrawable.wrap(start);
+ if (top != null) top = TintedDrawable.wrap(top);
+ if (end != null) end = TintedDrawable.wrap(end);
+ if (bottom != null) bottom = TintedDrawable.wrap(bottom);
super.setCompoundDrawablesRelative(start, top, end, bottom);
tintDrawables();
}
@@ -114,7 +114,7 @@ public class NavigationBarButton extends Button {
if (drawable instanceof TintedDrawable) {
return (TintedDrawable) drawable;
}
- return new TintedDrawable(drawable);
+ return new TintedDrawable(drawable.mutate());
}
private ColorStateList mTintList = null;