Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 498a44f3 authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Add transfer mode support to ShapeDrawable" into oc-dev

parents 3d6225b4 98bf27bf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -14359,6 +14359,7 @@ package android.graphics.drawable {
    method public void setPadding(android.graphics.Rect);
    method public void setShaderFactory(android.graphics.drawable.ShapeDrawable.ShaderFactory);
    method public void setShape(android.graphics.drawable.shapes.Shape);
    method public void setXfermode(android.graphics.Xfermode);
  }
  public static abstract class ShapeDrawable.ShaderFactory {
+13 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package android.graphics.drawable;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.TestApi;
import android.content.pm.ActivityInfo.Config;
import android.content.res.ColorStateList;
import android.content.res.Resources;
@@ -32,6 +34,7 @@ import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.Shader;
import android.graphics.Xfermode;
import android.graphics.drawable.shapes.Shape;
import android.util.AttributeSet;

@@ -306,6 +309,16 @@ public class ShapeDrawable extends Drawable {
        invalidateSelf();
    }

    /**
     * @hide
     */
    @Override
    @TestApi
    public void setXfermode(@Nullable Xfermode mode) {
        mShapeState.mPaint.setXfermode(mode);
        invalidateSelf();
    }

    @Override
    public int getOpacity() {
        if (mShapeState.mShape == null) {