package com.facetec.sdk; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.app.Activity; import android.content.res.Resources; import android.os.Bundle; import android.os.Handler; import android.util.Property; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.animation.DecelerateInterpolator; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import com.facetec.sdk.FaceTecCancelButtonCustomization; import com.facetec.sdk.aq; import com.facetec.sdk.cd; import com.facetec.sdk.cs; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import java.util.Timer; import java.util.TimerTask; /* loaded from: classes.dex */ public final class bi extends aq { private RelativeLayout A; private LinearLayout B; private LinearLayout C; private ImageView D; private RelativeLayout E; private LinearLayout F; private RelativeLayout G; private RelativeLayout H; private ImageView I; private RelativeLayout J; private LinearLayout K; private RelativeLayout L; private RelativeLayout M; private ImageView N; private RelativeLayout R; private Handler T; private bg U; private an V; private FrameLayout Y; private boolean Z; TextView a; private cs aa; private Timer ab; private Handler ac; private boolean ah; RelativeLayout b; a c; ImageView d; a e; bn f; a g; View h; a j; private bd l; private bj n; private RelativeLayout p; private RelativeLayout q; private RelativeLayout r; private TextView s; private RelativeLayout t; private ImageView u; private ImageView v; private TextView w; private TextView x; private LinearLayout y; private RelativeLayout z; d i = d.FRONT; private boolean Q = false; private boolean P = false; private boolean S = false; private boolean O = false; /* renamed from: o, reason: collision with root package name */ boolean f6413o = false; boolean k = false; private boolean W = false; private boolean X = false; private TimerTask ag = new da(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda28 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.M(); } { this.f$0 = this; } }); private ViewTreeObserver.OnGlobalLayoutListener ae = new ViewTreeObserver.OnGlobalLayoutListener(this) { // from class: com.facetec.sdk.bi.4 private bi b; { this.b = this; } @Override // android.view.ViewTreeObserver.OnGlobalLayoutListener public final void onGlobalLayout() { if (this.b.P) { return; } bi.e(this.b); this.b.j(); float e = db.e(); float d2 = db.d(); int b = (int) (av.b(35) * e * d2); int b2 = (int) (av.b(50) * e * d2); int a = db.a(); float f = a; float f2 = f / 2.0f; int round = Math.round(f2); int round2 = Math.round(f2); int i = (int) (20.0f * e * d2); int f3 = db.f(); int i2 = (int) (e * 16.0f * d2); int round3 = Math.round(f2); this.b.g(); RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.b.K.getLayoutParams(); layoutParams.setMargins(a, 0, a, a); this.b.K.setLayoutParams(layoutParams); this.b.K.requestLayout(); RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.b.L.getLayoutParams(); layoutParams2.setMargins(a, 0, a, a); ((ViewGroup.LayoutParams) layoutParams2).height = b2; this.b.L.setLayoutParams(layoutParams2); this.b.L.requestLayout(); this.b.j.setLayoutParams(new LinearLayout.LayoutParams(-1, b2)); this.b.j.requestLayout(); new LinearLayout.LayoutParams(-1, b2).setMargins(0, 0, 0, a); float d3 = (Resources.getSystem().getDisplayMetrics().widthPixels * db.d()) - (a << 1); int i3 = (int) d3; this.b.K.getLayoutParams().width = i3; this.b.K.requestLayout(); this.b.c.getLayoutParams().width = i3; this.b.c.requestLayout(); float min = Math.min(Math.max(b2, d3 / 2.0f), (d3 - f) / 2.0f); this.b.h.getLayoutParams().width = (int) ((this.b.b.getWidth() - (2.0f * min)) / 3.0f); int i4 = (int) min; this.b.g.getLayoutParams().width = i4; this.b.e.getLayoutParams().width = i4; ((LinearLayout.LayoutParams) this.b.g.getLayoutParams()).weight = BitmapDescriptorFactory.HUE_RED; ((LinearLayout.LayoutParams) this.b.e.getLayoutParams()).weight = BitmapDescriptorFactory.HUE_RED; this.b.g.requestLayout(); this.b.e.requestLayout(); RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) this.b.d.getLayoutParams(); layoutParams3.setMargins(round, round, 0, round); layoutParams3.setMarginStart(round); layoutParams3.setMarginEnd(round); this.b.d.setLayoutParams(layoutParams3); this.b.d.setPadding(round, round, round, round); this.b.d.getLayoutParams().height = b; this.b.d.getLayoutParams().width = b; this.b.d.requestLayout(); RelativeLayout.LayoutParams layoutParams4 = (RelativeLayout.LayoutParams) this.b.I.getLayoutParams(); ((ViewGroup.LayoutParams) layoutParams4).width = -2; ((ViewGroup.LayoutParams) layoutParams4).height = -2; layoutParams4.setMargins(0, round, round, round); layoutParams4.setMarginStart(round); layoutParams4.setMarginEnd(round); this.b.I.setLayoutParams(layoutParams4); this.b.I.setPadding(round2, round2, round2, round2); this.b.I.getLayoutParams().height = b; this.b.I.getLayoutParams().width = b; this.b.I.requestLayout(); if (FaceTecSDK.c.k.b == FaceTecCancelButtonCustomization.ButtonLocation.TOP_RIGHT) { ((RelativeLayout.LayoutParams) this.b.I.getLayoutParams()).addRule(20); } else { ((RelativeLayout.LayoutParams) this.b.I.getLayoutParams()).addRule(21); } float f4 = i; this.b.j.setTextSize(2, f4); this.b.g.setTextSize(2, f4); this.b.e.setTextSize(2, f4); this.b.c.setTextSize(2, f4); this.b.w.setTextSize(2, f3); this.b.x.setTextSize(2, f4); this.b.s.setTextSize(2, f4); this.b.x.setPadding(round3, round3, round3, round3); this.b.s.setPadding(round3, round3, round3, round3); this.b.a.setTextSize(2, i2); int a2 = db.a(); LinearLayout.LayoutParams layoutParams5 = (LinearLayout.LayoutParams) this.b.w.getLayoutParams(); layoutParams5.setMarginStart(a2); layoutParams5.setMarginEnd(a2); this.b.w.setLayoutParams(layoutParams5); this.b.w.requestLayout(); } }; final cd.b m = new cd.b(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda29 public final bi f$0; @Override // com.facetec.sdk.cd.b public final void onIDScanProgress(cf cfVar, cc ccVar) { this.f$0.c(cfVar, ccVar); } { this.f$0 = this; } }; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes.dex */ public enum d { FRONT, BACK } static /* synthetic */ boolean e(bi biVar) { biVar.P = true; return true; } /* JADX INFO: Access modifiers changed from: private */ /* renamed from: h, reason: merged with bridge method [inline-methods] and merged with bridge method [inline-methods] */ public void M() { an anVar = this.V; if (anVar != null) { anVar.b(false, (ViewGroup) this.E); } } /* JADX INFO: Access modifiers changed from: package-private */ public static bi d(boolean z, boolean z2) { bi biVar = new bi(); Bundle bundle = new Bundle(); bundle.putBoolean("overzoomedDocument", z); bundle.putBoolean("isStandaloneIDScan", z2); biVar.setArguments(bundle); return biVar; } @Override // android.app.Fragment public final void onAttach(Activity activity) { super.onAttach(activity); this.U = (bg) activity; } @Override // android.app.Fragment public final void onDestroy() { super.onDestroy(); f(); k(); r(); j(); } @Override // android.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { return layoutInflater.inflate(R.layout.facetec_idscan_fragment, viewGroup, false); } /* JADX WARN: Code restructure failed: missing block: B:40:0x0484, code lost: if (r2 != 4) goto L58; */ @Override // android.app.Fragment /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void onViewCreated(android.view.View r18, android.os.Bundle r19) { /* Method dump skipped, instructions count: 1312 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.facetec.sdk.bi.onViewCreated(android.view.View, android.os.Bundle):void"); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void e(int i) { long j = i; a(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda20 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.L(); } { this.f$0 = this; } }, j); cs csVar = this.aa; if (csVar.a != null) { csVar.a.removeCallbacks(csVar.b); } csVar.a = new Handler(); csVar.a.postDelayed(csVar.b, j + 1000); } private void i() { final boolean z = this.U.s == FaceTecIDScanNextStep.SELECTION_SCREEN && this.i != d.BACK && this.f == null; if (getActivity() != null) { getActivity().runOnUiThread(new Runnable(this, z) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda0 public final bi f$0; public final boolean f$1; @Override // java.lang.Runnable public final void run() { this.f$0.j(this.f$1); } { this.f$0 = this; this.f$1 = z; } }); } t.e(ct.ID_SCAN_START); } /* JADX INFO: Access modifiers changed from: package-private */ public final void c() { this.Y.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(500L).withEndAction(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda18 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.N(); } { this.f$0 = this; } })).start(); } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: d, reason: merged with bridge method [inline-methods] */ public final void L() { try { this.V = (an) ah.c((ViewGroup) this.E, (Activity) this.U, true); } catch (ae e) { k.a(e); bg bgVar = this.U; com.facetec.sdk.d dVar = com.facetec.sdk.d.CAMERA_ERROR; StringBuilder sb = new StringBuilder("IDScanCameraSetupError with message: "); sb.append(e.getMessage()); t.d(bgVar, e, dVar, sb.toString(), false); bg bgVar2 = this.U; bgVar2.d(bgVar2.r.getStatus(), FaceTecIDScanStatus.CAMERA_ERROR); } this.V.a(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda10 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.G(); } { this.f$0 = this; } })); this.E.setOnTouchListener(new View.OnTouchListener(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda12 public final bi f$0; @Override // android.view.View.OnTouchListener public final boolean onTouch(View view, MotionEvent motionEvent) { boolean b; b = this.f$0.b(view, motionEvent); return b; } { this.f$0 = this; } }); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ boolean b(View view, MotionEvent motionEvent) { if (this.O && motionEvent.getAction() == 0 && this.n.b().contains(motionEvent.getX(), motionEvent.getY())) { try { if (this.V != null) { k(); this.ah = true; this.V.a(this.E); this.l.d(motionEvent.getX(), motionEvent.getY()); } } catch (Exception unused) { } } return true; } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void j(boolean z) { c(false); int i = this.Z ? 0 : 500; this.p.setVisibility(0); this.q.setVisibility(0); float b = av.b(20) * db.e() * db.d(); if (z) { this.F.setTranslationY(-b); this.K.setTranslationY(b); long j = i; this.F.animate().alpha(1.0f).translationY(BitmapDescriptorFactory.HUE_RED).setDuration(500L).setStartDelay(j).setInterpolator(new DecelerateInterpolator()).setListener(null).start(); this.K.animate().alpha(1.0f).translationY(BitmapDescriptorFactory.HUE_RED).setDuration(500L).setStartDelay(j).setInterpolator(new DecelerateInterpolator()).setListener(null).start(); } n(); if (FaceTecSDK.c.k.b == FaceTecCancelButtonCustomization.ButtonLocation.CUSTOM) { this.U.c(500, i); } else if (FaceTecSDK.c.k.b != FaceTecCancelButtonCustomization.ButtonLocation.DISABLED) { this.d.animate().alpha(1.0f).setDuration(500L).setStartDelay(i).setInterpolator(new DecelerateInterpolator()).setListener(null).start(); } this.R.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(500L).setStartDelay(i).setInterpolator(new DecelerateInterpolator()).setListener(null).start(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void E() { a(false); } private void n() { this.c.c(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda23 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.E(); } { this.f$0 = this; } }); this.e.c(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda24 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.e(); } { this.f$0 = this; } }); this.g.c(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda25 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.m(); } { this.f$0 = this; } }); this.j.c(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda26 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.s(); } { this.f$0 = this; } }); this.I.setOnClickListener(new View.OnClickListener(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda27 public final bi f$0; @Override // android.view.View.OnClickListener public final void onClick(View view) { this.f$0.a(view); } { this.f$0 = this; } }); } /* JADX INFO: Access modifiers changed from: package-private */ public final void b() { a aVar = this.c; if (aVar != null) { aVar.setEnabled(false); } q(); e(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda4 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.z(); } { this.f$0 = this; } }, 100L); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void z() { if (this.f == bn.BACK) { this.i = d.BACK; cx.e(this.x, R.string.FaceTec_idscan_capture_id_back_instruction_message); } else { this.i = d.FRONT; cx.e(this.x, R.string.FaceTec_idscan_capture_id_front_instruction_message); } this.t.setAlpha(1.0f); this.M.setVisibility(8); this.q.setVisibility(4); this.p.setVisibility(0); this.r.setVisibility(0); c(false); an anVar = this.V; if (anVar == null) { a(3); return; } anVar.b(); l(); cg.l(this.k, false); this.ac.postDelayed(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda2 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.I(); } { this.f$0 = this; } }, 800L); o(); n(); this.R.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(500L).setStartDelay(0L).setInterpolator(new DecelerateInterpolator()).setListener(null).withEndAction(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda3 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.F(); } { this.f$0 = this; } }).start(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void I() { this.c.c(true, true); this.I.setEnabled(true); this.d.setEnabled(true); this.f6413o = true; } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void F() { an anVar = this.V; if (anVar == null) { return; } anVar.a(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda30 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.H(); } { this.f$0 = this; } }); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void H() { RelativeLayout relativeLayout = this.t; if (relativeLayout == null) { return; } relativeLayout.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(300L).setInterpolator(new DecelerateInterpolator()).setListener(null).start(); } private void o() { if (getActivity() == null) { return; } getActivity().runOnUiThread(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda22 public final bi 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() { this.I.setImageResource(db.aG()); this.r.setVisibility(0); this.x.setVisibility(0); int a = db.a(); RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.A.getLayoutParams(); float f = a; ((ViewGroup.MarginLayoutParams) layoutParams).topMargin = (int) ((this.n.b().top - this.A.getHeight()) - f); this.A.setLayoutParams(layoutParams); RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.H.getLayoutParams(); ((ViewGroup.MarginLayoutParams) layoutParams2).topMargin = (int) (this.n.b().bottom + f); this.H.setLayoutParams(layoutParams2); RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) this.G.getLayoutParams(); ((ViewGroup.LayoutParams) layoutParams3).height = (int) (this.G.getWidth() / 1.59d); this.G.setLayoutParams(layoutParams3); } private void c(final boolean z) { this.O = !z; cx.e(this.s, R.string.FaceTec_idscan_review_id_front_instruction_message); if (getActivity() == null) { return; } getActivity().runOnUiThread(new Runnable(this, z) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda17 public final bi f$0; public final boolean f$1; @Override // java.lang.Runnable public final void run() { this.f$0.h(this.f$1); } { this.f$0 = this; this.f$1 = z; } }); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void h(boolean z) { int i; int i2 = 0; if (z) { i = 4; } else { this.a.animate().alpha(1.0f).setDuration(100L); this.N.animate().alpha(1.0f).setDuration(100L); i = 0; i2 = 4; } this.B.setVisibility(i2); this.u.setVisibility(i2); this.s.setVisibility(i2); this.I.setVisibility(i); if (this.k) { this.c.setVisibility(i); } else { this.c.setVisibility(4); } this.x.setVisibility(i); } private void l() { k(); this.ag = new da(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda9 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.A(); } { this.f$0 = this; } }); Timer timer = new Timer(); this.ab = timer; timer.scheduleAtFixedRate(this.ag, 6000L, 6000L); } private void k() { Timer timer = this.ab; if (timer != null) { timer.cancel(); this.ab = null; } TimerTask timerTask = this.ag; if (timerTask != null) { timerTask.cancel(); this.ag = null; } } /* JADX INFO: Access modifiers changed from: package-private */ public final void e() { if (this.V == null) { a(7); return; } cg.l(true, true); this.f6413o = true; l(); this.V.b(); if (this.Q) { this.V.d(true); } q(); c(false); this.e.c(false, true); this.g.c(false, true); this.c.c(true, true); this.c.setVisibility(0); if (this.i == d.FRONT) { cx.e(this.x, R.string.FaceTec_idscan_capture_id_front_instruction_message); } else if (this.i == d.BACK) { cx.e(this.x, R.string.FaceTec_idscan_capture_id_back_instruction_message); } } /* JADX INFO: Access modifiers changed from: private */ public void m() { if (this.V == null) { a(8); return; } this.g.c(false, true); this.e.c(false, true); this.d.setEnabled(false); this.Q = false; this.I.setImageResource(db.aG()); this.I.setEnabled(false); r(); this.e.c(false, true); this.g.c(false, true); this.c.c(false, true); if (getActivity() != null) { getActivity().runOnUiThread(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda33 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.u(); } { this.f$0 = this; } }); } this.n.b(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda34 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.C(); } { this.f$0 = this; } }); cy.c(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda1 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.B(); } { this.f$0 = this; } }); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void C() { this.U.w(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void B() { String str; if (this.U.h) { str = this.U.n; } else { str = cd.d; } t.e(getActivity(), this.V.f, false, this.i, str); } /* JADX INFO: Access modifiers changed from: package-private */ public final void f() { an anVar = this.V; if (anVar != null) { anVar.d(false); ImageView imageView = this.I; if (imageView != null) { imageView.setImageResource(db.aG()); } } this.Q = false; } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void u() { float b = av.b(20) * db.e() * db.d(); AnimatorSet animatorSet = new AnimatorSet(); animatorSet.playTogether(ObjectAnimator.ofFloat(this.L, (Property) View.TRANSLATION_Y, b), ObjectAnimator.ofFloat(this.A, (Property) View.TRANSLATION_Y, -b)); animatorSet.setDuration(500L); animatorSet.start(); AnimatorSet animatorSet2 = new AnimatorSet(); animatorSet2.playTogether(ObjectAnimator.ofFloat(this.L, (Property) View.ALPHA, BitmapDescriptorFactory.HUE_RED), ObjectAnimator.ofFloat(this.A, (Property) View.ALPHA, BitmapDescriptorFactory.HUE_RED), ObjectAnimator.ofFloat(this.a, (Property) View.ALPHA, BitmapDescriptorFactory.HUE_RED), ObjectAnimator.ofFloat(this.I, (Property) View.ALPHA, BitmapDescriptorFactory.HUE_RED), ObjectAnimator.ofFloat(this.d, (Property) View.ALPHA, BitmapDescriptorFactory.HUE_RED), ObjectAnimator.ofFloat(this.N, (Property) View.ALPHA, BitmapDescriptorFactory.HUE_RED), ObjectAnimator.ofFloat(this.R, (Property) View.ALPHA, BitmapDescriptorFactory.HUE_RED)); animatorSet2.setDuration(500L); animatorSet2.start(); if (this.U.f6412o != null) { this.U.f6412o.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(500L).start(); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void e(View view) { this.d.setEnabled(false); this.g.c(false, true); this.e.c(false, true); this.c.c(false, true); this.U.c(FaceTecIDScanStatus.USER_CANCELED); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ boolean c(View view, MotionEvent motionEvent) { if (motionEvent.getAction() == 0) { this.d.setAlpha(0.4f); } else if (motionEvent.getAction() == 3 || motionEvent.getX() < BitmapDescriptorFactory.HUE_RED || motionEvent.getX() > this.d.getWidth() + this.d.getLeft() + 10 || motionEvent.getY() < BitmapDescriptorFactory.HUE_RED || motionEvent.getY() > this.d.getHeight() + this.d.getTop() + 10) { this.d.setAlpha(1.0f); } else if (motionEvent.getAction() == 1) { this.d.performClick(); } return true; } final void g() { int round = Math.round((av.b(db.x()) * db.d()) / 2.0f); this.p.setPadding(round, round, round, round); this.u.setPadding(round, round, round, round); } final void j() { ImageView imageView = this.d; if (imageView != null) { imageView.getViewTreeObserver().removeOnGlobalLayoutListener(this.ae); } this.ae = null; } /* JADX INFO: Access modifiers changed from: private */ public void s() { cd cdVar = this.U.b; if (cdVar == null) { return; } this.j.c(false, true); cx.e(this.x, R.string.FaceTec_idscan_capture_id_front_instruction_message); o(); q(); l(); this.f6413o = true; boolean e = dl.e(this.U); be beVar = (be) getActivity(); try { cdVar.a(beVar, e, ((bg) getActivity()).f); getActivity().runOnUiThread(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda31 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.x(); } { this.f$0 = this; } }); } catch (NullPointerException unused) { com.facetec.sdk.d dVar = com.facetec.sdk.d.PHOENIX_HANDLER_UNEXPECTED_NULL; StringBuilder sb = new StringBuilder("phoenixHandler is null unexpectedly. Check Activity State Info to see if session has finished"); sb.append(t.e((Activity) beVar)); t.a(beVar, dVar, sb.toString()); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void w() { this.q.setVisibility(8); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void x() { this.q.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(300L).setListener(null).withEndAction(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda11 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.w(); } { this.f$0 = this; } }).start(); } private void r() { Handler handler = this.T; if (handler != null) { handler.removeCallbacksAndMessages(null); this.T = null; } } /* JADX INFO: Access modifiers changed from: private */ /* renamed from: t, reason: merged with bridge method [inline-methods] and merged with bridge method [inline-methods] */ public void y() { this.U.c(FaceTecIDScanStatus.TIMED_OUT); } private void q() { r(); Handler handler = new Handler(); this.T = handler; handler.postDelayed(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda19 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.y(); } { this.f$0 = this; } }, 600000L); } /* JADX INFO: Access modifiers changed from: private */ public void a(final View view) { if (this.V == null) { a(6); return; } view.setEnabled(false); this.c.c(false, true); view.postDelayed(new Runnable(this, view) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda21 public final bi f$0; public final View f$1; @Override // java.lang.Runnable public final void run() { this.f$0.b(this.f$1); } { this.f$0 = this; this.f$1 = view; } }, 1000L); boolean z = !this.Q; this.Q = z; if (z) { this.I.setImageResource(db.aE()); } else { this.I.setImageResource(db.aG()); } this.V.d(this.Q); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void b(View view) { view.setEnabled(true); this.c.c(true, true); } private void a(final boolean z) { if (this.V.f()) { k(); q(); this.f6413o = false; if (getActivity() == null) { return; } getActivity().runOnUiThread(new Runnable(this, z) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda7 public final bi f$0; public final boolean f$1; @Override // java.lang.Runnable public final void run() { this.f$0.b(this.f$1); } { this.f$0 = this; this.f$1 = z; } }); an anVar = this.V; if (anVar == null) { a(9); return; } if (this.Q) { anVar.d(false); } if (!z) { this.V.e(true); cg.o(); } this.O = false; if (z) { m(); return; } c(true); if (getActivity() != null) { getActivity().runOnUiThread(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda8 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.v(); } { this.f$0 = this; } }); } } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void b(final boolean z) { this.g.c(false, true); this.e.c(false, true); this.c.c(false, true); this.c.setVisibility(4); this.z.setVisibility(0); this.ac.postDelayed(new Runnable(this, z) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda6 public final bi f$0; public final boolean f$1; @Override // java.lang.Runnable public final void run() { this.f$0.i(this.f$1); } { this.f$0 = this; this.f$1 = z; } }, 100L); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void i(boolean z) { this.z.setVisibility(4); if (z) { return; } this.a.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(100L); this.N.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(100L); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void v() { this.g.c(true, true); this.e.c(true, true); } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: com.facetec.sdk.bi$2, reason: invalid class name */ /* loaded from: classes.dex */ public static final /* synthetic */ class AnonymousClass2 { static final int[] b; static final int[] c; static final int[] e; static { int[] iArr = new int[cf.values().length]; e = iArr; try { iArr[cf.KEEP_SCANNING.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { e[cf.END_SCAN.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { e[cf.PRESENT_MANUAL_CAPTURE_BUTTON.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } int[] iArr2 = new int[cc.values().length]; c = iArr2; try { iArr2[cc.ID_IMAGE_HOLD_STEADY.ordinal()] = 1; } catch (NoSuchFieldError unused4) { } try { c[cc.ID_IMAGE_FACE_NOT_FOUND.ordinal()] = 2; } catch (NoSuchFieldError unused5) { } try { c[cc.ID_IMAGE_BLURRY.ordinal()] = 3; } catch (NoSuchFieldError unused6) { } int[] iArr3 = new int[FaceTecCancelButtonCustomization.ButtonLocation.values().length]; b = iArr3; try { iArr3[FaceTecCancelButtonCustomization.ButtonLocation.TOP_LEFT.ordinal()] = 1; } catch (NoSuchFieldError unused7) { } try { b[FaceTecCancelButtonCustomization.ButtonLocation.TOP_RIGHT.ordinal()] = 2; } catch (NoSuchFieldError unused8) { } try { b[FaceTecCancelButtonCustomization.ButtonLocation.CUSTOM.ordinal()] = 3; } catch (NoSuchFieldError unused9) { } try { b[FaceTecCancelButtonCustomization.ButtonLocation.DISABLED.ordinal()] = 4; } catch (NoSuchFieldError unused10) { } } } /* JADX INFO: Access modifiers changed from: private */ public void c(cf cfVar, cc ccVar) { int i = AnonymousClass2.e[cfVar.ordinal()]; if (i == 1) { this.S = false; if (AnonymousClass2.c[ccVar.ordinal()] == 3 && this.ah) { this.V.b(true, (ViewGroup) this.E); return; } return; } if (i == 2) { if (this.S) { return; } this.S = true; a(true); return; } if (i == 3 && this.f6413o && this.c.getVisibility() != 0) { this.k = true; c(new Runnable(this) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda32 public final bi f$0; @Override // java.lang.Runnable public final void run() { this.f$0.p(); } { this.f$0 = this; } }); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void p() { this.c.setAlpha(BitmapDescriptorFactory.HUE_RED); this.c.setVisibility(0); this.c.animate().alpha(1.0f).setDuration(200L).setListener(null).start(); } private void a(int i) { k.a(new Throwable("FaceTec SDK has experienced an unexpected camera error.")); bg bgVar = this.U; if (bgVar == null) { return; } if (bgVar.r != null) { bg bgVar2 = this.U; bgVar2.d(bgVar2.r.getStatus(), FaceTecIDScanStatus.CAMERA_ERROR); t.a(this.U, com.facetec.sdk.d.CAMERA_ERROR, "IDScan: zoomCamera is null unexpectedly ".concat(String.valueOf(i))); } else { this.U.d(FaceTecSessionStatus.UNKNOWN_INTERNAL_ERROR, FaceTecIDScanStatus.CAMERA_ERROR); bg bgVar3 = this.U; com.facetec.sdk.d dVar = com.facetec.sdk.d.SESSION_RESULT_UNEXPECTED_NULL; StringBuilder sb = new StringBuilder("latestSessionResult is null unexpectedly. Check Activity State Info to see if session has finished"); sb.append(t.e((Activity) this.U)); t.a(bgVar3, dVar, sb.toString()); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void G() { cs csVar = this.aa; if (csVar != null) { csVar.e = true; csVar.d(); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void N() { this.Y.setVisibility(8); getFragmentManager().beginTransaction().remove(this.aa).commitAllowingStateLoss(); this.aa = null; i(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void K() { bg bgVar = this.U; if (bgVar != null) { bgVar.D(); } if (!this.Z) { i(); return; } boolean z = this.X; cs csVar = new cs(); this.aa = csVar; csVar.c = (cs.e) getActivity(); getChildFragmentManager().beginTransaction().replace(R.id.securingCameraFragmentContainer, this.aa).addToBackStack(null).commitAllowingStateLoss(); final int i = 0; this.Y.setVisibility(0); int i2 = 1; if (!z) { i = 800; } else { i2 = 500; } this.Y.animate().alpha(1.0f).setDuration(i2).setStartDelay(0L).setListener(null).withEndAction(new aq.e(this, new Runnable(this, i) { // from class: com.facetec.sdk.bi$$ExternalSyntheticLambda5 public final bi f$0; public final int f$1; @Override // java.lang.Runnable public final void run() { this.f$0.e(this.f$1); } { this.f$0 = this; this.f$1 = i; } })); } @Override // com.facetec.sdk.aq, android.app.Fragment public final void onCreate(Bundle bundle) { super.onCreate(bundle); } /* JADX INFO: Access modifiers changed from: package-private */ public final void e(boolean z) { this.X = z; } /* JADX INFO: Access modifiers changed from: package-private */ public final void d(boolean z) { this.Z = z; } /* JADX INFO: Access modifiers changed from: package-private */ public final ah a() { return this.V; } }