package com.facetec.sdk; import android.animation.Animator; import android.content.Context; import android.os.Handler; import android.util.AttributeSet; import android.view.View; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import android.widget.LinearLayout; import android.widget.TextView; import com.facetec.sdk.FaceTecVocalGuidanceCustomization; import com.facetec.sdk.dp; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.prolificinteractive.materialcalendarview.TitleChanger; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes.dex */ public class cp extends LinearLayout { TextView a; ce b; cj c; View d; int e; boolean f; Animator g; Animator h; Handler i; final e j; private final int k; private Animation m; public cp(Context context, AttributeSet attributeSet) { super(context, attributeSet); this.k = TitleChanger.DEFAULT_ANIMATION_DELAY; this.b = ce.FACE_NOT_FOUND; this.c = cj.FRAME_YOUR_FACE; this.e = 0; this.f = false; this.j = new e(this) { // from class: com.facetec.sdk.cp$$ExternalSyntheticLambda2 public final cp f$0; @Override // android.animation.Animator.AnimatorListener public final void onAnimationEnd(Animator animator) { this.f$0.a(animator); } { this.f$0 = this; } }; } public final void c() { final int i = 500; postDelayed(new Runnable(this, i) { // from class: com.facetec.sdk.cp$$ExternalSyntheticLambda3 public final cp f$0; public final int f$1; @Override // java.lang.Runnable public final void run() { this.f$0.a(this.f$1); } { this.f$0 = this; this.f$1 = i; } }, 50L); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void a(int i) { float y = getY(); setVisibility(0); setAlpha(BitmapDescriptorFactory.HUE_RED); setY(y - (this.d.getHeight() / 2)); animate().setDuration(i).alpha(1.0f).y(y).setListener(null).start(); } public final void b() { if (this.e == R.string.FaceTec_feedback_move_phone_closer) { ScaleAnimation scaleAnimation = new ScaleAnimation(1.0f, 1.15f, 1.0f, 1.15f, 1, 0.5f, 1, 0.5f); this.m = scaleAnimation; scaleAnimation.setDuration(800L); this.m.setRepeatMode(2); this.m.setRepeatCount(-1); this.a.startAnimation(this.m); if (FaceTecSDK.c.vocalGuidanceCustomization.mode == FaceTecVocalGuidanceCustomization.VocalGuidanceMode.FULL_VOCAL_GUIDANCE || FaceTecSDK.c.vocalGuidanceCustomization.mode == FaceTecVocalGuidanceCustomization.VocalGuidanceMode.NO_VOCAL_GUIDANCE) { return; } Handler handler = new Handler(); this.i = handler; handler.postDelayed(new Runnable(this) { // from class: com.facetec.sdk.cp$$ExternalSyntheticLambda1 public final cp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.e(); } { this.f$0 = this; } }, 1000L); } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void e() { if (dp.e || this.e != R.string.FaceTec_feedback_move_phone_closer) { return; } dp.b(getContext(), dp.b.FACE_CAPTURE_MOVE_CLOSER_DELAYED); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void a(Animator animator) { cx.e(this.a, this.e); Animation animation = this.m; if (animation != null) { animation.cancel(); this.m = null; this.a.setScaleX(1.0f); this.a.setScaleY(1.0f); } this.g.start(); } /* JADX INFO: Access modifiers changed from: package-private */ public final void e(int i) { if (this.f || i == this.e) { return; } this.e = i; this.f = true; dp.e(i); this.h.start(); postDelayed(new Runnable(this) { // from class: com.facetec.sdk.cp$$ExternalSyntheticLambda0 public final cp f$0; @Override // java.lang.Runnable public final void run() { this.f$0.d(); } { this.f$0 = this; } }, 800L); } /* JADX INFO: Access modifiers changed from: package-private */ public static int c(cj cjVar) { switch (AnonymousClass1.b[cjVar.ordinal()]) { case 1: return R.string.FaceTec_presession_frame_your_face; case 2: return R.string.FaceTec_presession_frame_your_face; case 3: return R.string.FaceTec_presession_remove_dark_glasses; case 4: return R.string.FaceTec_presession_position_face_straight_in_oval; case 5: return R.string.FaceTec_presession_conditions_too_bright; case 6: return R.string.FaceTec_presession_brighten_your_environment; case 7: return R.string.FaceTec_presession_neutral_expression; case 8: return R.string.FaceTec_presession_hold_steady_3; case 9: return R.string.FaceTec_presession_hold_steady_2; case 10: return R.string.FaceTec_presession_hold_steady_1; case 11: return R.string.FaceTec_feedback_move_phone_closer; case 12: return R.string.FaceTec_feedback_move_phone_away; default: return R.string.FaceTec_presession_frame_your_face; } } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: com.facetec.sdk.cp$1, reason: invalid class name */ /* loaded from: classes.dex */ public static final /* synthetic */ class AnonymousClass1 { static final int[] a; static final int[] b; static { int[] iArr = new int[ce.values().length]; a = iArr; try { iArr[ce.HOLD_STEADY.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { a[ce.FACE_NOT_FOUND.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { a[ce.MOVE_FACE_CLOSER.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { a[ce.MOVE_FACE_EVEN_CLOSER.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } try { a[ce.MOVE_FACE_FURTHER_AWAY.ordinal()] = 5; } catch (NoSuchFieldError unused5) { } try { a[ce.MOVE_FACE_AWAY_A_LITTLE.ordinal()] = 6; } catch (NoSuchFieldError unused6) { } try { a[ce.FACE_CENTERED_TOO_FAR_TOP.ordinal()] = 7; } catch (NoSuchFieldError unused7) { } try { a[ce.FACE_CENTERED_TOO_FAR_BOTTOM.ordinal()] = 8; } catch (NoSuchFieldError unused8) { } try { a[ce.FACE_CENTERED_TOO_FAR_LEFT.ordinal()] = 9; } catch (NoSuchFieldError unused9) { } try { a[ce.FACE_CENTERED_TOO_FAR_RIGHT.ordinal()] = 10; } catch (NoSuchFieldError unused10) { } try { a[ce.FACE_ROTATED_TOO_FAR_LEFT.ordinal()] = 11; } catch (NoSuchFieldError unused11) { } try { a[ce.FACE_ROTATED_TOO_FAR_RIGHT.ordinal()] = 12; } catch (NoSuchFieldError unused12) { } try { a[ce.MOVE_PHONE_TO_EYE_LEVEL.ordinal()] = 13; } catch (NoSuchFieldError unused13) { } try { a[ce.FACE_LOOKING_TOO_FAR_LEFT.ordinal()] = 14; } catch (NoSuchFieldError unused14) { } try { a[ce.FACE_LOOKING_TOO_FAR_RIGHT.ordinal()] = 15; } catch (NoSuchFieldError unused15) { } try { a[ce.FACE_NOT_LOOKING_STRAIGHT_AHEAD.ordinal()] = 16; } catch (NoSuchFieldError unused16) { } try { a[ce.USE_EVEN_LIGHTING.ordinal()] = 17; } catch (NoSuchFieldError unused17) { } int[] iArr2 = new int[cj.values().length]; b = iArr2; try { iArr2[cj.NONE.ordinal()] = 1; } catch (NoSuchFieldError unused18) { } try { b[cj.FRAME_YOUR_FACE.ordinal()] = 2; } catch (NoSuchFieldError unused19) { } try { b[cj.WEARING_SUNGLASSES.ordinal()] = 3; } catch (NoSuchFieldError unused20) { } try { b[cj.BAD_POSE.ordinal()] = 4; } catch (NoSuchFieldError unused21) { } try { b[cj.TOO_BRIGHT.ordinal()] = 5; } catch (NoSuchFieldError unused22) { } try { b[cj.TOO_DARK.ordinal()] = 6; } catch (NoSuchFieldError unused23) { } try { b[cj.MAKING_FACE.ordinal()] = 7; } catch (NoSuchFieldError unused24) { } try { b[cj.HOLD_STEADY_3.ordinal()] = 8; } catch (NoSuchFieldError unused25) { } try { b[cj.HOLD_STEADY_2.ordinal()] = 9; } catch (NoSuchFieldError unused26) { } try { b[cj.HOLD_STEADY_1.ordinal()] = 10; } catch (NoSuchFieldError unused27) { } try { b[cj.MOVE_CLOSER.ordinal()] = 11; } catch (NoSuchFieldError unused28) { } try { b[cj.MOVE_AWAY.ordinal()] = 12; } catch (NoSuchFieldError unused29) { } } } /* JADX INFO: Access modifiers changed from: package-private */ public static int c(ce ceVar) { boolean e = dp.e(); switch (AnonymousClass1.a[ceVar.ordinal()]) { case 1: return R.string.FaceTec_feedback_hold_steady; case 2: return e ? R.string.FaceTec_accessibility_feedback_face_not_on_camera : R.string.FaceTec_feedback_face_not_found; case 3: return e ? R.string.FaceTec_accessibility_feedback_move_phone_closer : R.string.FaceTec_feedback_move_phone_closer; case 4: return e ? R.string.FaceTec_accessibility_feedback_move_phone_closer : R.string.FaceTec_feedback_move_phone_closer; case 5: return e ? R.string.FaceTec_accessibility_feedback_move_phone_away : R.string.FaceTec_feedback_move_phone_away; case 6: return e ? R.string.FaceTec_accessibility_feedback_move_phone_away : R.string.FaceTec_feedback_move_phone_away; case 7: return e ? R.string.FaceTec_accessibility_feedback_face_too_high : R.string.FaceTec_feedback_center_face; case 8: return e ? R.string.FaceTec_accessibility_feedback_face_too_low : R.string.FaceTec_feedback_center_face; case 9: return e ? R.string.FaceTec_accessibility_feedback_face_too_far_left : R.string.FaceTec_feedback_center_face; case 10: return e ? R.string.FaceTec_accessibility_feedback_face_too_far_right : R.string.FaceTec_feedback_center_face; case 11: return e ? R.string.FaceTec_accessibility_feedback_face_rotated_too_far_left : R.string.FaceTec_feedback_face_not_upright; case 12: return e ? R.string.FaceTec_accessibility_feedback_face_rotated_too_far_right : R.string.FaceTec_feedback_face_not_upright; case 13: return e ? R.string.FaceTec_accessibility_feedback_hold_device_to_eye_level : R.string.FaceTec_feedback_move_phone_to_eye_level; case 14: return e ? R.string.FaceTec_accessibility_feedback_face_pointing_too_far_left : R.string.FaceTec_feedback_face_not_looking_straight_ahead; case 15: return e ? R.string.FaceTec_accessibility_feedback_face_pointing_too_far_right : R.string.FaceTec_feedback_face_not_looking_straight_ahead; case 16: return R.string.FaceTec_feedback_face_not_looking_straight_ahead; case 17: return R.string.FaceTec_feedback_use_even_lighting; default: return R.string.FaceTec_feedback_face_not_found; } } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void d() { this.f = false; } }