what-the-bank/sources/com/facetec/sdk/cu.java

605 lines
25 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.facetec.sdk;
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.PorterDuff;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.facetec.sdk.aq;
import com.facetec.sdk.av;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import java.util.Locale;
import o.Etv;
import o.OSd;
import org.json.JSONObject;
/* loaded from: classes.dex */
public final class cu extends aq {
LinearLayout a;
TextView b;
LinearLayout c;
TextView d;
ImageView e;
TextView f;
Bitmap g;
TextView h;
cw i;
private ImageView j;
private LinearLayout k;
private ImageView l;
private ImageView m;
private ImageView n;
/* renamed from: o, reason: collision with root package name */
private LinearLayout f6428o;
private Etv p;
private LinearLayout q;
private TextView r;
private TextView s;
private TextView t;
private GradientDrawable u;
private boolean x = false;
@Override // android.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
return layoutInflater.inflate(R.layout.facetec_retry_screen_center_content_fragment, viewGroup, false);
}
@Override // android.app.Fragment
public final void onViewCreated(View view, Bundle bundle) {
super.onViewCreated(view, bundle);
this.f6428o = (LinearLayout) view.findViewById(R.id.contentLayout);
this.d = (TextView) view.findViewById(R.id.headerTextView);
this.b = (TextView) view.findViewById(R.id.messageTextView);
this.h = (TextView) view.findViewById(R.id.instructionMessage1TextView);
this.f = (TextView) view.findViewById(R.id.instructionMessage2TextView);
this.t = (TextView) view.findViewById(R.id.yourZoomSubimageTextView);
this.s = (TextView) view.findViewById(R.id.idealZoomSubimageTextView);
this.e = (ImageView) view.findViewById(R.id.yourZoomImage);
this.l = (ImageView) view.findViewById(R.id.idealZoomImage);
this.n = (ImageView) view.findViewById(R.id.idealZoomImageBorder);
this.j = (ImageView) view.findViewById(R.id.yourZoomImageBorder);
this.m = (ImageView) view.findViewById(R.id.idealOval);
this.i = (cw) view.findViewById(R.id.idealImageSlideshowView);
this.r = (TextView) view.findViewById(R.id.cancelButtonSpacer);
this.a = (LinearLayout) view.findViewById(R.id.idealZoomLayout);
this.c = (LinearLayout) view.findViewById(R.id.yourZoomLayout);
this.q = (LinearLayout) view.findViewById(R.id.sideBySideLayout);
this.k = (LinearLayout) view.findViewById(R.id.headerAndSubheaderLayout);
this.b.setImportantForAccessibility(1);
this.h.setImportantForAccessibility(1);
this.f.setImportantForAccessibility(1);
this.b.setAccessibilityTraversalAfter(this.d.getId());
this.h.setAccessibilityTraversalAfter(this.b.getId());
this.f.setAccessibilityTraversalAfter(this.h.getId());
if (db.aO().length != 0) {
this.l.setVisibility(4);
}
db.d(this.d, db.d(true, false));
db.d(this.b, db.j(true, false));
String a = db.a(true);
String d = db.d(true);
int i = AnonymousClass2.e[cg.l().ordinal()];
if (i == 2) {
this.h.setVisibility(8);
a = "";
} else {
if (i != 3) {
if (i == 4) {
a = db.c(true);
}
}
this.f.setVisibility(8);
d = "";
}
this.h.setText(a);
this.f.setText(d);
this.t.setText(db.b(true));
this.s.setText(db.e(true));
this.t.setImportantForAccessibility(2);
this.s.setImportantForAccessibility(2);
this.c.setImportantForAccessibility(1);
this.c.setContentDescription(this.t.getText());
this.a.setImportantForAccessibility(1);
this.a.setContentDescription(this.s.getText());
this.d.setTypeface(db.N());
this.b.setTypeface(db.E());
this.h.setTypeface(db.L());
this.f.setTypeface(db.L());
this.t.setTypeface(db.L());
this.s.setTypeface(db.L());
this.d.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
this.b.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
this.h.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
this.f.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
this.d.setTextColor(db.f(getActivity()));
this.b.setTextColor(db.h(getActivity()));
this.h.setTextColor(db.h(getActivity()));
this.f.setTextColor(db.h(getActivity()));
this.t.setTextColor(db.h(getActivity()));
this.s.setTextColor(db.h(getActivity()));
float e = db.e() * db.d();
float f = 20.0f * e;
this.d.setTextSize(2, e * 28.0f);
this.b.setTextSize(2, f);
this.h.setTextSize(2, f);
this.f.setTextSize(2, f);
this.t.setTextSize(2, f);
this.s.setTextSize(2, f);
this.g = null;
this.p = null;
FaceTecSessionActivity faceTecSessionActivity = (FaceTecSessionActivity) getActivity();
if (faceTecSessionActivity == null) {
return;
}
if (faceTecSessionActivity.p != null) {
this.g = faceTecSessionActivity.p;
}
Resources resources = getResources();
getActivity();
Bitmap decodeResource = BitmapFactory.decodeResource(resources, db.aN());
d();
this.l.setImageDrawable(OSd.ql_(resources, decodeResource));
GradientDrawable gradientDrawable = new GradientDrawable();
this.u = gradientDrawable;
gradientDrawable.setCornerRadius(av.b((int) (db.A() * db.d())));
this.u.setStroke((int) av.b(Math.max(db.l() == 0 ? 0 : 1, (int) (db.l() * db.d()))), db.q(getActivity()));
this.u.setColor(0);
Etv ql_ = OSd.ql_(resources, decodeResource);
ql_.setAlpha(0);
this.n.setImageDrawable(ql_);
this.n.setBackground(this.u);
this.j.setImageDrawable(ql_);
this.j.setBackground(this.u);
this.e.setBackground(this.u);
this.l.setBackground(this.u);
this.e.setClipToOutline(true);
this.l.setClipToOutline(true);
this.e.setOutlineProvider(ViewOutlineProvider.BACKGROUND);
this.l.setOutlineProvider(ViewOutlineProvider.BACKGROUND);
this.m.setColorFilter(db.r(getActivity()), PorterDuff.Mode.SRC_IN);
float e2 = db.e() * db.d();
int a2 = db.a();
int round = Math.round(a2 / 2.0f);
int round2 = (int) Math.round(faceTecSessionActivity.k * 0.45d);
if (this.g != null) {
float height = r7.getHeight() / this.g.getWidth();
if (db.b() >= height) {
round2 = Math.round((Math.round(Math.round(faceTecSessionActivity.g) - (r3 * 3.0f)) / 2.0f) * height);
}
}
((ViewGroup.MarginLayoutParams) ((LinearLayout.LayoutParams) this.d.getLayoutParams())).bottomMargin = Math.round(av.b(5) * e2);
int round3 = Math.round(av.b(5) * e2);
((ViewGroup.MarginLayoutParams) ((LinearLayout.LayoutParams) this.s.getLayoutParams())).topMargin = round3;
((ViewGroup.MarginLayoutParams) ((LinearLayout.LayoutParams) this.t.getLayoutParams())).topMargin = round3;
((ViewGroup.MarginLayoutParams) ((LinearLayout.LayoutParams) this.q.getLayoutParams())).topMargin = Math.round(av.b(5) * e2);
((FrameLayout) view.findViewById(R.id.idealZoomImageContainer)).getLayoutParams().height = round2;
((FrameLayout) view.findViewById(R.id.yourZoomImageContainer)).getLayoutParams().height = round2;
((LinearLayout.LayoutParams) this.c.getLayoutParams()).setMarginEnd(round);
((LinearLayout.LayoutParams) this.a.getLayoutParams()).setMarginStart(round);
view.setPadding(a2, a2, a2, 0);
}
/* renamed from: com.facetec.sdk.cu$2, reason: invalid class name */
/* loaded from: classes.dex */
static final /* synthetic */ class AnonymousClass2 {
static final int[] e;
static {
int[] iArr = new int[cq.values().length];
e = iArr;
try {
iArr[cq.LIGHTING_AND_NEUTRAL_EXPRESSION.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
e[cq.LIGHTING_ONLY.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
e[cq.NEUTRAL_EXPRESSION_ONLY.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
e[cq.BLURRY_ONLY.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void d() {
Resources resources;
int identifier;
if (this.g != null) {
float height = r0.getHeight() / this.g.getWidth();
if (height <= 1.776f) {
float height2 = this.g.getHeight() / 1.776f;
if (this.g.getWidth() - height2 > BitmapDescriptorFactory.HUE_RED) {
this.g = Bitmap.createBitmap(this.g, (int) ((r1.getWidth() - height2) / 2.0f), 0, (int) height2, this.g.getHeight());
}
} else if (height > 1.776f) {
float width = this.g.getWidth() * 1.776f;
if (this.g.getHeight() - width > BitmapDescriptorFactory.HUE_RED) {
this.g = Bitmap.createBitmap(this.g, 0, (int) ((r1.getHeight() - width) / 2.0f), this.g.getWidth(), (int) width);
}
}
int width2 = (int) (this.g.getWidth() * 0.75d);
int height3 = (int) (this.g.getHeight() * 0.75d);
Bitmap bitmap = this.g;
this.g = Bitmap.createBitmap(bitmap, (bitmap.getWidth() - width2) / 2, (this.g.getHeight() - height3) / 2, width2, height3);
this.p = OSd.ql_(getResources(), this.g);
}
if (c(dc.YOUR_ZOOM_IMAGE_OVERRIDE) && (identifier = (resources = getResources()).getIdentifier("zoom_your_zoom_image_override", "drawable", getActivity().getPackageName())) != 0) {
Bitmap decodeResource = BitmapFactory.decodeResource(resources, identifier);
this.g = decodeResource;
this.p = OSd.ql_(resources, decodeResource);
}
if (!ba.c) {
this.e.setScaleX(-1.0f);
}
this.e.setImageDrawable(this.p);
}
private void c() {
float f;
float f2;
float e = db.e();
float d = db.d();
int round = Math.round(db.a() * db.d());
int measuredHeight = this.f6428o.getMeasuredHeight();
if (Locale.getDefault().getLanguage().equals("ar")) {
f = 0.08f;
f2 = 0.09f;
} else {
f = 0.06f;
f2 = 0.07f;
}
float f3 = measuredHeight;
int round2 = Math.round(f * f3);
if (db.b() < 1.4d && Resources.getSystem().getDisplayMetrics().heightPixels < 900) {
round2 = Math.round(f3 * f2);
}
int round3 = (int) Math.round(round2 * 0.85d);
int round4 = (int) Math.round(round3 * 0.85d);
int i = ((ViewGroup.MarginLayoutParams) ((LinearLayout.LayoutParams) this.s.getLayoutParams())).topMargin;
int height = this.l.getHeight();
this.k.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) this.q.getLayoutParams();
((ViewGroup.LayoutParams) layoutParams).height = height + round4 + i;
layoutParams.weight = BitmapDescriptorFactory.HUE_RED;
this.q.setLayoutParams(layoutParams);
LinearLayout.LayoutParams layoutParams2 = (LinearLayout.LayoutParams) this.d.getLayoutParams();
((ViewGroup.LayoutParams) layoutParams2).height = round2;
layoutParams2.weight = BitmapDescriptorFactory.HUE_RED;
this.d.setLayoutParams(layoutParams2);
LinearLayout.LayoutParams layoutParams3 = (LinearLayout.LayoutParams) this.b.getLayoutParams();
((ViewGroup.LayoutParams) layoutParams3).height = round3;
layoutParams3.weight = BitmapDescriptorFactory.HUE_RED;
this.b.setLayoutParams(layoutParams3);
this.h.setLayoutParams(layoutParams3);
this.f.setLayoutParams(layoutParams3);
LinearLayout.LayoutParams layoutParams4 = (LinearLayout.LayoutParams) this.s.getLayoutParams();
((ViewGroup.LayoutParams) layoutParams4).height = round4;
this.s.setLayoutParams(layoutParams4);
this.t.setLayoutParams(layoutParams4);
int width = this.d.getWidth();
if (db.bg()) {
int round5 = Math.round(av.b(35) * d * e);
this.r.getLocationInWindow(new int[2]);
int round6 = (int) ((r10[1] + round5) - Math.round(round / 2.0d));
int[] iArr = new int[2];
this.d.getLocationInWindow(iArr);
if (iArr[1] < round6) {
width -= round5 << 1;
}
}
av.a aVar = new av.a(width, round2);
av.a aVar2 = new av.a(this.b.getWidth(), round3);
av.a aVar3 = new av.a(this.h.getWidth(), round3);
av.a aVar4 = new av.a(this.f.getWidth(), round3);
av.a aVar5 = new av.a(this.s.getWidth(), round4);
av.a aVar6 = new av.a(this.t.getWidth(), round4);
int round7 = Math.round(av.c(8));
int round8 = Math.round(av.c(40));
int round9 = Math.round(av.c(5));
int round10 = Math.round(av.c(36));
int c = av.c(this.d, aVar, round7, round8);
int c2 = av.c(this.b, aVar2, round9, round10);
int c3 = av.c(this.h, aVar3, round9, round10);
int c4 = av.c(this.f, aVar4, round9, round10);
int c5 = av.c(this.s, aVar5, round9, round10);
int c6 = av.c(this.t, aVar6, round9, round10);
int round11 = (int) Math.round(c * 0.85d);
if (c2 >= round11) {
c2 = round11;
}
if (this.h.getText().toString().isEmpty() || c3 >= c2) {
c3 = c2;
}
if (this.f.getText().toString().isEmpty() || c4 >= c3) {
c4 = c3;
}
int round12 = (int) Math.round(c4 * 0.85d);
if (c5 >= c4) {
c5 = round12;
}
if (c6 >= c4) {
c6 = c5;
}
this.d.setTextSize(0, c);
float f4 = c4;
this.b.setTextSize(0, f4);
this.h.setTextSize(0, f4);
this.f.setTextSize(0, f4);
float f5 = c6;
this.s.setTextSize(0, f5);
this.t.setTextSize(0, f5);
}
@Override // android.app.Fragment
public final void onStart() {
super.onStart();
a(new Runnable(this) { // from class: com.facetec.sdk.cu$$ExternalSyntheticLambda7
public final cu f$0;
@Override // java.lang.Runnable
public final void run() {
this.f$0.b();
}
{
this.f$0 = this;
}
}, 100L);
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void b() {
c();
this.d.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(this) { // from class: com.facetec.sdk.cu$$ExternalSyntheticLambda6
public final cu f$0;
@Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
public final void onGlobalLayout() {
this.f$0.h();
}
{
this.f$0 = this;
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void h() {
if (this.x) {
return;
}
this.x = true;
c();
}
private static boolean c(dc dcVar) {
for (int i = 0; i < de.b.length(); i++) {
try {
JSONObject jSONObject = de.b.getJSONObject(i);
String string = jSONObject.getString("overrideKey");
dc dcVar2 = (dc) jSONObject.get("type");
if (FaceTecSDK.c.p.get(string) != null && FaceTecSDK.c.p.get(string).equals(jSONObject.getString("overrideValue")) && dcVar2 == dcVar) {
return true;
}
} catch (Exception unused) {
}
}
return false;
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void a() {
ValueAnimator ofObject = ValueAnimator.ofObject(new ArgbEvaluator(), Integer.valueOf(this.d.getCurrentTextColor()), Integer.valueOf(db.f(getActivity())));
ofObject.setDuration(1000L);
ofObject.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.cu$$ExternalSyntheticLambda0
public final cu f$0;
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
this.f$0.a(valueAnimator);
}
{
this.f$0 = this;
}
});
ofObject.start();
ValueAnimator ofObject2 = ValueAnimator.ofObject(new ArgbEvaluator(), Integer.valueOf(this.b.getCurrentTextColor()), Integer.valueOf(db.h(getActivity())));
ofObject2.setDuration(1000L);
ofObject2.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.cu$$ExternalSyntheticLambda1
public final cu f$0;
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
this.f$0.c(valueAnimator);
}
{
this.f$0 = this;
}
});
ofObject2.start();
ValueAnimator ofObject3 = ValueAnimator.ofObject(new ArgbEvaluator(), Integer.valueOf(db.d(getActivity(), FaceTecSDK.c.f.retryScreenImageBorderColor)), Integer.valueOf(db.q(getActivity())));
ofObject3.setDuration(1000L);
ofObject3.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.cu$$ExternalSyntheticLambda2
public final cu f$0;
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
this.f$0.d(valueAnimator);
}
{
this.f$0 = this;
}
});
ofObject3.start();
ValueAnimator ofObject4 = ValueAnimator.ofObject(new ArgbEvaluator(), Integer.valueOf(db.d(getActivity(), FaceTecSDK.c.f.retryScreenOvalStrokeColor)), Integer.valueOf(db.r(getActivity())));
ofObject4.setDuration(1000L);
ofObject4.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.cu$$ExternalSyntheticLambda3
public final cu f$0;
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
this.f$0.e(valueAnimator);
}
{
this.f$0 = this;
}
});
ofObject4.start();
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void a(ValueAnimator valueAnimator) {
if (isAdded()) {
this.d.setTextColor(((Integer) valueAnimator.getAnimatedValue()).intValue());
}
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void c(ValueAnimator valueAnimator) {
if (isAdded()) {
this.b.setTextColor(((Integer) valueAnimator.getAnimatedValue()).intValue());
this.h.setTextColor(((Integer) valueAnimator.getAnimatedValue()).intValue());
this.f.setTextColor(((Integer) valueAnimator.getAnimatedValue()).intValue());
this.s.setTextColor(((Integer) valueAnimator.getAnimatedValue()).intValue());
this.t.setTextColor(((Integer) valueAnimator.getAnimatedValue()).intValue());
}
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void d(ValueAnimator valueAnimator) {
if (isAdded()) {
this.u.setStroke(db.l(), ((Integer) valueAnimator.getAnimatedValue()).intValue());
this.j.setBackground(this.u);
this.n.setBackground(this.u);
}
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void e(ValueAnimator valueAnimator) {
if (isAdded()) {
this.m.setColorFilter(((Integer) valueAnimator.getAnimatedValue()).intValue(), PorterDuff.Mode.SRC_IN);
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void d(final Runnable runnable) {
if (dp.e()) {
this.b.setAlpha(1.0f);
this.d.setAlpha(1.0f);
this.c.setAlpha(1.0f);
this.a.setAlpha(1.0f);
this.f.setAlpha(1.0f);
this.h.setAlpha(1.0f);
new aq.e(this, runnable).run();
return;
}
this.b.animate().alpha(1.0f).setDuration(500L).setListener(null).start();
final int i = 500;
final int i2 = 300;
this.d.animate().alpha(1.0f).setDuration(500L).setListener(null).withEndAction(new aq.e(this, new Runnable(this, i, i2, runnable) { // from class: com.facetec.sdk.cu$$ExternalSyntheticLambda5
public final cu f$0;
public final int f$1;
public final int f$2;
public final Runnable f$3;
@Override // java.lang.Runnable
public final void run() {
this.f$0.a(this.f$1, this.f$2, this.f$3);
}
{
this.f$0 = this;
this.f$1 = i;
this.f$2 = i2;
this.f$3 = runnable;
}
})).start();
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void a(final int i, final int i2, final Runnable runnable) {
this.c.animate().alpha(1.0f).setDuration(i).setStartDelay(i2).setListener(null).withEndAction(new aq.e(this, new Runnable(this, i, i2, runnable) { // from class: com.facetec.sdk.cu$$ExternalSyntheticLambda4
public final cu f$0;
public final int f$1;
public final int f$2;
public final Runnable f$3;
@Override // java.lang.Runnable
public final void run() {
this.f$0.e(this.f$1, this.f$2, this.f$3);
}
{
this.f$0 = this;
this.f$1 = i;
this.f$2 = i2;
this.f$3 = runnable;
}
})).start();
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void e(final int i, final int i2, final Runnable runnable) {
this.a.animate().alpha(1.0f).setDuration(i).setStartDelay(i2).setListener(null).withEndAction(new aq.e(this, new Runnable(this, i, i2, runnable) { // from class: com.facetec.sdk.cu$$ExternalSyntheticLambda8
public final cu f$0;
public final int f$1;
public final int f$2;
public final Runnable f$3;
@Override // java.lang.Runnable
public final void run() {
this.f$0.c(this.f$1, this.f$2, this.f$3);
}
{
this.f$0 = this;
this.f$1 = i;
this.f$2 = i2;
this.f$3 = runnable;
}
})).start();
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void c(int i, int i2, Runnable runnable) {
long j = i;
long j2 = i2;
this.f.animate().alpha(1.0f).setDuration(j).setStartDelay(j2).setListener(null).start();
this.h.animate().alpha(1.0f).setDuration(j).setStartDelay(j2).setListener(null).withEndAction(new aq.e(this, runnable));
}
@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 TextView e() {
return this.d;
}
}