63 lines
2.1 KiB
Java
63 lines
2.1 KiB
Java
package c.i.a.g.j;
|
|
|
|
import android.graphics.Canvas;
|
|
import android.graphics.Paint;
|
|
import android.graphics.PorterDuff;
|
|
import android.graphics.PorterDuffXfermode;
|
|
import android.graphics.RectF;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.view.View;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import com.google.android.material.shape.MaterialShapeDrawable;
|
|
import com.google.android.material.shape.ShapeAppearanceModel;
|
|
/* compiled from: CutoutDrawable */
|
|
public class g extends MaterialShapeDrawable {
|
|
@NonNull
|
|
public final Paint i;
|
|
@NonNull
|
|
public final RectF j;
|
|
public int k;
|
|
|
|
public g() {
|
|
this(null);
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public g(@Nullable ShapeAppearanceModel shapeAppearanceModel) {
|
|
super(shapeAppearanceModel == null ? new ShapeAppearanceModel() : shapeAppearanceModel);
|
|
Paint paint = new Paint(1);
|
|
this.i = paint;
|
|
paint.setStyle(Paint.Style.FILL_AND_STROKE);
|
|
paint.setColor(-1);
|
|
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
|
|
this.j = new RectF();
|
|
}
|
|
|
|
public void a(float f, float f2, float f3, float f4) {
|
|
RectF rectF = this.j;
|
|
if (f != rectF.left || f2 != rectF.top || f3 != rectF.right || f4 != rectF.bottom) {
|
|
rectF.set(f, f2, f3, f4);
|
|
invalidateSelf();
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.material.shape.MaterialShapeDrawable, android.graphics.drawable.Drawable
|
|
public void draw(@NonNull Canvas canvas) {
|
|
Drawable.Callback callback = getCallback();
|
|
if (callback instanceof View) {
|
|
View view = (View) callback;
|
|
if (view.getLayerType() != 2) {
|
|
view.setLayerType(2, null);
|
|
}
|
|
} else {
|
|
this.k = canvas.saveLayer(0.0f, 0.0f, (float) canvas.getWidth(), (float) canvas.getHeight(), null);
|
|
}
|
|
super.draw(canvas);
|
|
canvas.drawRect(this.j, this.i);
|
|
if (!(getCallback() instanceof View)) {
|
|
canvas.restoreToCount(this.k);
|
|
}
|
|
}
|
|
}
|