package com.facetec.sdk; import android.animation.Animator; import android.graphics.RectF; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.facetec.sdk.FaceTecVocalGuidanceCustomization; import com.facetec.sdk.GuidanceCenterContentFragment; import com.facetec.sdk.aq; import com.facetec.sdk.dp; import com.google.android.gms.maps.model.BitmapDescriptorFactory; /* loaded from: classes.dex */ public final class cn extends bb { static boolean n = false; private GuidanceCenterContentFragment k; cu m; /* renamed from: o, reason: collision with root package name */ private Handler f6423o; int l = 0; private int r = 500; private int p = 300; @Override // com.facetec.sdk.bb, android.app.Fragment public final /* bridge */ /* synthetic */ Animator onCreateAnimator(int i, boolean z, int i2) { return super.onCreateAnimator(i, z, i2); } @Override // com.facetec.sdk.bb, android.app.Fragment public final /* bridge */ /* synthetic */ View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { return super.onCreateView(layoutInflater, viewGroup, bundle); } @Override // com.facetec.sdk.bb, android.app.Fragment public final /* bridge */ /* synthetic */ void onDestroy() { super.onDestroy(); } @Override // com.facetec.sdk.bb, android.app.Fragment public final /* bridge */ /* synthetic */ void onViewCreated(View view, Bundle bundle) { super.onViewCreated(view, bundle); } /* JADX INFO: Access modifiers changed from: package-private */ public static cn l() { cn cnVar = new cn(); cnVar.setArguments(new Bundle()); n = false; cnVar.j = true; return cnVar; } @Override // com.facetec.sdk.bb, com.facetec.sdk.aq, android.app.Fragment public final void onCreate(Bundle bundle) { super.onCreate(bundle); Handler handler = new Handler(); this.f6423o = handler; handler.postDelayed(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda12 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.L(); } { this.f$0 = this; } }), 600000L); if (cg.A().length != 0) { t.e = ak.f6404o; this.m = new cu(); getFragmentManager().beginTransaction().setCustomAnimations(R.animator.facetec_no_delay_fade_in, 0).add(R.id.centerContentFrameLayout, this.m).commitAllowingStateLoss(); t.e(ct.RETRY_SIDE_BY_SIDE); return; } t.e = ak.n; this.l = 1; t.e(ct.RETRY_GET_READY); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void L() { be j = j(); if (j != null) { j.k(); } } @Override // com.facetec.sdk.bb, android.app.Fragment public final void onPause() { super.onPause(); r(); y(); } @Override // com.facetec.sdk.bb protected final void a() { be j = j(); if (j != null && FaceTecSDK.c.vocalGuidanceCustomization.mode == FaceTecVocalGuidanceCustomization.VocalGuidanceMode.FULL_VOCAL_GUIDANCE) { dp.b(j, dp.b.RETRY); } cu cuVar = this.m; if (cuVar != null) { cuVar.d.setAlpha(BitmapDescriptorFactory.HUE_RED); cuVar.b.setAlpha(BitmapDescriptorFactory.HUE_RED); cuVar.c.setAlpha(BitmapDescriptorFactory.HUE_RED); cuVar.a.setAlpha(BitmapDescriptorFactory.HUE_RED); cuVar.h.setAlpha(BitmapDescriptorFactory.HUE_RED); cuVar.f.setAlpha(BitmapDescriptorFactory.HUE_RED); this.c.setVisibility(4); this.c.setAlpha(BitmapDescriptorFactory.HUE_RED); } this.h.setVisibility(8); this.c.setEnabled(false); this.e.setEnabled(false); b(false); this.b.c(db.aU(), 0, 0); if (this.f6423o == null) { Handler handler = new Handler(); this.f6423o = handler; handler.postDelayed(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda5 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.N(); } { this.f$0 = this; } }), 600000L); } c(new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda6 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.z(); } { this.f$0 = this; } }); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void N() { be j = j(); if (j != null) { j.k(); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void z() { bg h = h(); if (h != null) { h.D(); } RectF i = this.b.i(); this.k = GuidanceCenterContentFragment.a(R.string.FaceTec_instructions_header_ready_1, R.string.FaceTec_instructions_message_ready_2, GuidanceCenterContentFragment.ScreenType.READY_OVAL, i.top, i.bottom, this.c.getId()); if (this.l != 1) { if (this.m == null) { return; } cx.e(this.c, R.string.FaceTec_action_try_again); this.m.d(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda10 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.E(); } { this.f$0 = this; } })); return; } getFragmentManager().beginTransaction().setCustomAnimations(R.animator.facetec_no_delay_fade_in, 0).replace(R.id.centerContentFrameLayout, this.k).commitAllowingStateLoss(); cx.e(this.c, R.string.FaceTec_action_im_ready); this.b.d.setAlpha(255); this.b.d(); a(new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda0 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.K(); } { this.f$0 = this; } }, 500L); this.c.setAlpha(BitmapDescriptorFactory.HUE_RED); this.c.setVisibility(0); this.c.animate().alpha(1.0f).setDuration(500L).setStartDelay(300L).setListener(null).withEndAction(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda9 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.H(); } { this.f$0 = this; } })).start(); b(true, 500, 300); if (dp.e()) { this.c.setEnabled(true); } else { t(); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void K() { this.b.a(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void H() { e(new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda1 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.J(); } { this.f$0 = this; } }, 300L); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void J() { if (h() != null) { A(); this.e.setEnabled(true); b(true); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void F() { if (db.aO().length != 0) { e(new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda16 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.G(); } { this.f$0 = this; } }, 10L); } e(new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda17 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.I(); } { this.f$0 = this; } }, 300L); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void G() { cw cwVar = this.m.i; if (cwVar.a.length != 0) { cwVar.e = 0; cwVar.c = true; cwVar.a(); cwVar.h(); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void I() { if (h() != null) { this.c.c(true, true); this.e.setEnabled(true); b(true); } } @Override // com.facetec.sdk.bb protected final void d() { if (this.l == 0) { q(); cg.V(); this.l++; } else { be j = j(); if (j != null) { j.o(); } r(); y(); } } /* JADX INFO: Access modifiers changed from: private */ /* renamed from: p, reason: merged with bridge method [inline-methods] */ public void A() { this.c.setImportantForAccessibility(1); this.e.setImportantForAccessibility(1); this.c.setAccessibilityTraversalAfter(this.e.getId()); } private void q() { this.c.setAccessibilityTraversalBefore(this.e.getId()); if (dp.e()) { this.c.c(true, false); } else { t(); } b(false, 500, 0); this.c.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(500L).setStartDelay(0L).setListener(null).start(); e(new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda7 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.C(); } { this.f$0 = this; } }, 800L); t.e = ak.n; e(this.k); a(new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda8 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.A(); } { this.f$0 = this; } }, 1000L); this.b.b(); t.a(j(), d.GET_READY_IM_READY_SHOWN_AND_READY_RETRY, (String) null); t.e(ct.RETRY_GET_READY); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void C() { cx.e(this.c, R.string.FaceTec_action_im_ready); this.c.animate().alpha(1.0f).setDuration(500L).setStartDelay(0L).setListener(null).start(); b(true, 500, 0); e(new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda11 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.D(); } { this.f$0 = this; } }, 500L); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void D() { this.e.setEnabled(true); b(true); } private void t() { new Handler().postDelayed(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda15 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.B(); } { this.f$0 = this; } }), 4500L); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void B() { this.i = true; if (this.c.isEnabled()) { return; } this.c.c(true, true); } @Override // com.facetec.sdk.bb protected final void e() { y(); if (this.l == 0) { q(); cg.V(); if (FaceTecSDK.c.vocalGuidanceCustomization.mode == FaceTecVocalGuidanceCustomization.VocalGuidanceMode.FULL_VOCAL_GUIDANCE) { dp.b(j(), dp.b.GET_READY_FRAME_YOUR_FACE_AUTOMATIC); } e(new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda2 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.v(); } { this.f$0 = this; } }, 1300L); } else { n = true; r(); c(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda3 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.u(); } { this.f$0 = this; } }), 1000); } this.l++; } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void v() { m(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void u() { be j = j(); if (j != null) { j.m(); t.a(j, d.GET_READY_IM_READY_PRESSED_RETY, (String) null); } m(); } public final void s() { if (this.f6423o == null) { this.f6423o = new Handler(); } this.f6423o.postDelayed(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda14 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.x(); } { this.f$0 = this; } }), 600000L); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void x() { be j = j(); if (j != null) { j.k(); } } private void r() { Handler handler = this.f6423o; if (handler != null) { handler.removeCallbacksAndMessages(null); this.f6423o = null; } } private void y() { cu cuVar = this.m; if (cuVar == null || cuVar.i == null) { return; } this.m.i.e(); } private void e(GuidanceCenterContentFragment guidanceCenterContentFragment) { if (guidanceCenterContentFragment == null) { return; } getFragmentManager().beginTransaction().setCustomAnimations(R.anim.facetec_slide_in_left, R.anim.facetec_slide_out_left).replace(R.id.centerContentFrameLayout, guidanceCenterContentFragment, "centerContentFrameLayout").commitAllowingStateLoss(); } @Override // com.facetec.sdk.bb protected final void b() { c(new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda4 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.w(); } { this.f$0 = this; } }); this.b.e(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void w() { cu cuVar = this.m; if (cuVar != null) { cuVar.a(); return; } GuidanceCenterContentFragment guidanceCenterContentFragment = this.k; if (guidanceCenterContentFragment != null) { guidanceCenterContentFragment.b(false); } } /* JADX INFO: Access modifiers changed from: protected */ @Override // com.facetec.sdk.bb public final void c() { ImageView g = g(); if (g == null || !g.isEnabled() || n) { return; } d(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void E() { this.m.e().setImportantForAccessibility(1); if (Build.VERSION.SDK_INT >= 28) { this.m.e().setAccessibilityHeading(true); } this.c.setImportantForAccessibility(1); this.e.setImportantForAccessibility(1); if (Build.VERSION.SDK_INT >= 28) { this.m.e().setScreenReaderFocusable(true); } this.c.setAccessibilityTraversalBefore(this.e.getId()); this.m.e().sendAccessibilityEvent(8); this.c.setAlpha(BitmapDescriptorFactory.HUE_RED); this.c.setVisibility(0); this.c.animate().alpha(1.0f).setDuration(500L).setStartDelay(300L).setListener(null).withEndAction(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.cn$$ExternalSyntheticLambda13 public final cn f$0; @Override // java.lang.Runnable public final void run() { this.f$0.F(); } { this.f$0 = this; } })).start(); b(true, 500, 300); } public final boolean k() { return this.l == 1; } @Override // com.facetec.sdk.bb protected final boolean f() { return this.l == 1; } }