what-the-bank/sources/com/scb/phone/view/fragment/additionaldocument/HmlApiBasedDocumentInstruct...

246 lines
8.6 KiB
Java

package com.scb.phone.view.fragment.additionaldocument;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
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.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.custom.additionaldocument.DocumentInstructionsDetailCustomView;
import com.scb.phone.view.fragment.additionaldocument.HmlApiBasedDocumentInstructionsFragment;
import java.io.Serializable;
import o.C0397Fq;
import o.C0769Od;
import o.C12891fKc;
import o.C14866gag;
import o.C14957gcv;
import o.C2481afS;
import o.Hzp;
import o.Iiy;
import o.InterfaceC13391fZD;
import o.InterfaceC9023dbr;
import o.ZI;
import o.nMh;
import o.zuu;
/* loaded from: classes5.dex */
public final class HmlApiBasedDocumentInstructionsFragment extends Hilt_HmlApiBasedDocumentInstructionsFragment implements InterfaceC9023dbr {
@BindView
public TextView descriptionText;
@BindView
public LinearLayout detailsList;
@BindView
public TextView headerText;
@BindView
public Button nextButton;
@InterfaceC13391fZD
public C2481afS<InterfaceC9023dbr> presenter;
@BindView
public ImageView thumbnail;
/* loaded from: classes5.dex */
public static final class LWm {
public static final LWm e = new LWm();
private LWm() {
}
public static HmlApiBasedDocumentInstructionsFragment b(boolean z, Hzp hzp, String str, Iiy iiy) {
C14957gcv.e(hzp, "");
C14957gcv.e(str, "");
C14957gcv.e(iiy, "");
Bundle bundle = new Bundle();
bundle.putBoolean("SHOW_NEXT_BUTTON_KEY", z);
bundle.putSerializable("UPLOAD_METHOD", hzp);
bundle.putSerializable("CAMERA_TYPE", iiy);
bundle.putString("DOCUMENT_CODE", str);
HmlApiBasedDocumentInstructionsFragment hmlApiBasedDocumentInstructionsFragment = new HmlApiBasedDocumentInstructionsFragment();
hmlApiBasedDocumentInstructionsFragment.setArguments(bundle);
return hmlApiBasedDocumentInstructionsFragment;
}
}
@Override // androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
View inflate = layoutInflater.inflate(R.layout.2131559811, viewGroup, false);
ButterKnife.c(this, inflate);
if (getArguments() == null) {
throw new IllegalArgumentException("Expression 'arguments' must not be null");
}
Bundle arguments = getArguments();
if (arguments != null) {
C2481afS<InterfaceC9023dbr> c2481afS = this.presenter;
Button button = null;
if (c2481afS == null) {
C14957gcv.a("");
c2481afS = null;
}
c2481afS.e((C2481afS<InterfaceC9023dbr>) this);
C2481afS<InterfaceC9023dbr> c2481afS2 = this.presenter;
if (c2481afS2 == null) {
C14957gcv.a("");
c2481afS2 = null;
}
Serializable serializable = arguments.getSerializable("UPLOAD_METHOD");
C14957gcv.d(serializable, "");
Hzp hzp = (Hzp) serializable;
Serializable serializable2 = arguments.getSerializable("CAMERA_TYPE");
C14957gcv.d(serializable2, "");
Iiy iiy = (Iiy) serializable2;
String string = arguments.getString("DOCUMENT_CODE");
C14957gcv.d(string, "");
C14957gcv.e(hzp, "");
C14957gcv.e(iiy, "");
C14957gcv.e(string, "");
c2481afS2.c = hzp;
c2481afS2.d = iiy;
if (c2481afS2.f != 0) {
c2481afS2.f.y();
}
c2481afS2.e.e(new C2481afS.RVV(c2481afS2), new C2481afS.IeS(c2481afS2), new zuu.HBt(string), new C2481afS.HBt(c2481afS2), c2481afS2.a);
Button button2 = this.nextButton;
if (button2 == null) {
C14957gcv.a("");
button2 = null;
}
button2.setVisibility(arguments.getBoolean("SHOW_NEXT_BUTTON_KEY") ? 0 : 8);
Button button3 = this.nextButton;
if (button3 != null) {
button = button3;
} else {
C14957gcv.a("");
}
button.setOnClickListener(new View.OnClickListener(this) { // from class: o.eGO
private HmlApiBasedDocumentInstructionsFragment e;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
HmlApiBasedDocumentInstructionsFragment.b(this.e);
}
{
this.e = this;
}
});
}
return inflate;
}
@Override // o.InterfaceC9023dbr
public final void b(Hzp hzp, Iiy iiy) {
C14957gcv.e(hzp, "");
C14957gcv.e(iiy, "");
FragmentActivity activity = getActivity();
if (activity != null) {
Intent intent = new Intent();
intent.putExtra("UPLOAD_METHOD", hzp);
intent.putExtra("CAMERA_TYPE", iiy);
C14866gag c14866gag = C14866gag.c;
activity.setResult(-1, intent);
activity.finish();
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroy() {
C2481afS<InterfaceC9023dbr> c2481afS = this.presenter;
if (c2481afS == null) {
C14957gcv.a("");
c2481afS = null;
}
c2481afS.w_();
super.onDestroy();
}
public static /* synthetic */ void b(HmlApiBasedDocumentInstructionsFragment hmlApiBasedDocumentInstructionsFragment) {
C14957gcv.e(hmlApiBasedDocumentInstructionsFragment, "");
final C2481afS<InterfaceC9023dbr> c2481afS = hmlApiBasedDocumentInstructionsFragment.presenter;
if (c2481afS == null) {
C14957gcv.a("");
c2481afS = null;
}
ZI.IeS ieS = new ZI.IeS(c2481afS) { // from class: o.afV
private C2481afS a;
@Override // o.ZI.IeS
public final void e(Object obj) {
C2481afS.b(this.a, (InterfaceC9023dbr) obj);
}
{
this.a = c2481afS;
}
};
if (c2481afS.f != 0) {
ieS.e(c2481afS.f);
}
}
@Override // o.InterfaceC9023dbr
public final void e(C0769Od c0769Od) {
C14957gcv.e(c0769Od, "");
u(c0769Od.e);
Context context = getContext();
if (context != null) {
LinearLayout linearLayout = this.detailsList;
ImageView imageView = null;
if (linearLayout == null) {
C14957gcv.a("");
linearLayout = null;
}
linearLayout.removeAllViews();
for (C0397Fq c0397Fq : c0769Od.c) {
LinearLayout linearLayout2 = this.detailsList;
if (linearLayout2 == null) {
C14957gcv.a("");
linearLayout2 = null;
}
linearLayout2.addView(new DocumentInstructionsDetailCustomView(context, c0397Fq));
Context context2 = getContext();
LinearLayout linearLayout3 = this.detailsList;
if (linearLayout3 == null) {
C14957gcv.a("");
linearLayout3 = null;
}
View.inflate(context2, R.layout.2131559335, linearLayout3);
}
TextView textView = this.headerText;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setVisibility(8);
TextView textView2 = this.descriptionText;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setText(c0769Od.b.e);
Drawable drawable = nMh.getDrawable(context, R.drawable.document_thumbnail_placeholder);
ImageView imageView2 = this.thumbnail;
if (imageView2 != null) {
imageView = imageView2;
} else {
C14957gcv.a("");
}
C12891fKc.azn_(drawable, imageView, c0769Od.b.a);
}
}
}