what-the-bank/sources/com/scb/phone/view/fragment/hml/submission/HmlDocumentSubmissionFragme...

459 lines
15 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.hml.submission;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.scb.phone.R;
import com.scb.phone.view.activity.hml.HmlApplicationOutcomeActivity;
import com.scb.phone.view.activity.hml.HmlConsentActivity;
import com.scb.phone.view.activity.hml.HmlDocumentListActivity;
import com.scb.phone.view.activity.hml.HmlIssuerLandingActivity;
import com.scb.phone.view.adapter.hml.HmlDocumentSubmissionAdapter;
import com.scb.phone.view.fragment.hml.submission.HmlDocumentSubmissionFragment;
import java.util.List;
import kotlin.NoWhenBranchMatchedException;
import o.AbstractC0777Oj;
import o.C0791Oq;
import o.C14957gcv;
import o.C15755iM;
import o.C5668bxR;
import o.EnumC5550bvF;
import o.EnumC5730bya;
import o.EnumC9842drX;
import o.InterfaceC13391fZD;
import o.InterfaceC9314dhR;
import o.OVB;
import o.QhN;
import o.YNc;
import o.YNs;
import o.ZI;
import o.pug;
import o.rWY;
/* loaded from: classes5.dex */
public class HmlDocumentSubmissionFragment extends Hilt_HmlDocumentSubmissionFragment implements InterfaceC9314dhR, HmlDocumentSubmissionAdapter.Sts {
public static final IeS d = new IeS(0);
private HmlDocumentSubmissionAdapter c;
@BindView
public TextView dateRemarkText;
@BindView
public RecyclerView documentRecyclerView;
private Unbinder h;
private int j;
@InterfaceC13391fZD
public C5668bxR presenter;
@BindView
public ImageView resubmissionIcon;
@BindView
public Button submissionButton;
@BindView
public TextView uploadedFiles;
/* loaded from: classes5.dex */
public static final class IeS {
private IeS() {
}
public static HmlDocumentSubmissionFragment a(EnumC5550bvF enumC5550bvF) {
C14957gcv.e(enumC5550bvF, "");
HmlDocumentSubmissionFragment hmlDocumentSubmissionFragment = new HmlDocumentSubmissionFragment();
Bundle bundle = new Bundle();
bundle.putParcelable("HML_SUBMISSTION_TYPE", enumC5550bvF);
hmlDocumentSubmissionFragment.setArguments(bundle);
return hmlDocumentSubmissionFragment;
}
public /* synthetic */ IeS(byte b) {
this();
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
EnumC5550bvF enumC5550bvF;
C14957gcv.e(layoutInflater, "");
View inflate = layoutInflater.inflate(R.layout.2131559695, viewGroup, false);
Unbinder c = ButterKnife.c(this, inflate);
C14957gcv.c(c, "");
this.h = c;
C5668bxR c5668bxR = this.presenter;
if (c5668bxR == null) {
C14957gcv.a("");
c5668bxR = null;
}
c5668bxR.e((C5668bxR) this);
C5668bxR c5668bxR2 = this.presenter;
if (c5668bxR2 == null) {
C14957gcv.a("");
c5668bxR2 = null;
}
Bundle arguments = getArguments();
if (arguments == null || (enumC5550bvF = (EnumC5550bvF) arguments.getParcelable("HML_SUBMISSTION_TYPE")) == null) {
enumC5550bvF = EnumC5550bvF.SUBMISSION;
}
if (enumC5550bvF != null) {
C14957gcv.e(enumC5550bvF, "");
c5668bxR2.a = enumC5550bvF;
}
i();
Bundle arguments2 = getArguments();
EnumC5550bvF enumC5550bvF2 = arguments2 != null ? (EnumC5550bvF) arguments2.getParcelable("HML_SUBMISSTION_TYPE") : null;
if (enumC5550bvF2 == null) {
enumC5550bvF2 = EnumC5550bvF.SUBMISSION;
}
d(enumC5550bvF2);
return inflate;
}
protected void d(EnumC5550bvF enumC5550bvF) {
C14957gcv.e(enumC5550bvF, "");
pug[] pugVarArr = new pug[3];
pugVarArr[0] = new pug("user_type", g());
pugVarArr[1] = new pug("feature", "your_loan");
pugVarArr[2] = new pug("document_status", enumC5550bvF == EnumC5550bvF.SUBMISSION ? "INITIAL" : "RESUBMIT");
c("document_submission", pugVarArr);
}
/* loaded from: classes5.dex */
public static final class LWm extends GridLayoutManager.Sts {
private HmlDocumentSubmissionAdapter c;
LWm(HmlDocumentSubmissionAdapter hmlDocumentSubmissionAdapter) {
this.c = hmlDocumentSubmissionAdapter;
}
@Override // androidx.recyclerview.widget.GridLayoutManager.Sts
public final int e(int i) {
if (this.c.getItemViewType(i) == EnumC5730bya.CATEGORY.ordinal()) {
return 2;
}
EnumC5730bya enumC5730bya = EnumC5730bya.ITEM;
return 1;
}
}
@Override // androidx.fragment.app.Fragment
public void onStart() {
EnumC9842drX enumC9842drX;
super.onStart();
C5668bxR c5668bxR = this.presenter;
EnumC5550bvF enumC5550bvF = null;
if (c5668bxR == null) {
C14957gcv.a("");
c5668bxR = null;
}
c5668bxR.e((C5668bxR) this);
C5668bxR c5668bxR2 = this.presenter;
if (c5668bxR2 == null) {
C14957gcv.a("");
c5668bxR2 = null;
}
Bundle arguments = getArguments();
EnumC5550bvF enumC5550bvF2 = arguments != null ? (EnumC5550bvF) arguments.getParcelable("HML_SUBMISSTION_TYPE") : null;
if (enumC5550bvF2 != null) {
C14957gcv.e(enumC5550bvF2, "");
c5668bxR2.a = enumC5550bvF2;
}
i();
C5668bxR c5668bxR3 = this.presenter;
if (c5668bxR3 == null) {
C14957gcv.a("");
c5668bxR3 = null;
}
if (c5668bxR3.f != 0) {
c5668bxR3.f.y();
}
C15755iM c15755iM = c5668bxR3.b;
C5668bxR.LWm lWm = new C5668bxR.LWm(c5668bxR3);
C5668bxR.RVV rvv = new C5668bxR.RVV(c5668bxR3);
EnumC5550bvF enumC5550bvF3 = c5668bxR3.a;
if (enumC5550bvF3 != null) {
enumC5550bvF = enumC5550bvF3;
} else {
C14957gcv.a("");
}
int i = C5668bxR.Sts.b[enumC5550bvF.ordinal()];
if (i == 1) {
enumC9842drX = EnumC9842drX.SUBMISSION;
} else {
if (i != 2) {
throw new NoWhenBranchMatchedException();
}
enumC9842drX = EnumC9842drX.RESUBMISSION;
}
c15755iM.a(lWm, rvv, new rWY.RVV(enumC9842drX));
c5668bxR3.d.a();
QhN qhN = c5668bxR3.d;
qhN.d(qhN.i, new C5668bxR.ZqN(c5668bxR3));
}
@Override // o.InterfaceC9314dhR
public final void b(String str, String str2) {
C14957gcv.e(str, "");
C14957gcv.e(str2, "");
TextView textView = this.uploadedFiles;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(getString(R.string.hml_document_submission_uploaded_to, str, str2));
this.j = Integer.parseInt(str2);
}
@Override // o.InterfaceC9314dhR
public void b(C0791Oq c0791Oq, YNc.HBt hBt) {
C14957gcv.e(c0791Oq, "");
C14957gcv.e(hBt, "");
HmlDocumentListActivity.HBt hBt2 = HmlDocumentListActivity.b;
Context requireContext = requireContext();
C14957gcv.c(requireContext, "");
C14957gcv.e(requireContext, "");
C14957gcv.e(c0791Oq, "");
C14957gcv.e(hBt, "");
Intent putExtra = new Intent(requireContext, (Class<?>) HmlDocumentListActivity.class).putExtra("HML_DOC_INFO", c0791Oq).putExtra("HML_DOC_FILE_VALIDATION_LIMIT", hBt);
C14957gcv.c(putExtra, "");
startActivity(putExtra);
}
@Override // com.scb.phone.view.adapter.hml.HmlDocumentSubmissionAdapter.Sts
public final void e(final C0791Oq c0791Oq) {
C14957gcv.e(c0791Oq, "");
final C5668bxR c5668bxR = this.presenter;
if (c5668bxR == null) {
C14957gcv.a("");
c5668bxR = null;
}
C14957gcv.e(c0791Oq, "");
ZI.IeS ieS = new ZI.IeS(c0791Oq, c5668bxR) { // from class: o.bxX
private C5668bxR c;
private C0791Oq e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C5668bxR.d(this.e, this.c, (InterfaceC9314dhR) obj);
}
{
this.e = c0791Oq;
this.c = c5668bxR;
}
};
if (c5668bxR.f != 0) {
ieS.e(c5668bxR.f);
}
}
@Override // o.InterfaceC9314dhR
public final void b(List<? extends AbstractC0777Oj> list) {
C14957gcv.e(list, "");
HmlDocumentSubmissionAdapter hmlDocumentSubmissionAdapter = this.c;
if (hmlDocumentSubmissionAdapter != null) {
C14957gcv.e(list, "");
hmlDocumentSubmissionAdapter.a = list;
hmlDocumentSubmissionAdapter.notifyDataSetChanged();
}
}
@Override // o.InterfaceC9314dhR
public void a() {
HmlConsentActivity.Sts sts = HmlConsentActivity.k;
Context requireContext = requireContext();
C14957gcv.c(requireContext, "");
startActivity(HmlConsentActivity.Sts.afF_(requireContext, OVB.NCB_CONSENT, null));
}
@Override // o.InterfaceC9314dhR
public void d() {
Context context = getContext();
if (context != null) {
startActivity(HmlApplicationOutcomeActivity.afw_(context, false));
}
}
@Override // o.InterfaceC9314dhR
public final void d(boolean z) {
Button button = this.submissionButton;
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setEnabled(z);
}
@Override // o.InterfaceC9314dhR
public final void b() {
ImageView imageView = this.resubmissionIcon;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
imageView.setVisibility(0);
}
@Override // o.InterfaceC9314dhR
public final void c(String str, boolean z) {
C14957gcv.e(str, "");
TextView textView = null;
if (z) {
TextView textView2 = this.dateRemarkText;
if (textView2 != null) {
textView = textView2;
} else {
C14957gcv.a("");
}
textView.setText(getString(R.string.hml_document_re_submission_upload_message, str));
return;
}
TextView textView3 = this.dateRemarkText;
if (textView3 != null) {
textView = textView3;
} else {
C14957gcv.a("");
}
textView.setText(getString(R.string.hml_document_submission_upload_message, str));
}
@Override // o.InterfaceC9314dhR
public final void c() {
Context context = getContext();
if (context != null) {
HmlIssuerLandingActivity.LWm lWm = HmlIssuerLandingActivity.f7283o;
startActivity(new Intent(context, (Class<?>) HmlIssuerLandingActivity.class));
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroyView() {
Unbinder unbinder = this.h;
if (unbinder == null) {
C14957gcv.a("");
unbinder = null;
}
unbinder.a();
this.c = null;
super.onDestroyView();
}
@Override // androidx.fragment.app.Fragment
public void onStop() {
C5668bxR c5668bxR = this.presenter;
if (c5668bxR == null) {
C14957gcv.a("");
c5668bxR = null;
}
c5668bxR.w_();
super.onStop();
}
public static /* synthetic */ void d(HmlDocumentSubmissionFragment hmlDocumentSubmissionFragment) {
C14957gcv.e(hmlDocumentSubmissionFragment, "");
C5668bxR c5668bxR = hmlDocumentSubmissionFragment.presenter;
EnumC5550bvF enumC5550bvF = null;
if (c5668bxR == null) {
C14957gcv.a("");
c5668bxR = null;
}
String str = Build.MODEL;
C14957gcv.c((Object) str, "");
C14957gcv.e(str, "");
EnumC5550bvF enumC5550bvF2 = c5668bxR.a;
if (enumC5550bvF2 != null) {
enumC5550bvF = enumC5550bvF2;
} else {
C14957gcv.a("");
}
int i = C5668bxR.Sts.b[enumC5550bvF.ordinal()];
if (i != 1) {
if (i == 2) {
C15755iM c15755iM = c5668bxR.b;
C5668bxR.HBt hBt = new C5668bxR.HBt(c5668bxR);
C5668bxR.IeS ieS = new C5668bxR.IeS(c5668bxR);
C14957gcv.e(hBt, "");
C14957gcv.e(ieS, "");
C14957gcv.e(str, "");
c15755iM.c.d(hBt, ieS, new YNs.IeS(str), c15755iM.a);
return;
}
return;
}
if (c5668bxR.c) {
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.bxY
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9314dhR) obj).c();
}
};
if (c5668bxR.f != 0) {
ieS2.e(c5668bxR.f);
return;
}
return;
}
ZI.IeS ieS3 = new ZI.IeS() { // from class: o.bxW
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9314dhR) obj).a();
}
};
if (c5668bxR.f != 0) {
ieS3.e(c5668bxR.f);
}
}
private final void i() {
requireContext();
GridLayoutManager gridLayoutManager = new GridLayoutManager(2, (byte) 0);
HmlDocumentSubmissionAdapter hmlDocumentSubmissionAdapter = new HmlDocumentSubmissionAdapter(this);
gridLayoutManager.a = new LWm(hmlDocumentSubmissionAdapter);
this.c = hmlDocumentSubmissionAdapter;
RecyclerView recyclerView = this.documentRecyclerView;
Button button = null;
if (recyclerView == null) {
C14957gcv.a("");
recyclerView = null;
}
recyclerView.setLayoutManager(gridLayoutManager);
recyclerView.setAdapter(this.c);
Button button2 = this.submissionButton;
if (button2 != null) {
button = button2;
} else {
C14957gcv.a("");
}
button.setOnClickListener(new View.OnClickListener(this) { // from class: o.ffj
private HmlDocumentSubmissionFragment d;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
HmlDocumentSubmissionFragment.d(this.d);
}
{
this.d = this;
}
});
}
public String g() {
return "etb";
}
}