summaryrefslogtreecommitdiff
path: root/core/java/android/widget/FrameLayout.java
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-07-21 17:49:13 -0700
committerAlan Viverette <alanv@google.com>2014-07-22 01:03:58 +0000
commit4f64c048505a432e549ccb756634ecebf28f9e80 (patch)
tree4ee51f737ee62e464f4b65e64608c9e9e5e0b42b /core/java/android/widget/FrameLayout.java
parent0d964e77b9a204417d0a24dcbacd354f9de589d9 (diff)
Clean up view tinting APIs, tileModeX/Y attribute docs
BUG: 16400590 BUG: 16403307 Change-Id: Ie924815a39eb0e683d1982b08ec478ed3edbfb7b
Diffstat (limited to 'core/java/android/widget/FrameLayout.java')
-rw-r--r--core/java/android/widget/FrameLayout.java29
1 files changed, 16 insertions, 13 deletions
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java
index 34f333ee3528..81dfcbb3766c 100644
--- a/core/java/android/widget/FrameLayout.java
+++ b/core/java/android/widget/FrameLayout.java
@@ -127,10 +127,11 @@ public class FrameLayout extends ViewGroup {
setMeasureAllChildren(true);
}
+ mForegroundTintMode = Drawable.parseTintMode(a.getInt(
+ R.styleable.FrameLayout_foregroundTintMode, -1), mForegroundTintMode);
+
if (a.hasValue(R.styleable.FrameLayout_foregroundTint)) {
mForegroundTint = a.getColorStateList(R.styleable.FrameLayout_foregroundTint);
- mForegroundTintMode = Drawable.parseTintMode(a.getInt(
- R.styleable.FrameLayout_foregroundTintMode, -1), mForegroundTintMode);
mHasForegroundTint = true;
applyForegroundTint();
@@ -316,11 +317,6 @@ public class FrameLayout extends ViewGroup {
*/
private void setForegroundTint(@Nullable ColorStateList tint,
@Nullable PorterDuff.Mode tintMode) {
- mForegroundTint = tint;
- mForegroundTintMode = tintMode;
- mHasForegroundTint = true;
-
- applyForegroundTint();
}
/**
@@ -334,16 +330,20 @@ public class FrameLayout extends ViewGroup {
* @param tint the tint to apply, may be {@code null} to clear tint
*
* @attr ref android.R.styleable#FrameLayout_foregroundTint
- * @see #setForegroundTint(ColorStateList, PorterDuff.Mode)
+ * @see #getForegroundTint()
+ * @see Drawable#setTint(ColorStateList, PorterDuff.Mode)
*/
public void setForegroundTint(@Nullable ColorStateList tint) {
- setForegroundTint(tint, mForegroundTintMode);
+ mForegroundTint = tint;
+ mHasForegroundTint = true;
+
+ applyForegroundTint();
}
/**
* @return the tint applied to the foreground drawable
* @attr ref android.R.styleable#FrameLayout_foregroundTint
- * @see #setForegroundTint(ColorStateList, PorterDuff.Mode)
+ * @see #setForegroundTint(ColorStateList)
*/
@Nullable
public ColorStateList getForegroundTint() {
@@ -358,17 +358,20 @@ public class FrameLayout extends ViewGroup {
* @param tintMode the blending mode used to apply the tint, may be
* {@code null} to clear tint
* @attr ref android.R.styleable#FrameLayout_foregroundTintMode
- * @see #setForegroundTint(ColorStateList)
+ * @see #getForegroundTintMode()
+ * @see Drawable#setTint(ColorStateList, PorterDuff.Mode)
*/
public void setForegroundTintMode(@Nullable PorterDuff.Mode tintMode) {
- setForegroundTint(mForegroundTint, tintMode);
+ mForegroundTintMode = tintMode;
+
+ applyForegroundTint();
}
/**
* @return the blending mode used to apply the tint to the foreground
* drawable
* @attr ref android.R.styleable#FrameLayout_foregroundTintMode
- * @see #setForegroundTint(ColorStateList, PorterDuff.Mode)
+ * @see #setForegroundTintMode(PorterDuff.Mode)
*/
@Nullable
public PorterDuff.Mode getForegroundTintMode() {