package com.facetec.sdk; import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.util.Property; 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.be; import com.facetec.sdk.dp; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import o.nMh; /* loaded from: classes.dex */ public final class bp extends bb { static boolean k = false; private be.a l; private Handler m; /* renamed from: o, reason: collision with root package name */ private Handler f6415o; private GuidanceCenterContentFragment r; private GuidanceCenterContentFragment t; private int n = 0; private final Runnable s = new Runnable(this) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda0 public final bp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.C(); } { this.f$0 = this; } }; /* JADX INFO: Access modifiers changed from: private */ public static /* synthetic */ void q() { } /* JADX INFO: Access modifiers changed from: protected */ @Override // com.facetec.sdk.bb public final void c() { } @Override // com.facetec.sdk.bb protected final boolean f() { return true; } @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 onViewCreated(View view, Bundle bundle) { super.onViewCreated(view, bundle); } /* JADX INFO: Access modifiers changed from: package-private */ public static bp c(be.a aVar, boolean z) { bp bpVar = new bp(); Bundle bundle = new Bundle(); bundle.putInt("PERMISSION_STATUS", aVar.ordinal()); bundle.putBoolean("IDSCAN_ONLY_MODE", z); bpVar.setArguments(bundle); k = false; return bpVar; } @Override // com.facetec.sdk.bb, com.facetec.sdk.aq, android.app.Fragment public final void onCreate(Bundle bundle) { super.onCreate(bundle); this.l = be.a.values()[getArguments().getInt("PERMISSION_STATUS")]; this.f = getArguments().getBoolean("IDSCAN_ONLY_MODE"); t(); boolean z = this.l == be.a.NOT_GRANTED; GuidanceCenterContentFragment guidanceCenterContentFragment = new GuidanceCenterContentFragment(); Bundle bundle2 = new Bundle(); bundle2.putSerializable("screenType", GuidanceCenterContentFragment.ScreenType.GENERIC); bundle2.putSerializable("isCameraPermissionsShowing", Boolean.valueOf(z)); if (z) { bundle2.putInt("header", R.string.FaceTec_camera_permission_header); } guidanceCenterContentFragment.setArguments(bundle2); this.r = guidanceCenterContentFragment; int i = R.string.FaceTec_instructions_header_ready_1; int i2 = R.string.FaceTec_instructions_message_ready_2; GuidanceCenterContentFragment.ScreenType screenType = GuidanceCenterContentFragment.ScreenType.READY_OVAL; GuidanceCenterContentFragment guidanceCenterContentFragment2 = new GuidanceCenterContentFragment(); Bundle bundle3 = new Bundle(); bundle3.putInt("header", i); bundle3.putInt("message", i2); bundle3.putSerializable("screenType", screenType); guidanceCenterContentFragment2.setArguments(bundle3); this.t = guidanceCenterContentFragment2; } /* JADX INFO: Access modifiers changed from: package-private */ @Override // com.facetec.sdk.bb public final void o() { super.o(); this.d.setVisibility(4); } @Override // com.facetec.sdk.bb protected final void a() { t.e = ak.n; this.h.setVisibility(8); d(this.r); if (this.m == null) { this.m = new Handler(); } this.m.post(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda12 public final bp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.z(); } { this.f$0 = this; } })); } private void l() { Handler handler = this.f6415o; if (handler != null) { handler.removeCallbacksAndMessages(null); this.f6415o = null; } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void C() { dp.b(j(), dp.b.GET_READY_PRESS_BUTTON_DELAYED); } private void s() { Handler handler = this.m; if (handler != null) { handler.removeCallbacksAndMessages(null); this.m = null; } } private void t() { if (this.m == null) { this.m = new Handler(); } this.m.postDelayed(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda5 public final bp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.B(); } { this.f$0 = this; } }), 600000L); } private void e(boolean z) { this.b.c(db.aU(), 1000, 500); if (z) { this.a.animate().alpha(1.0f).setDuration(500L).setListener(null).withEndAction(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda13 public final bp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.A(); } { this.f$0 = this; } })).start(); this.n++; } else { cx.e(this.c, R.string.FaceTec_action_im_ready); } this.e.setEnabled(true); b(true); b(true, 500, 0); if (dp.e()) { this.c.c(true, false); } else { this.c.c(false, true); new Handler().postDelayed(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda1 public final bp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.D(); } { this.f$0 = this; } }), 4500L); } if (FaceTecSDK.c.vocalGuidanceCustomization.mode == FaceTecVocalGuidanceCustomization.VocalGuidanceMode.FULL_VOCAL_GUIDANCE) { dp.b(j(), dp.b.GET_READY_FRAME_YOUR_FACE_AUTOMATIC); Handler handler = new Handler(); this.f6415o = handler; handler.postDelayed(this.s, 4500L); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void A() { if (this.t == null || !isAdded()) { return; } d(this.t); this.b.d(); cx.e(this.c, R.string.FaceTec_action_im_ready); this.a.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(500L).setListener(new e(this) { // from class: com.facetec.sdk.bp.4 private bp c; { this.c = this; } @Override // android.animation.Animator.AnimatorListener public final void onAnimationEnd(Animator animator) { bp.b(this.c); } }).start(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void D() { this.i = true; if (this.c.isEnabled()) { return; } this.c.c(true, true); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void w() { this.e.setImportantForAccessibility(1); } /* JADX INFO: Access modifiers changed from: package-private */ public final void k() { t(); this.l = be.a.GRANTED; final bg h = h(); if (h != null && this.f) { final aq.e eVar = new aq.e(this, new Runnable(h) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda3 public final bg f$0; @Override // java.lang.Runnable public final void run() { this.f$0.u(); } { this.f$0 = h; } }); c(new Runnable(this, eVar) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda4 public final bp f$0; public final Runnable f$1; @Override // java.lang.Runnable public final void run() { this.f$0.e(this.f$1); } { this.f$0 = this; this.f$1 = eVar; } }); } else { c(true); } } private void c(boolean z) { if (this.c == null) { return; } this.t = GuidanceCenterContentFragment.a(R.string.FaceTec_instructions_header_ready_1, R.string.FaceTec_instructions_message_ready_2, GuidanceCenterContentFragment.ScreenType.READY_OVAL, this.b.i().top, this.b.i().bottom, 0); if (z) { c((Context) getActivity(), false); db.c(this.c, FaceTecSDK.c.f.buttonTextNormalColor); } else { this.c.animate().alpha(1.0f).setDuration(500L).setListener(null).start(); this.c.setEnabled(false); d(this.t); this.b.d.setAlpha(255); this.b.d(); a(new Runnable(this) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda2 public final bp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.u(); } { this.f$0 = this; } }, 1000L); } this.n = 2; e(z); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void u() { if (this.b != null) { this.b.a(); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void e(Runnable runnable) { c(runnable, 500); } private boolean p() { return this.l != be.a.GRANTED; } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void y() { cx.e(this.c, R.string.FaceTec_action_im_ready); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void x() { this.e.setEnabled(true); b(true); this.c.c(true, true); } private void d(GuidanceCenterContentFragment guidanceCenterContentFragment) { getFragmentManager().beginTransaction().setCustomAnimations(R.animator.facetec_no_delay_fade_in, 0).replace(R.id.centerContentFrameLayout, guidanceCenterContentFragment).commitAllowingStateLoss(); } @Override // com.facetec.sdk.bb, android.app.Fragment public final void onPause() { super.onPause(); s(); l(); } @Override // com.facetec.sdk.bb, android.app.Fragment public final void onDestroy() { super.onDestroy(); this.r = null; this.t = null; } @Override // com.facetec.sdk.bb protected final void d() { s(); l(); this.g = null; be j = j(); if (j == null) { return; } if (p()) { j.r(); } else { j.s(); } } @Override // com.facetec.sdk.bb protected final void e() { this.e.setImportantForAccessibility(2); if ((this.t != null) & isAdded()) { GuidanceCenterContentFragment guidanceCenterContentFragment = this.t; if (guidanceCenterContentFragment.f != null) { guidanceCenterContentFragment.f.setImportantForAccessibility(2); } if (guidanceCenterContentFragment.g != null) { guidanceCenterContentFragment.g.setImportantForAccessibility(2); } } be j = j(); if (j == null) { return; } if (p()) { j.c(); } else { this.c.c(false, true); this.c.setVisibility(4); k = true; s(); l(); c(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda8 public final bp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.v(); } { this.f$0 = this; } }), 300); } m(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void v() { be j = j(); if (j != null) { j.n(); t.a(j, d.GET_READY_IM_READY_PRESSED, (String) null); } } /* JADX INFO: Access modifiers changed from: protected */ @Override // com.facetec.sdk.bb public final void n() { be j = j(); if (j == null) { return; } if (!p()) { if (this.n >= 2) { super.n(); } else { Handler handler = new Handler(); int i = this.n; if (i == 0) { this.n = i + 1; } if (this.n == 1) { getFragmentManager().beginTransaction().setCustomAnimations(R.anim.facetec_slide_in_left, R.anim.facetec_slide_out_left).replace(R.id.centerContentFrameLayout, this.t, "centerContentFrameLayout").commitAllowingStateLoss(); this.b.b(); handler.postDelayed(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda9 public final bp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.y(); } { this.f$0 = this; } }), 900L); } handler.postDelayed(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda10 public final bp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.x(); } { this.f$0 = this; } }), 900L); } this.n++; } else if (this.l == be.a.NOT_GRANTED) { s(); j.c(); } else { Intent intent = new Intent(); intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); intent.setData(Uri.fromParts("package", j.getPackageName(), null)); j.startActivity(intent); j.r(); } m(); } @Override // com.facetec.sdk.bb protected final void b() { new Handler().post(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda11 public final bp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.r(); } { this.f$0 = this; } })); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void r() { this.b.e(); GuidanceCenterContentFragment guidanceCenterContentFragment = this.t; if (guidanceCenterContentFragment != null) { guidanceCenterContentFragment.b(true); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void B() { this.c.c(false, true); this.e.setEnabled(false); b(false); be j = j(); if (j != null) { if (p()) { j.r(); } else { j.h(); } } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void z() { bg h = h(); if (h != null) { if (p()) { this.c.setImportantForAccessibility(1); this.e.setImportantForAccessibility(1); this.e.setImportantForAccessibility(2); getActivity(); if (db.aR() != 0) { ImageView imageView = this.r.c; Activity activity = getActivity(); getActivity(); imageView.setImageDrawable(nMh.getDrawable(activity, db.aR())); this.r.c.setVisibility(0); } else { this.r.c.setVisibility(8); } this.r.d.setVisibility(0); cx.e(this.r.b, R.string.FaceTec_camera_permission_header); GuidanceCenterContentFragment guidanceCenterContentFragment = this.r; int i = R.string.FaceTec_camera_permission_message_enroll; String[] split = cx.d(i).split("\n\n"); if (split.length == 2) { guidanceCenterContentFragment.e.setText(split[0]); guidanceCenterContentFragment.a.setText(split[1]); guidanceCenterContentFragment.a.setVisibility(0); } else { cx.e(guidanceCenterContentFragment.e, i); guidanceCenterContentFragment.a.setVisibility(8); } if (this.l == be.a.NOT_GRANTED) { cx.e(this.c, R.string.FaceTec_camera_permission_enable_camera); } else { cx.e(this.c, R.string.FaceTec_camera_permission_launch_settings); } this.r.b.setVisibility(0); this.r.e.setVisibility(0); this.c.animate().alpha(1.0f).setDuration(500L).setListener(null).start(); this.c.setEnabled(true); if (!FaceTecSDK.c.k.hideForCameraPermissions) { b(true, 500, 0); } bg h2 = h(); if (h2 != null) { h2.j = true; } new Handler().postDelayed(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda6 public final bp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.w(); } { this.f$0 = this; } }), 1000L); t.e(ct.CAMERA_PERMISSION); h.D(); } else if (!this.f) { c(false); h.D(); } else { s(); l(); c(new Runnable() { // from class: com.facetec.sdk.bp$$ExternalSyntheticLambda7 @Override // java.lang.Runnable public final void run() { bp.q(); } }, 300); h.u(); return; } this.d.setVisibility(0); ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.d, (Property) View.ALPHA, BitmapDescriptorFactory.HUE_RED, 1.0f); AnimatorSet animatorSet = new AnimatorSet(); animatorSet.setDuration(500L); animatorSet.play(ofFloat); animatorSet.start(); t.e(ct.INITIAL_FACE_SCAN_GET_READY); t.a(j(), d.GET_READY_IM_READY_SHOWN_AND_READY, (String) null); } } static /* synthetic */ void b(bp bpVar) { if (bpVar.c == null || bpVar.e == null) { return; } bpVar.c.setImportantForAccessibility(1); bpVar.e.setImportantForAccessibility(1); bpVar.c.setAccessibilityTraversalBefore(bpVar.e.getId()); } }