Merge "Fix view foreground tinting" into mnc-dev

This commit is contained in:
Adam Powell
2015-06-03 22:52:40 +00:00
committed by Android (Google) Code Review

View File

@@ -17564,13 +17564,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @see Drawable#setTintMode(PorterDuff.Mode) * @see Drawable#setTintMode(PorterDuff.Mode)
*/ */
public void setForegroundTintMode(@Nullable PorterDuff.Mode tintMode) { public void setForegroundTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mBackgroundTint == null) { if (mForegroundInfo == null) {
mBackgroundTint = new TintInfo(); mForegroundInfo = new ForegroundInfo();
} }
mBackgroundTint.mTintMode = tintMode; if (mForegroundInfo.mTintInfo == null) {
mBackgroundTint.mHasTintMode = true; mForegroundInfo.mTintInfo = new TintInfo();
}
mForegroundInfo.mTintInfo.mTintMode = tintMode;
mForegroundInfo.mTintInfo.mHasTintMode = true;
applyBackgroundTint(); applyForegroundTint();
} }
/** /**
@@ -17580,7 +17583,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return the blending mode used to apply the tint to the foreground * @return the blending mode used to apply the tint to the foreground
* drawable * drawable
* @attr ref android.R.styleable#View_foregroundTintMode * @attr ref android.R.styleable#View_foregroundTintMode
* @see #setBackgroundTintMode(PorterDuff.Mode) * @see #setForegroundTintMode(PorterDuff.Mode)
*/ */
@Nullable @Nullable
public PorterDuff.Mode getForegroundTintMode() { public PorterDuff.Mode getForegroundTintMode() {