package com.facetec.sdk; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Handler; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.LinearInterpolator; import android.view.animation.RotateAnimation; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.vectordrawable.graphics.drawable.Animatable2Compat; import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat; import com.facetec.sdk.aq; import com.facetec.sdk.cs; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import o.nMh; /* loaded from: classes.dex */ public final class cs extends aq { Handler a; e c; private RelativeLayout d; private View f; private ImageView g; private TextView h; private RelativeLayout i; private ImageView j; private Drawable k; private Animatable2Compat.AnimationCallback m; /* renamed from: o, reason: collision with root package name */ private AnimatedVectorDrawableCompat f6426o; boolean e = false; private boolean n = false; final aq.e b = new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.cs$$ExternalSyntheticLambda5 public final cs f$0; @Override // java.lang.Runnable public final void run() { this.f$0.a(); } { this.f$0 = this; } }); /* loaded from: classes.dex */ public interface e { void p(); } @Override // com.facetec.sdk.aq, android.app.Fragment public final void onCreate(Bundle bundle) { super.onCreate(bundle); } @Override // android.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { return layoutInflater.inflate(R.layout.facetec_securing_camera_fragment, viewGroup, false); } @Override // android.app.Fragment public final void onViewCreated(View view, Bundle bundle) { super.onViewCreated(view, bundle); this.d = (RelativeLayout) view.findViewById(R.id.mainLayout); this.i = (RelativeLayout) view.findViewById(R.id.mainContainer); this.f = view.findViewById(R.id.mainBackgroundView); this.h = (TextView) view.findViewById(R.id.messageTextView); this.j = (ImageView) view.findViewById(R.id.animationBackgroundImageView); this.g = (ImageView) view.findViewById(R.id.animationForegroundImageView); db.f(this.f); this.f.getBackground().setAlpha(db.aU()); float e2 = db.e() * db.d(); float bj = db.bj(); int a = db.a(); int round = Math.round(av.b(40) * bj * e2); this.i.setTranslationY(Math.round(av.b(-55) * e2)); FrameLayout frameLayout = (FrameLayout) view.findViewById(R.id.animationFrameLayout); frameLayout.getLayoutParams().height = round; frameLayout.getLayoutParams().width = round; int aJ = db.aJ(); int aK = db.aK(); if (aK != 0) { this.f6426o = av.e(getActivity(), aK); } if (aJ != 0) { this.k = nMh.getDrawable(getActivity(), aJ); } if (this.f6426o != null) { this.j.setVisibility(8); c(new Runnable(this) { // from class: com.facetec.sdk.cs$$ExternalSyntheticLambda4 public final cs f$0; @Override // java.lang.Runnable public final void run() { this.f$0.e(); } { this.f$0 = this; } }); } else if (this.k != null) { this.j.setVisibility(8); this.g.setImageDrawable(this.k); RotateAnimation rotateAnimation = new RotateAnimation(BitmapDescriptorFactory.HUE_RED, 360.0f, 1, 0.5f, 1, 0.5f); rotateAnimation.setInterpolator(new LinearInterpolator()); rotateAnimation.setDuration(FaceTecSDK.c.m.customAnimationImageRotationInterval); rotateAnimation.setRepeatCount(-1); this.g.startAnimation(rotateAnimation); } else { this.j.setColorFilter(db.t(getActivity()), PorterDuff.Mode.SRC_IN); this.g.setColorFilter(db.p(getActivity()), PorterDuff.Mode.SRC_IN); RotateAnimation rotateAnimation2 = new RotateAnimation(BitmapDescriptorFactory.HUE_RED, 360.0f, 1, 0.5f, 1, 0.5f); rotateAnimation2.setDuration(1000L); rotateAnimation2.setInterpolator(new LinearInterpolator()); rotateAnimation2.setRepeatCount(-1); this.g.startAnimation(rotateAnimation2); } db.a(this.h, db.p(getActivity())); this.h.setTypeface(FaceTecSDK.c.m.messageFont); cx.e(this.h, R.string.FaceTec_initializing_camera); this.h.setTextSize(2, e2 * 16.0f); LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) this.h.getLayoutParams(); ((ViewGroup.MarginLayoutParams) layoutParams).topMargin = a; ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin = a; ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin = a; this.h.setLayoutParams(layoutParams); t.e(ct.SECURING_CAMERA); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void e() { this.g.setImageDrawable(this.f6426o); AnonymousClass2 anonymousClass2 = new AnonymousClass2(this); this.m = anonymousClass2; this.f6426o.a(anonymousClass2); this.f6426o.start(); } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: com.facetec.sdk.cs$2, reason: invalid class name */ /* loaded from: classes.dex */ public final class AnonymousClass2 extends Animatable2Compat.AnimationCallback { private cs e; AnonymousClass2(cs csVar) { this.e = csVar; } @Override // androidx.vectordrawable.graphics.drawable.Animatable2Compat.AnimationCallback public final void onAnimationEnd(Drawable drawable) { this.e.c(new Runnable(this) { // from class: com.facetec.sdk.cs$2$$ExternalSyntheticLambda0 public final cs.AnonymousClass2 f$0; @Override // java.lang.Runnable public final void run() { this.f$0.d(); } { this.f$0 = this; } }); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void d() { if (this.e.f6426o == null) { return; } this.e.f6426o.start(); } } /* JADX INFO: Access modifiers changed from: package-private */ public final void d() { if (this.e && this.n) { final aq.e eVar = new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.cs$$ExternalSyntheticLambda0 public final cs f$0; @Override // java.lang.Runnable public final void run() { this.f$0.b(); } { this.f$0 = this; } }); c(new Runnable(this, eVar) { // from class: com.facetec.sdk.cs$$ExternalSyntheticLambda1 public final cs f$0; public final aq.e f$1; @Override // java.lang.Runnable public final void run() { this.f$0.a(this.f$1); } { this.f$0 = this; this.f$1 = eVar; } }); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void a(final aq.e eVar) { this.i.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(500L).setStartDelay(0L).setListener(null).withEndAction(new aq.e(this, new Runnable(this, eVar) { // from class: com.facetec.sdk.cs$$ExternalSyntheticLambda3 public final cs f$0; public final aq.e f$1; @Override // java.lang.Runnable public final void run() { this.f$0.b(this.f$1); } { this.f$0 = this; this.f$1 = eVar; } })).start(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void b(final aq.e eVar) { c(new Runnable(this, eVar) { // from class: com.facetec.sdk.cs$$ExternalSyntheticLambda2 public final cs f$0; public final aq.e f$1; @Override // java.lang.Runnable public final void run() { this.f$0.c(this.f$1); } { this.f$0 = this; this.f$1 = eVar; } }); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void c(aq.e eVar) { RelativeLayout relativeLayout = this.i; if (relativeLayout != null) { relativeLayout.setVisibility(8); } if (eVar != null) { eVar.run(); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void b() { e eVar = this.c; if (eVar != null) { eVar.p(); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void a() { this.n = true; d(); } }