Merge "Add transfer mode support to ColorDrawable" into oc-dev
am: eedceb5721
Change-Id: If27a7e4154dabbeffd2b11ee2b788c9e30b3d9a7
This commit is contained in:
@@ -13997,6 +13997,7 @@ package android.graphics.drawable {
|
||||
method public void draw(android.graphics.Canvas);
|
||||
method public int getColor();
|
||||
method public int getOpacity();
|
||||
method public android.graphics.Xfermode getXfermode();
|
||||
method public void setAlpha(int);
|
||||
method public void setColor(int);
|
||||
method public void setColorFilter(android.graphics.ColorFilter);
|
||||
|
||||
@@ -18,6 +18,8 @@ package android.graphics.drawable;
|
||||
|
||||
import android.annotation.ColorInt;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.TestApi;
|
||||
import android.content.pm.ActivityInfo.Config;
|
||||
import android.graphics.*;
|
||||
import android.graphics.PorterDuff.Mode;
|
||||
@@ -213,6 +215,25 @@ public class ColorDrawable extends Drawable {
|
||||
return mColorState.mTint != null && mColorState.mTint.hasFocusStateSpecified();
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* @param mode new transfer mode
|
||||
*/
|
||||
@Override
|
||||
public void setXfermode(@Nullable Xfermode mode) {
|
||||
mPaint.setXfermode(mode);
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* @return current transfer mode
|
||||
*/
|
||||
@TestApi
|
||||
public Xfermode getXfermode() {
|
||||
return mPaint.getXfermode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOpacity() {
|
||||
if (mTintFilter != null || mPaint.getColorFilter() != null) {
|
||||
|
||||
Reference in New Issue
Block a user