what-the-bank/sources/com/facetec/sdk/GuidanceCenterContentFragme...

457 lines
19 KiB
Java

package com.facetec.sdk;
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.content.res.Resources;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.facetec.sdk.aq;
import com.facetec.sdk.av;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
/* loaded from: classes.dex */
public final class GuidanceCenterContentFragment extends aq {
TextView a;
TextView b;
ImageView c;
LinearLayout d;
TextView e;
LinearLayout f;
RelativeLayout g;
private TextView h;
private TextView i;
private TextView j;
private f k;
private TextView l;
private RelativeLayout m;
private TextView n;
/* renamed from: o, reason: collision with root package name */
private RelativeLayout f6401o;
private View p;
private GradientDrawable q;
private GradientDrawable r;
private boolean s = false;
/* JADX INFO: Access modifiers changed from: protected */
/* loaded from: classes.dex */
public enum ScreenType {
GENERIC,
READY_OVAL
}
@Override // android.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.facetec_guidance_center_content_fragment, viewGroup, false);
this.p = inflate;
return inflate;
}
@Override // android.app.Fragment
public final void onViewCreated(View view, Bundle bundle) {
super.onViewCreated(view, bundle);
this.d = (LinearLayout) view.findViewById(R.id.iconLayout);
this.c = (ImageView) view.findViewById(R.id.iconImageView);
TextView textView = (TextView) view.findViewById(R.id.genericHeaderView);
this.b = textView;
db.b(textView);
this.b.setTypeface(bk.e);
this.b.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
TextView textView2 = (TextView) view.findViewById(R.id.feedbackIconsHeader);
this.j = textView2;
db.b(textView2);
this.j.setTypeface(bk.e);
this.j.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
this.e = (TextView) view.findViewById(R.id.messageView1);
this.a = (TextView) view.findViewById(R.id.messageView2);
this.e.setTypeface(bk.a);
this.a.setTypeface(bk.a);
db.b(this.e);
db.b(this.a);
this.e.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
this.a.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
this.f6401o = (RelativeLayout) view.findViewById(R.id.readyScreenContent);
this.i = (TextView) view.findViewById(R.id.readyScreenHeader1);
this.h = (TextView) view.findViewById(R.id.readyScreenHeader2);
this.n = (TextView) view.findViewById(R.id.readyScreenSubtext1);
this.l = (TextView) view.findViewById(R.id.readyScreenSubtext2);
this.m = (RelativeLayout) view.findViewById(R.id.readyScreenHeaderOuterContainer);
this.g = (RelativeLayout) view.findViewById(R.id.readyScreenSubtextOuterContainer);
this.f = (LinearLayout) view.findViewById(R.id.readyScreenHeaderInnerContainer);
this.k = (f) view.findViewById(R.id.readyScreenSubtextInnerContainer);
this.f.setImportantForAccessibility(1);
if (Build.VERSION.SDK_INT >= 28) {
this.f.setAccessibilityHeading(true);
}
this.g.setImportantForAccessibility(1);
this.m.setImportantForAccessibility(2);
this.i.setImportantForAccessibility(2);
this.h.setImportantForAccessibility(2);
this.n.setImportantForAccessibility(2);
this.l.setImportantForAccessibility(2);
this.i.setTypeface(db.I());
this.h.setTypeface(db.I());
this.n.setTypeface(db.E());
this.l.setTypeface(db.E());
this.i.setTextColor(db.j(getActivity()));
this.h.setTextColor(db.j(getActivity()));
this.n.setTextColor(db.g(getActivity()));
this.l.setTextColor(db.g(getActivity()));
this.i.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
this.h.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
this.n.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
this.l.setLineSpacing(BitmapDescriptorFactory.HUE_RED, 1.1f);
float e = db.e() * db.d();
float f = 28.0f * e;
this.i.setTextSize(2, f);
this.h.setTextSize(2, f);
float f2 = 20.0f * e;
this.n.setTextSize(2, f2);
this.l.setTextSize(2, f2);
this.b.setTextSize(2, f);
this.j.setTextSize(2, f);
this.e.setTextSize(2, f2);
int a = db.a();
view.setPadding(a, a, a, 0);
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.m.getLayoutParams();
layoutParams.setMarginStart(a);
layoutParams.setMarginEnd(a);
this.m.setLayoutParams(layoutParams);
RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.g.getLayoutParams();
layoutParams2.setMarginStart(a);
layoutParams2.setMarginEnd(a);
this.g.setLayoutParams(layoutParams2);
ScreenType screenType = (ScreenType) getArguments().get("screenType");
int i = getArguments().getInt("header");
if (screenType == ScreenType.GENERIC) {
cx.e(this.b, i);
} else {
cx.e(this.j, i);
}
if (screenType == ScreenType.GENERIC) {
cx.e(this.e, getArguments().getInt("message"));
} else if (screenType == ScreenType.READY_OVAL) {
this.f6401o.setVisibility(0);
db.d(this.i, db.a(true, false));
db.d(this.h, db.c(true, false));
db.d(this.n, db.b(true, false));
db.d(this.l, db.e(true, false));
Resources resources = getResources();
GradientDrawable gradientDrawable = (GradientDrawable) resources.getDrawable(R.drawable.facetec_ready_header_background).mutate();
this.r = gradientDrawable;
gradientDrawable.setCornerRadius(av.b(db.v()) * db.d());
db.d(getActivity(), this.r, db.Q());
GradientDrawable gradientDrawable2 = (GradientDrawable) resources.getDrawable(R.drawable.facetec_ready_subtext_background).mutate();
this.q = gradientDrawable2;
gradientDrawable2.setCornerRadius(av.b(db.v()) * db.d());
db.d(getActivity(), this.q, db.Q());
this.m.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(this) { // from class: com.facetec.sdk.GuidanceCenterContentFragment$$ExternalSyntheticLambda5
public final GuidanceCenterContentFragment f$0;
@Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
public final void onGlobalLayout() {
this.f$0.a();
}
{
this.f$0 = this;
}
});
}
LinearLayout.LayoutParams layoutParams3 = (LinearLayout.LayoutParams) this.d.getLayoutParams();
((ViewGroup.LayoutParams) layoutParams3).height = Math.round(av.b(78) * e);
((ViewGroup.MarginLayoutParams) layoutParams3).bottomMargin = a;
this.d.setLayoutParams(layoutParams3);
((ViewGroup.MarginLayoutParams) ((LinearLayout.LayoutParams) this.b.getLayoutParams())).bottomMargin = a;
}
@Override // android.app.Fragment
public final void onStart() {
super.onStart();
if (getArguments().getBoolean("isCameraPermissionsShowing")) {
this.b.setImportantForAccessibility(1);
this.b.sendAccessibilityEvent(8);
this.b.performAccessibilityAction(64, null);
return;
}
this.g.setImportantForAccessibility(1);
RelativeLayout relativeLayout = this.g;
StringBuilder sb = new StringBuilder();
sb.append((Object) this.n.getText());
sb.append(" ");
sb.append((Object) this.l.getText());
relativeLayout.setContentDescription(sb.toString());
this.f.setImportantForAccessibility(1);
if (Build.VERSION.SDK_INT >= 28) {
this.f.setScreenReaderFocusable(true);
this.g.setScreenReaderFocusable(true);
}
this.g.setAccessibilityTraversalAfter(this.f.getId());
this.f.sendAccessibilityEvent(8);
this.f.performAccessibilityAction(64, null);
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void a() {
if (this.s) {
return;
}
this.s = true;
this.m.post(new aq.e(this, new Runnable(this) { // from class: com.facetec.sdk.GuidanceCenterContentFragment$$ExternalSyntheticLambda4
public final GuidanceCenterContentFragment 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 /* synthetic */ void c() {
boolean z;
boolean z2;
int i;
float e = db.e();
int round = Math.round(db.a() * db.d());
int round2 = Math.round(av.b(35) * db.d() * e);
int round3 = Math.round(av.b(5) * db.d() * e);
float f = getArguments().getFloat("bottomOval");
int i2 = round3 << 1;
float f2 = i2;
float f3 = (getArguments().getFloat("topOval") - (round << 1)) - f2;
float measuredHeight = (this.p.getMeasuredHeight() - f) - f2;
int measuredHeight2 = this.f.getMeasuredHeight() - i2;
int floor = (int) Math.floor(f3);
if (f3 < measuredHeight2) {
floor = (round3 << 2) + measuredHeight2;
z = true;
} else {
z = false;
}
int measuredHeight3 = this.k.getMeasuredHeight() - i2;
int floor2 = (int) Math.floor(measuredHeight);
if (measuredHeight < measuredHeight3) {
floor2 = measuredHeight3 + (round3 << 2);
z2 = true;
} else {
z2 = false;
}
int i3 = (z && db.bg()) ? round2 : 0;
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, floor);
layoutParams.setMargins(i3, 0, i3, 0);
layoutParams.addRule(10);
this.m.setLayoutParams(layoutParams);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-1, floor2);
layoutParams2.setMargins(0, 0, 0, round3);
layoutParams2.addRule(12);
this.g.setLayoutParams(layoutParams2);
if (z) {
this.f.setPadding(round3, round3, round3, round3);
this.f.setBackground(this.r);
this.f.invalidate();
}
if (z2) {
this.k.setPadding(round3, round3, round3, round3);
this.k.setBackground(this.q);
this.k.invalidate();
}
if (FaceTecSDK.c.a) {
this.k.setOnClickRunnable(new Runnable(this) { // from class: com.facetec.sdk.GuidanceCenterContentFragment$$ExternalSyntheticLambda3
public final GuidanceCenterContentFragment f$0;
@Override // java.lang.Runnable
public final void run() {
this.f$0.d();
}
{
this.f$0 = this;
}
});
}
int floor3 = (int) Math.floor((floor / 2.0d) / 1.3d);
int floor4 = (int) Math.floor((floor2 / 2.0d) / 1.3d);
int width = this.m.getWidth();
int width2 = this.g.getWidth();
if (z) {
floor3 = (int) Math.floor((floor - i2) / 2.0d);
width -= i2;
i = width;
} else {
if (!db.bg()) {
round2 = 0;
}
i = width - (round2 << 1);
}
if (z2) {
floor4 = (int) Math.floor((floor2 - i2) / 2.0d);
width2 = this.g.getWidth() - i2;
}
av.a aVar = new av.a(i, floor3);
av.a aVar2 = new av.a(width, floor3);
av.a aVar3 = new av.a(width2, floor4);
int round4 = Math.round(av.c(8));
int round5 = Math.round(av.c(40));
int round6 = Math.round(av.c(5));
int round7 = Math.round(av.c(36));
int c = av.c(this.i, aVar, round4, round5);
int c2 = av.c(this.h, aVar2, round4, round5);
int c3 = av.c(this.n, aVar3, round6, round7);
int c4 = av.c(this.l, aVar3, round6, round7);
int min = Math.min(c, c2);
int round8 = (int) Math.round(min * 0.85d);
if (c3 >= round8) {
c3 = round8;
}
if (c4 >= c3) {
c4 = c3;
}
float f4 = min;
this.i.setTextSize(0, f4);
this.h.setTextSize(0, f4);
float f5 = c4;
this.n.setTextSize(0, f5);
this.l.setTextSize(0, f5);
StringBuilder sb = new StringBuilder();
sb.append(String.valueOf(this.i.getText()));
sb.append((Object) this.h.getText());
this.f.setContentDescription(sb.toString());
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void d() {
bg bgVar = (bg) getActivity();
if (bgVar != null) {
bgVar.B();
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public static GuidanceCenterContentFragment a(int i, int i2, ScreenType screenType, float f, float f2, int i3) {
GuidanceCenterContentFragment guidanceCenterContentFragment = new GuidanceCenterContentFragment();
Bundle bundle = new Bundle();
bundle.putInt("header", i);
bundle.putInt("message", i2);
bundle.putSerializable("screenType", screenType);
bundle.putFloat("topOval", f);
bundle.putFloat("bottomOval", f2);
bundle.putInt("retryActionButtonId", i3);
guidanceCenterContentFragment.setArguments(bundle);
return guidanceCenterContentFragment;
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void b(boolean z) {
TextView textView = this.i;
if (textView == null || this.h == null || this.n == null || this.l == null) {
return;
}
ValueAnimator ofObject = ValueAnimator.ofObject(new ArgbEvaluator(), Integer.valueOf(textView.getCurrentTextColor()), Integer.valueOf(db.j(getActivity())));
ofObject.setDuration(1000L);
ofObject.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.GuidanceCenterContentFragment$$ExternalSyntheticLambda0
public final GuidanceCenterContentFragment f$0;
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
this.f$0.e(valueAnimator);
}
{
this.f$0 = this;
}
});
ofObject.start();
ValueAnimator ofObject2 = ValueAnimator.ofObject(new ArgbEvaluator(), Integer.valueOf(this.i.getCurrentTextColor()), Integer.valueOf(db.g(getActivity())));
ofObject2.setDuration(1000L);
ofObject2.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.GuidanceCenterContentFragment$$ExternalSyntheticLambda1
public final GuidanceCenterContentFragment f$0;
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
this.f$0.b(valueAnimator);
}
{
this.f$0 = this;
}
});
ofObject2.start();
if (z) {
if (this.f.getBackground() == null && this.k.getBackground() == null) {
return;
}
ValueAnimator ofObject3 = ValueAnimator.ofObject(new ArgbEvaluator(), Integer.valueOf(db.d(getActivity(), FaceTecSDK.c.f.readyScreenTextBackgroundColor)), Integer.valueOf(db.d(getActivity(), db.Q())));
ofObject3.setDuration(1000L);
ofObject3.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.facetec.sdk.GuidanceCenterContentFragment$$ExternalSyntheticLambda2
public final GuidanceCenterContentFragment f$0;
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
this.f$0.d(valueAnimator);
}
{
this.f$0 = this;
}
});
ofObject3.start();
}
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void e(ValueAnimator valueAnimator) {
TextView textView;
if (!isAdded() || (textView = this.i) == null || this.h == null) {
return;
}
textView.setTextColor(((Integer) valueAnimator.getAnimatedValue()).intValue());
this.h.setTextColor(((Integer) valueAnimator.getAnimatedValue()).intValue());
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void b(ValueAnimator valueAnimator) {
TextView textView;
if (!isAdded() || (textView = this.n) == null || this.l == null) {
return;
}
textView.setTextColor(((Integer) valueAnimator.getAnimatedValue()).intValue());
this.l.setTextColor(((Integer) valueAnimator.getAnimatedValue()).intValue());
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void d(ValueAnimator valueAnimator) {
if (isAdded()) {
LinearLayout linearLayout = this.f;
if (linearLayout != null && linearLayout.getBackground() != null) {
db.d(getActivity(), this.r, ((Integer) valueAnimator.getAnimatedValue()).intValue());
this.f.setBackground(this.r);
}
f fVar = this.k;
if (fVar == null || fVar.getBackground() == null) {
return;
}
db.d(getActivity(), this.q, ((Integer) valueAnimator.getAnimatedValue()).intValue());
this.k.setBackground(this.q);
}
}
@Override // com.facetec.sdk.aq, android.app.Fragment
public final void onCreate(Bundle bundle) {
super.onCreate(bundle);
}
}