what-the-bank/sources/com/scb/phone/view/fragment/debitatm/DebitCardVirtualDetailFragm...

291 lines
9.2 KiB
Java

package com.scb.phone.view.fragment.debitatm;
import android.app.Dialog;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.custom.ScbRotateLayout;
import java.util.Arrays;
import o.C0544Jb;
import o.C0565Jo;
import o.C12891fKc;
import o.C14957gcv;
import o.IU;
import o.gcH;
import o.gdZ;
/* loaded from: classes5.dex */
public final class DebitCardVirtualDetailFragment extends Hilt_DebitCardVirtualDetailFragment {
public static final RVV e = new RVV(0);
private boolean a;
private C0565Jo b;
private C0544Jb c;
private IU d;
@BindView
public ImageView ivDebitCard;
private String j = "";
@BindView
public ScbRotateLayout scbRotateLayout;
@BindView
public TextView tvCardNo;
@BindView
public TextView tvExpired;
@BindView
public TextView tvNickname;
@BindView
public TextView tvPoint;
@OnClick
public final void onCardClick() {
}
/* loaded from: classes5.dex */
public static final class RVV {
private RVV() {
}
public /* synthetic */ RVV(byte b) {
this();
}
}
@Override // androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
return layoutInflater.inflate(R.layout.2131559545, viewGroup, false);
}
@Override // androidx.fragment.app.Fragment
public final void onViewCreated(View view, Bundle bundle) {
C14957gcv.e(view, "");
super.onViewCreated(view, bundle);
ButterKnife.c(this, view);
Bundle arguments = getArguments();
if (arguments != null) {
IU iu = (IU) arguments.getParcelable("DEBIT");
if (iu != null) {
C14957gcv.c(iu, "");
this.d = iu;
}
C0565Jo c0565Jo = (C0565Jo) arguments.getParcelable("VIRTUAL");
if (c0565Jo != null) {
C14957gcv.c(c0565Jo, "");
this.b = c0565Jo;
}
C0544Jb c0544Jb = (C0544Jb) arguments.getParcelable("DEBIT_REWARD");
if (c0544Jb != null) {
this.c = c0544Jb;
}
this.a = arguments.getBoolean("POINT_THROWABLE", false);
String string = arguments.getString("POINT_TRAPEZOID_ERROR");
if (string == null) {
string = "";
}
this.j = string;
}
ImageView imageView = this.ivDebitCard;
ScbRotateLayout scbRotateLayout = null;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
IU iu2 = this.d;
if (iu2 == null) {
C14957gcv.a("");
iu2 = null;
}
String d = iu2.d();
if (d == null) {
d = "";
}
C12891fKc.azB_(getContext(), R.drawable.default_card_without_logo, imageView, d);
TextView textView = this.tvCardNo;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
C0565Jo c0565Jo2 = this.b;
if (c0565Jo2 == null) {
C14957gcv.a("");
c0565Jo2 = null;
}
textView.setText(c0565Jo2.b);
IU iu3 = this.d;
if (iu3 == null) {
C14957gcv.a("");
iu3 = null;
}
String o2 = iu3.o();
if (!(o2 == null || gdZ.d((CharSequence) o2))) {
TextView textView2 = this.tvNickname;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setVisibility(0);
TextView textView3 = this.tvNickname;
if (textView3 == null) {
C14957gcv.a("");
textView3 = null;
}
IU iu4 = this.d;
if (iu4 == null) {
C14957gcv.a("");
iu4 = null;
}
textView3.setText(iu4.o());
}
TextView textView4 = this.tvExpired;
if (textView4 == null) {
C14957gcv.a("");
textView4 = null;
}
gcH gch = gcH.d;
String string2 = getString(R.string.debit_valid);
C14957gcv.c((Object) string2, "");
Object[] objArr = new Object[1];
C0565Jo c0565Jo3 = this.b;
if (c0565Jo3 == null) {
C14957gcv.a("");
c0565Jo3 = null;
}
objArr[0] = c0565Jo3.d;
String format = String.format(string2, Arrays.copyOf(objArr, 1));
C14957gcv.c((Object) format, "");
textView4.setText(format);
IU iu5 = this.d;
if (iu5 == null) {
C14957gcv.a("");
iu5 = null;
}
if (1 != iu5.v()) {
TextView textView5 = this.tvPoint;
if (textView5 == null) {
C14957gcv.a("");
textView5 = null;
}
textView5.setVisibility(8);
} else if (!this.a) {
if (this.c != null) {
IU iu6 = this.d;
if (iu6 == null) {
C14957gcv.a("");
iu6 = null;
}
String str = (String) IU.e(new Object[]{iu6}, -103287250, 103287254, System.identityHashCode(iu6));
if (!(str == null || gdZ.d((CharSequence) str))) {
C0544Jb c0544Jb2 = this.c;
String str2 = c0544Jb2 != null ? c0544Jb2.b : null;
if (!(str2 == null || gdZ.d((CharSequence) str2))) {
IU iu7 = this.d;
if (iu7 == null) {
C14957gcv.a("");
iu7 = null;
}
String str3 = (String) IU.e(new Object[]{iu7}, -103287250, 103287254, System.identityHashCode(iu7));
if (str3 == null) {
str3 = "";
}
C0544Jb c0544Jb3 = this.c;
String str4 = c0544Jb3 != null ? c0544Jb3.b : null;
if (str4 == null) {
str4 = "";
}
TextView textView6 = this.tvPoint;
if (textView6 == null) {
C14957gcv.a("");
textView6 = null;
}
textView6.setVisibility(0);
TextView textView7 = this.tvPoint;
if (textView7 == null) {
C14957gcv.a("");
textView7 = null;
}
gcH gch2 = gcH.d;
String string3 = getString(R.string.two_words);
C14957gcv.c((Object) string3, "");
String format2 = String.format(string3, Arrays.copyOf(new Object[]{str4, str3}, 2));
C14957gcv.c((Object) format2, "");
textView7.setText(format2);
}
}
}
TextView textView8 = this.tvPoint;
if (textView8 == null) {
C14957gcv.a("");
textView8 = null;
}
textView8.setVisibility(8);
} else {
TextView textView9 = this.tvPoint;
if (textView9 == null) {
C14957gcv.a("");
textView9 = null;
}
textView9.setVisibility(0);
textView9.setBackgroundResource(R.drawable.trapezoid_gray);
textView9.setText(this.j);
}
ScbRotateLayout scbRotateLayout2 = this.scbRotateLayout;
if (scbRotateLayout2 != null) {
scbRotateLayout = scbRotateLayout2;
} else {
C14957gcv.a("");
}
scbRotateLayout.setAngle(-90);
}
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
public final void onStart() {
super.onStart();
Dialog dialog = getDialog();
if (dialog != null) {
Window window = dialog.getWindow();
if (window != null) {
window.setLayout(-1, -1);
}
Window window2 = dialog.getWindow();
if (window2 != null) {
window2.setBackgroundDrawable(new ColorDrawable(0));
}
}
}
@Override // androidx.fragment.app.Fragment
public final void onResume() {
Window window;
super.onResume();
Dialog dialog = getDialog();
if (dialog == null || (window = dialog.getWindow()) == null) {
return;
}
window.setFlags(8192, 8192);
}
@OnClick
public final void onBackgroundClick() {
dismiss();
}
@OnClick
public final void onCloseClick() {
dismiss();
}
}