Rabbit-R1/android (non root)/java/sources/com/google/android/material/circularreveal/CircularRevealWidget.java
2024-05-21 17:08:36 -04:00

116 lines
4.1 KiB
Java

package com.google.android.material.circularreveal;
import android.animation.TypeEvaluator;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.Property;
import com.google.android.material.circularreveal.CircularRevealHelper;
import com.google.android.material.math.MathUtils;
/* loaded from: classes2.dex */
public interface CircularRevealWidget extends CircularRevealHelper.Delegate {
void buildCircularRevealCache();
void destroyCircularRevealCache();
void draw(Canvas canvas);
Drawable getCircularRevealOverlayDrawable();
int getCircularRevealScrimColor();
RevealInfo getRevealInfo();
boolean isOpaque();
void setCircularRevealOverlayDrawable(Drawable drawable);
void setCircularRevealScrimColor(int i);
void setRevealInfo(RevealInfo revealInfo);
/* loaded from: classes2.dex */
public static class RevealInfo {
public static final float INVALID_RADIUS = Float.MAX_VALUE;
public float centerX;
public float centerY;
public float radius;
public boolean isInvalid() {
return this.radius == Float.MAX_VALUE;
}
public void set(float f, float f2, float f3) {
this.centerX = f;
this.centerY = f2;
this.radius = f3;
}
private RevealInfo() {
}
public RevealInfo(float f, float f2, float f3) {
this.centerX = f;
this.centerY = f2;
this.radius = f3;
}
public RevealInfo(RevealInfo revealInfo) {
this(revealInfo.centerX, revealInfo.centerY, revealInfo.radius);
}
public void set(RevealInfo revealInfo) {
set(revealInfo.centerX, revealInfo.centerY, revealInfo.radius);
}
}
/* loaded from: classes2.dex */
public static class CircularRevealProperty extends Property<CircularRevealWidget, RevealInfo> {
public static final Property<CircularRevealWidget, RevealInfo> CIRCULAR_REVEAL = new CircularRevealProperty("circularReveal");
private CircularRevealProperty(String str) {
super(RevealInfo.class, str);
}
@Override // android.util.Property
public RevealInfo get(CircularRevealWidget circularRevealWidget) {
return circularRevealWidget.getRevealInfo();
}
@Override // android.util.Property
public void set(CircularRevealWidget circularRevealWidget, RevealInfo revealInfo) {
circularRevealWidget.setRevealInfo(revealInfo);
}
}
/* loaded from: classes2.dex */
public static class CircularRevealEvaluator implements TypeEvaluator<RevealInfo> {
public static final TypeEvaluator<RevealInfo> CIRCULAR_REVEAL = new CircularRevealEvaluator();
private final RevealInfo revealInfo = new RevealInfo();
@Override // android.animation.TypeEvaluator
public RevealInfo evaluate(float f, RevealInfo revealInfo, RevealInfo revealInfo2) {
this.revealInfo.set(MathUtils.lerp(revealInfo.centerX, revealInfo2.centerX, f), MathUtils.lerp(revealInfo.centerY, revealInfo2.centerY, f), MathUtils.lerp(revealInfo.radius, revealInfo2.radius, f));
return this.revealInfo;
}
}
/* loaded from: classes2.dex */
public static class CircularRevealScrimColorProperty extends Property<CircularRevealWidget, Integer> {
public static final Property<CircularRevealWidget, Integer> CIRCULAR_REVEAL_SCRIM_COLOR = new CircularRevealScrimColorProperty("circularRevealScrimColor");
private CircularRevealScrimColorProperty(String str) {
super(Integer.class, str);
}
@Override // android.util.Property
public Integer get(CircularRevealWidget circularRevealWidget) {
return Integer.valueOf(circularRevealWidget.getCircularRevealScrimColor());
}
@Override // android.util.Property
public void set(CircularRevealWidget circularRevealWidget, Integer num) {
circularRevealWidget.setCircularRevealScrimColor(num.intValue());
}
}
}