package com.facetec.sdk; import android.animation.ArgbEvaluator; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.animation.DecelerateInterpolator; import com.google.android.gms.maps.model.BitmapDescriptorFactory; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes.dex */ public class az extends cr { Paint d; private final Matrix k; private Drawable n; /* renamed from: o, reason: collision with root package name */ private final Context f6409o; private float p; private int q; private float r; private final float[] s; private boolean t; public az(Context context, AttributeSet attributeSet) { super(context, attributeSet); this.k = new Matrix(); this.s = new float[9]; this.r = BitmapDescriptorFactory.HUE_RED; this.p = BitmapDescriptorFactory.HUE_RED; this.t = false; this.q = -1; this.f6409o = context; post(new Runnable(this) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda4 public final az f$0; @Override // java.lang.Runnable public final void run() { this.f$0.o(); } { this.f$0 = this; } }); } @Override // com.facetec.sdk.cr, android.view.View protected void onDraw(Canvas canvas) { Drawable drawable = this.n; if (drawable != null) { drawable.draw(canvas); if (!this.t || this.a == null || this.i == null || this.g == null || this.d == null || this.c == null || this.e == null) { return; } canvas.concat(this.k); canvas.drawOval(this.a, this.c); canvas.drawOval(this.g, this.d); canvas.drawOval(this.i, this.e); return; } canvas.drawColor(db.b(db.l(this.f6409o), 255)); } /* JADX INFO: Access modifiers changed from: package-private */ public final void e() { postDelayed(new Runnable(this) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda0 public final az f$0; @Override // java.lang.Runnable public final void run() { this.f$0.m(); } { this.f$0 = this; } }, 0L); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void m() { Paint paint = this.d; if (paint == null) { return; } ValueAnimator ofObject = ValueAnimator.ofObject(new ArgbEvaluator(), Integer.valueOf(paint.getColor()), Integer.valueOf(db.k(this.f6409o))); ofObject.setDuration(1000L); ofObject.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda11 public final az f$0; @Override // android.animation.ValueAnimator.AnimatorUpdateListener public final void onAnimationUpdate(ValueAnimator valueAnimator) { this.f$0.h(valueAnimator); } { this.f$0 = this; } }); ofObject.start(); ValueAnimator ofObject2 = ValueAnimator.ofObject(new ArgbEvaluator(), Integer.valueOf(this.e.getColor()), Integer.valueOf(db.n(this.f6409o))); ofObject2.setDuration(1000L); ofObject2.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda1 public final az f$0; @Override // android.animation.ValueAnimator.AnimatorUpdateListener public final void onAnimationUpdate(ValueAnimator valueAnimator) { this.f$0.e(valueAnimator); } { this.f$0 = this; } }); ofObject2.start(); ValueAnimator ofFloat = ObjectAnimator.ofFloat(BitmapDescriptorFactory.HUE_RED, 1.0f); final int J = db.J(); ofFloat.setDuration(1000L); ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this, J) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda2 public final az f$0; public final int f$1; @Override // android.animation.ValueAnimator.AnimatorUpdateListener public final void onAnimationUpdate(ValueAnimator valueAnimator) { this.f$0.e(this.f$1, valueAnimator); } { this.f$0 = this; this.f$1 = J; } }); ofFloat.start(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void h(ValueAnimator valueAnimator) { Paint paint = this.d; if (paint == null) { return; } paint.setColor(((Integer) valueAnimator.getAnimatedValue()).intValue()); postInvalidateOnAnimation(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void e(ValueAnimator valueAnimator) { if (this.e == null) { return; } this.e.setColor(((Integer) valueAnimator.getAnimatedValue()).intValue()); postInvalidateOnAnimation(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void e(int i, ValueAnimator valueAnimator) { if (this.n == null) { return; } float floatValue = ((Float) valueAnimator.getAnimatedValue()).floatValue(); this.n.setColorFilter(db.a(i, floatValue), PorterDuff.Mode.SRC_ATOP); double d = floatValue; if (d == 0.0d || d == 1.0d) { if (d == 1.0d) { db.a(this.n, i); } this.n.setColorFilter(null); } postInvalidateOnAnimation(); } /* JADX INFO: Access modifiers changed from: package-private */ public final void c(final int i, final int i2, int i3) { postDelayed(new Runnable(this, i, i2) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda3 public final az f$0; public final int f$1; public final int f$2; @Override // java.lang.Runnable public final void run() { this.f$0.a(this.f$1, this.f$2); } { this.f$0 = this; this.f$1 = i; this.f$2 = i2; } }, i3); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void a(int i, int i2) { ValueAnimator ofInt = ValueAnimator.ofInt(255, i); ofInt.setDuration(i2); ofInt.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda7 public final az f$0; @Override // android.animation.ValueAnimator.AnimatorUpdateListener public final void onAnimationUpdate(ValueAnimator valueAnimator) { this.f$0.a(valueAnimator); } { this.f$0 = this; } }); ofInt.start(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void a(ValueAnimator valueAnimator) { Drawable drawable = this.n; if (drawable == null) { return; } drawable.setAlpha(((Integer) valueAnimator.getAnimatedValue()).intValue()); postInvalidateOnAnimation(); } /* JADX INFO: Access modifiers changed from: package-private */ public final void a() { final int i = 1000; postDelayed(new Runnable(this, i) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda5 public final az f$0; public final int f$1; @Override // java.lang.Runnable public final void run() { this.f$0.d(this.f$1); } { this.f$0 = this; this.f$1 = i; } }, 0L); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void d(int i) { ValueAnimator ofInt = ValueAnimator.ofInt(255, db.c(this.f6409o, FaceTecSDK.c.f.readyScreenOvalFillColor)); long j = i; ofInt.setDuration(j); ofInt.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda9 public final az f$0; @Override // android.animation.ValueAnimator.AnimatorUpdateListener public final void onAnimationUpdate(ValueAnimator valueAnimator) { this.f$0.c(valueAnimator); } { this.f$0 = this; } }); ValueAnimator ofInt2 = ValueAnimator.ofInt(255, db.c(this.f6409o, FaceTecSDK.c.n.strokeColor)); ofInt2.setDuration(j); ofInt2.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda10 public final az f$0; @Override // android.animation.ValueAnimator.AnimatorUpdateListener public final void onAnimationUpdate(ValueAnimator valueAnimator) { this.f$0.b(valueAnimator); } { this.f$0 = this; } }); ofInt.start(); ofInt2.start(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void c(ValueAnimator valueAnimator) { Paint paint = this.d; if (paint == null) { return; } paint.setAlpha(((Integer) valueAnimator.getAnimatedValue()).intValue()); postInvalidateOnAnimation(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void b(ValueAnimator valueAnimator) { if (this.e == null) { return; } this.e.setAlpha(((Integer) valueAnimator.getAnimatedValue()).intValue()); postInvalidateOnAnimation(); } /* JADX INFO: Access modifiers changed from: package-private */ public final void b() { this.t = true; float d = getResources().getDisplayMetrics().widthPixels * db.d(); this.r = d; this.k.setTranslate(d, BitmapDescriptorFactory.HUE_RED); post(new Runnable(this) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda6 public final az f$0; @Override // java.lang.Runnable public final void run() { this.f$0.l(); } { this.f$0 = this; } }); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void l() { ValueAnimator ofFloat = ObjectAnimator.ofFloat(this.r, BitmapDescriptorFactory.HUE_RED); ofFloat.setInterpolator(new DecelerateInterpolator()); ofFloat.setDuration(800L); ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.az$$ExternalSyntheticLambda8 public final az f$0; @Override // android.animation.ValueAnimator.AnimatorUpdateListener public final void onAnimationUpdate(ValueAnimator valueAnimator) { this.f$0.d(valueAnimator); } { this.f$0 = this; } }); ofFloat.start(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void d(ValueAnimator valueAnimator) { Matrix matrix = this.k; if (matrix == null) { return; } matrix.getValues(this.s); float f = -((valueAnimator.getAnimatedFraction() * this.r) - (this.r - this.s[2])); this.p = f; this.k.postTranslate(f, BitmapDescriptorFactory.HUE_RED); postInvalidateOnAnimation(); } @Override // android.view.View protected void onLayout(boolean z, int i, int i2, int i3, int i4) { super.onLayout(z, i, i2, i3, i4); int width = getWidth(); if (width != this.q) { if (this.n == null) { Drawable s = db.s(this.f6409o); this.n = s; s.setAlpha(255); } this.n.setBounds(0, 0, getWidth(), getHeight()); if (this.q != -1) { e(true); } this.q = width; } } /* JADX INFO: Access modifiers changed from: package-private */ public final void d() { this.t = true; postInvalidate(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void o() { setLayerType(2, null); Paint paint = new Paint(1); this.d = paint; paint.setStyle(Paint.Style.FILL); this.d.setColor(db.k(this.f6409o)); } }