what-the-bank/sources/com/facetec/sdk/bd.java

170 lines
5.2 KiB
Java

package com.facetec.sdk;
import android.animation.Animator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import com.facetec.sdk.bd;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import java.util.ArrayList;
import java.util.Iterator;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public final class bd extends View {
private final int a;
private final ArrayList<a> b;
private int c;
private int d;
private final int e;
private boolean g;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public static final class b {
float a;
float b = BitmapDescriptorFactory.HUE_RED;
float d;
b(float f, float f2) {
this.d = f;
this.a = f2;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public final class a {
b b;
Paint e;
private bd h;
float a = BitmapDescriptorFactory.HUE_RED;
private int d = -1;
ArrayList<Animator> c = new ArrayList<>();
a(bd bdVar, float f, float f2) {
this.h = bdVar;
this.b = new b(f, f2);
bdVar.setLayerType(2, null);
Paint paint = new Paint(1);
this.e = paint;
paint.setStyle(Paint.Style.STROKE);
this.e.setStrokeWidth(this.a);
this.e.setColor(this.d);
}
}
public bd(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.e = 500;
this.a = 5;
this.b = new ArrayList<>();
this.g = false;
post(new Runnable(this) { // from class: com.facetec.sdk.bd$$ExternalSyntheticLambda0
public final bd f$0;
@Override // java.lang.Runnable
public final void run() {
this.f$0.c();
}
{
this.f$0 = this;
}
});
}
@Override // android.view.View
protected final void onDraw(Canvas canvas) {
ArrayList<a> arrayList;
if (!this.g || (arrayList = this.b) == null || arrayList.size() <= 0) {
return;
}
Iterator<a> it = this.b.iterator();
while (it.hasNext()) {
a next = it.next();
b bVar = next.b;
canvas.drawCircle(bVar.d, bVar.a, bVar.b, next.e);
}
this.g = false;
}
private void d() {
this.g = true;
postInvalidate();
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void d(float f, float f2) {
if (this.b.size() > 5) {
return;
}
final a aVar = new a(this, f, f2);
final ValueAnimator ofFloat = ValueAnimator.ofFloat(aVar.b.b, this.c);
ofFloat.setDuration(500L);
ofFloat.setInterpolator(new DecelerateInterpolator());
ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this, aVar) { // from class: com.facetec.sdk.bd$$ExternalSyntheticLambda1
public final bd f$0;
public final bd.a f$1;
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
this.f$0.d(this.f$1, valueAnimator);
}
{
this.f$0 = this;
this.f$1 = aVar;
}
});
ofFloat.addListener(new e(this, aVar, ofFloat) { // from class: com.facetec.sdk.bd$$ExternalSyntheticLambda2
public final bd f$0;
public final bd.a f$1;
public final ValueAnimator f$2;
@Override // android.animation.Animator.AnimatorListener
public final void onAnimationEnd(Animator animator) {
this.f$0.d(this.f$1, this.f$2, animator);
}
{
this.f$0 = this;
this.f$1 = aVar;
this.f$2 = ofFloat;
}
});
ofFloat.start();
aVar.c.add(ofFloat);
this.b.add(aVar);
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void d(a aVar, ValueAnimator valueAnimator) {
aVar.b.b = ((Float) valueAnimator.getAnimatedValue()).floatValue();
aVar.a = Math.min(this.d, aVar.b.b);
if (aVar.e != null) {
aVar.e.setStrokeWidth(aVar.a);
}
aVar.e.setAlpha(Math.round((1.0f - valueAnimator.getAnimatedFraction()) * 255.0f));
d();
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void d(a aVar, ValueAnimator valueAnimator, Animator animator) {
aVar.e.setAlpha(0);
d();
aVar.c.remove(valueAnimator);
this.b.remove(aVar);
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void c() {
this.c = Math.round(av.b(50) * db.d() * db.e());
this.d = Math.round(av.b(3) * db.d() * db.e());
}
}