summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-10-29 22:20:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-29 22:20:18 +0000
commit4e7c562c43e9014c8fb3e75d02ba98fa4edadbde (patch)
tree2f4d307b5e38507b44f76995661ff62b183e15a1
parentd3786a5931cde3f76dc5cd702d3ba246246fdf47 (diff)
parentd5133792391443521dc15f7da7de5d280e6703dd (diff)
downloadframeworks_base-4e7c562c43e9014c8fb3e75d02ba98fa4edadbde.zip
frameworks_base-4e7c562c43e9014c8fb3e75d02ba98fa4edadbde.tar.gz
frameworks_base-4e7c562c43e9014c8fb3e75d02ba98fa4edadbde.tar.bz2
Merge "Update drawable state after updating tint list" into lmp-mr1-dev
-rw-r--r--core/java/android/view/View.java6
-rw-r--r--core/java/android/widget/AbsSeekBar.java6
-rw-r--r--core/java/android/widget/CheckedTextView.java6
-rw-r--r--core/java/android/widget/CompoundButton.java6
-rw-r--r--core/java/android/widget/FrameLayout.java6
-rw-r--r--core/java/android/widget/ImageView.java7
-rw-r--r--core/java/android/widget/ProgressBar.java24
7 files changed, 61 insertions, 0 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 06b1e60..102a6a4 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -16302,6 +16302,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (tintInfo.mHasTintMode) {
mBackground.setTintMode(tintInfo.mTintMode);
}
+
+ // The drawable (or one of its children) may not have been
+ // stateful before applying the tint, so let's try again.
+ if (mBackground.isStateful()) {
+ mBackground.setState(getDrawableState());
+ }
}
}
}
diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java
index b2cfdf7..d39960f 100644
--- a/core/java/android/widget/AbsSeekBar.java
+++ b/core/java/android/widget/AbsSeekBar.java
@@ -267,6 +267,12 @@ public abstract class AbsSeekBar extends ProgressBar {
if (mHasThumbTintMode) {
mThumb.setTintMode(mThumbTintMode);
}
+
+ // The drawable (or one of its children) may not have been
+ // stateful before applying the tint, so let's try again.
+ if (mThumb.isStateful()) {
+ mThumb.setState(getDrawableState());
+ }
}
}
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index eb8e8aa..69969a9 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -267,6 +267,12 @@ public class CheckedTextView extends TextView implements Checkable {
if (mHasCheckMarkTintMode) {
mCheckMarkDrawable.setTintMode(mCheckMarkTintMode);
}
+
+ // The drawable (or one of its children) may not have been
+ // stateful before applying the tint, so let's try again.
+ if (mCheckMarkDrawable.isStateful()) {
+ mCheckMarkDrawable.setState(getDrawableState());
+ }
}
}
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index 092e31c..447ccc2 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -315,6 +315,12 @@ public abstract class CompoundButton extends Button implements Checkable {
if (mHasButtonTintMode) {
mButtonDrawable.setTintMode(mButtonTintMode);
}
+
+ // The drawable (or one of its children) may not have been
+ // stateful before applying the tint, so let's try again.
+ if (mButtonDrawable.isStateful()) {
+ mButtonDrawable.setState(getDrawableState());
+ }
}
}
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java
index e317524..d974c29 100644
--- a/core/java/android/widget/FrameLayout.java
+++ b/core/java/android/widget/FrameLayout.java
@@ -384,6 +384,12 @@ public class FrameLayout extends ViewGroup {
if (mHasForegroundTintMode) {
mForeground.setTintMode(mForegroundTintMode);
}
+
+ // The drawable (or one of its children) may not have been
+ // stateful before applying the tint, so let's try again.
+ if (mForeground.isStateful()) {
+ mForeground.setState(getDrawableState());
+ }
}
}
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index 75dfcca..1ac4dd8 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -527,6 +527,12 @@ public class ImageView extends View {
if (mHasDrawableTintMode) {
mDrawable.setTintMode(mDrawableTintMode);
}
+
+ // The drawable (or one of its children) may not have been
+ // stateful before applying the tint, so let's try again.
+ if (mDrawable.isStateful()) {
+ mDrawable.setState(getDrawableState());
+ }
}
}
@@ -820,6 +826,7 @@ public class ImageView extends View {
mDrawableHeight = d.getIntrinsicHeight();
applyImageTint();
applyColorMod();
+
configureBounds();
} else {
mDrawableWidth = mDrawableHeight = -1;
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index 1c190c3..887a93b 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -673,6 +673,12 @@ public class ProgressBar extends View {
if (tintInfo.mHasIndeterminateTintMode) {
mIndeterminateDrawable.setTintMode(tintInfo.mIndeterminateTintMode);
}
+
+ // The drawable (or one of its children) may not have been
+ // stateful before applying the tint, so let's try again.
+ if (mIndeterminateDrawable.isStateful()) {
+ mIndeterminateDrawable.setState(getDrawableState());
+ }
}
}
}
@@ -781,6 +787,12 @@ public class ProgressBar extends View {
if (mProgressTintInfo.mHasProgressTintMode) {
target.setTintMode(mProgressTintInfo.mProgressTintMode);
}
+
+ // The drawable (or one of its children) may not have been
+ // stateful before applying the tint, so let's try again.
+ if (target.isStateful()) {
+ target.setState(getDrawableState());
+ }
}
}
}
@@ -800,6 +812,12 @@ public class ProgressBar extends View {
if (mProgressTintInfo.mHasProgressBackgroundTintMode) {
target.setTintMode(mProgressTintInfo.mProgressBackgroundTintMode);
}
+
+ // The drawable (or one of its children) may not have been
+ // stateful before applying the tint, so let's try again.
+ if (target.isStateful()) {
+ target.setState(getDrawableState());
+ }
}
}
}
@@ -819,6 +837,12 @@ public class ProgressBar extends View {
if (mProgressTintInfo.mHasSecondaryProgressTintMode) {
target.setTintMode(mProgressTintInfo.mSecondaryProgressTintMode);
}
+
+ // The drawable (or one of its children) may not have been
+ // stateful before applying the tint, so let's try again.
+ if (target.isStateful()) {
+ target.setState(getDrawableState());
+ }
}
}
}