what-the-bank/sources/com/scb/phone/view/fragment/ndid/NdidInstructionFragment.java

338 lines
13 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.ndid;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
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.fragment.app.FragmentActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.pingan.ai.face.common.PaFaceConstants;
import com.scb.phone.R;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.activity.demo.ntb.NTBLandingActivity;
import com.scb.phone.view.activity.facialrecognition.FacialVerificationLockedActivity;
import com.scb.phone.view.activity.ndid.NdidNationalIdInputActivity;
import com.scb.phone.view.activity.ndid.NdidSelectIdpActivity;
import com.scb.phone.view.activity.ndid.RpLivenessCheckActivity;
import com.scb.phone.view.custom.common.CustomDialog;
import com.scb.phone.view.fragment.ndid.NdidInstructionFragment;
import java.util.ArrayList;
import java.util.List;
import o.C;
import o.C0977Su;
import o.C14249fpe;
import o.C4414bZh;
import o.C4417bZk;
import o.C4420bZn;
import o.IFW;
import o.InterfaceC13391fZD;
import o.InterfaceC9486dke;
import o.QKH;
import o.cXH;
import o.fIY;
/* loaded from: classes5.dex */
public class NdidInstructionFragment extends Hilt_NdidInstructionFragment implements InterfaceC9486dke {
@BindView
protected Button buttonNext;
private fIY.RVV d;
@BindView
protected ImageView livenessCheckedIcon;
@BindView
protected ImageView livenessIcon;
@BindView
protected ImageView livenessIndicator;
@BindView
protected TextView livenessText;
@InterfaceC13391fZD
public C4414bZh presenter;
@BindView
protected ImageView scanIdCheckedIcon;
@BindView
protected ImageView scanIdIcon;
@BindView
protected ImageView scanIdIndicator;
@BindView
protected TextView scanIdText;
@BindView
protected ImageView verifyingPartnerCheckedIcon;
@BindView
protected ImageView verifyingPartnerIcon;
@BindView
protected ImageView verifyingPartnerIndicator;
@BindView
protected TextView verifyingPartnerText;
protected int h() {
return R.string.ntb_pop_up_message_exit;
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.ndid.Hilt_NdidInstructionFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof fIY.RVV) {
this.d = (fIY.RVV) context;
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559782, viewGroup, false);
ButterKnife.c(this, inflate);
Bundle arguments = getArguments();
String string = arguments != null ? arguments.getString("com.scb.phone.view.fragment.ndid.STAGE_TAG") : null;
this.d.m();
this.presenter.e((C4414bZh) this);
C4414bZh c4414bZh = this.presenter;
if (string != null && "RP_CID_VERIFIED".equals(string)) {
c4414bZh.b = cXH.HBt.EnumC0104HBt.VERIFYING_PARTNER_STATE;
} else if (string != null && "RP_PENDING".equals(string)) {
c4414bZh.b = cXH.HBt.EnumC0104HBt.PENDING_VERIFYING_PARTNER_STATE;
} else if (string != null && "RP_LIVENESS".equals(string)) {
c4414bZh.b = cXH.HBt.EnumC0104HBt.LIVENESS_CHECK_STATE;
}
C4420bZn c4420bZn = new C4420bZn(c4414bZh);
if (c4414bZh.f != 0) {
c4420bZn.e(c4414bZh.f);
}
C4417bZk c4417bZk = new C4417bZk(c4414bZh);
if (c4414bZh.f != 0) {
c4417bZk.e(c4414bZh.f);
}
return inflate;
}
protected Intent avX_() {
return new Intent(getActivity(), (Class<?>) NdidSelectIdpActivity.class);
}
protected Intent avY_(List<String> list) {
return NdidSelectIdpActivity.ajk_(getContext(), list);
}
@Override // o.InterfaceC9486dke
public final void f() {
startActivityForResult(avX_(), 1002);
}
@Override // o.InterfaceC9486dke
public final void g() {
ArrayList<String> arrayList = new ArrayList<>();
Bundle arguments = getArguments();
if (arguments != null) {
arrayList = arguments.getStringArrayList("com.scb.phone.view.fragment.ndid.EXTRA_REMARK");
}
startActivityForResult(avY_(arrayList), 1002);
}
public Intent avW_() {
return new Intent(getActivity(), (Class<?>) NdidNationalIdInputActivity.class);
}
@Override // o.InterfaceC9486dke
public final void d(cXH.HBt.EnumC0104HBt enumC0104HBt) {
this.scanIdText.setAlpha(enumC0104HBt == cXH.HBt.EnumC0104HBt.SCANNING_ID_STATE ? 1.0f : 0.4f);
this.verifyingPartnerText.setAlpha((enumC0104HBt == cXH.HBt.EnumC0104HBt.VERIFYING_PARTNER_STATE || enumC0104HBt == cXH.HBt.EnumC0104HBt.PENDING_VERIFYING_PARTNER_STATE) ? 1.0f : 0.4f);
this.livenessText.setAlpha(enumC0104HBt == cXH.HBt.EnumC0104HBt.LIVENESS_CHECK_STATE ? 1.0f : 0.4f);
this.scanIdIcon.setAlpha(enumC0104HBt == cXH.HBt.EnumC0104HBt.SCANNING_ID_STATE ? 1.0f : 0.4f);
this.verifyingPartnerIcon.setAlpha((enumC0104HBt == cXH.HBt.EnumC0104HBt.VERIFYING_PARTNER_STATE || enumC0104HBt == cXH.HBt.EnumC0104HBt.PENDING_VERIFYING_PARTNER_STATE || enumC0104HBt == cXH.HBt.EnumC0104HBt.SCANNING_ID_STATE) ? 1.0f : 0.4f);
this.livenessIcon.setAlpha(enumC0104HBt == cXH.HBt.EnumC0104HBt.FINISHED_FLOW_STATE ? 0.4f : 1.0f);
ImageView imageView = this.scanIdIndicator;
cXH.HBt.EnumC0104HBt enumC0104HBt2 = cXH.HBt.EnumC0104HBt.SCANNING_ID_STATE;
int i = R.drawable.circle_indicator_purple;
imageView.setImageResource(enumC0104HBt == enumC0104HBt2 ? R.drawable.circle_indicator_purple : R.drawable.shape_circle_white_purple_border);
this.verifyingPartnerIndicator.setImageResource((enumC0104HBt == cXH.HBt.EnumC0104HBt.VERIFYING_PARTNER_STATE || enumC0104HBt == cXH.HBt.EnumC0104HBt.PENDING_VERIFYING_PARTNER_STATE) ? R.drawable.circle_indicator_purple : R.drawable.shape_circle_white_purple_border);
ImageView imageView2 = this.livenessIndicator;
if (enumC0104HBt != cXH.HBt.EnumC0104HBt.LIVENESS_CHECK_STATE) {
i = R.drawable.shape_circle_white_purple_border;
}
imageView2.setImageResource(i);
this.scanIdCheckedIcon.setVisibility(enumC0104HBt != cXH.HBt.EnumC0104HBt.SCANNING_ID_STATE ? 0 : 8);
this.verifyingPartnerCheckedIcon.setVisibility((enumC0104HBt == cXH.HBt.EnumC0104HBt.VERIFYING_PARTNER_STATE || enumC0104HBt == cXH.HBt.EnumC0104HBt.PENDING_VERIFYING_PARTNER_STATE || enumC0104HBt == cXH.HBt.EnumC0104HBt.SCANNING_ID_STATE) ? 8 : 0);
this.livenessCheckedIcon.setVisibility(enumC0104HBt != cXH.HBt.EnumC0104HBt.FINISHED_FLOW_STATE ? 8 : 0);
this.buttonNext.setText(getString(enumC0104HBt == cXH.HBt.EnumC0104HBt.FINISHED_FLOW_STATE ? R.string.ekyc_submit_button_text : R.string.next_button));
}
@Override // o.InterfaceC9486dke
public final void e(String str) {
IFW ifw = new IFW();
ifw.b(str);
ifw.d("feature", i());
if (getActivity() != null) {
ifw.c(((BaseActivity) getActivity()).scbAnalytics, "ndid_rp_instructions");
}
}
@Override // o.InterfaceC9486dke
public final void d() {
startActivityForResult(RpLivenessCheckActivity.ajl_(getContext()), PaFaceConstants.MotionType.BLINK_EYE);
}
@Override // o.InterfaceC9486dke
public final void e() {
FragmentActivity activity = getActivity();
if (activity != null) {
activity.finish();
}
}
@Override // o.InterfaceC9486dke
public final void a() {
((CustomDialog) CustomDialog.e(new Object[]{CustomDialog.b(getContext()).c(R.string.ntb_pop_up_title_exit).d(h()), Integer.valueOf(R.string.cancel), new DialogInterface.OnClickListener() { // from class: o.foY
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}})).aoT_(R.string.ok, new DialogInterface.OnClickListener(this) { // from class: o.foW
private NdidInstructionFragment c;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
NdidInstructionFragment.avU_(this.c, dialogInterface);
}
{
this.c = this;
}
}).show();
}
@Override // o.InterfaceC9486dke
public final void c() {
if (getContext() != null) {
startActivity(FacialVerificationLockedActivity.afr_(getContext(), "NDID_RP"));
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
if (i2 == -1 && i == 1001 && intent.hasExtra("com.scb.phone.presentation.views.ndid.NdidNationalIdInputView.idDisplay")) {
C4414bZh c4414bZh = this.presenter;
if (((C0977Su) intent.getParcelableExtra("com.scb.phone.presentation.views.ndid.NdidNationalIdInputView.idDisplay")) != null) {
c4414bZh.b = cXH.HBt.EnumC0104HBt.VERIFYING_PARTNER_STATE;
C4420bZn c4420bZn = new C4420bZn(c4414bZh);
if (c4414bZh.f != 0) {
c4420bZn.e(c4414bZh.f);
}
C4417bZk c4417bZk = new C4417bZk(c4414bZh);
if (c4414bZh.f != 0) {
c4417bZk.e(c4414bZh.f);
return;
}
return;
}
return;
}
if (i2 == -1 && i == 1002) {
C4414bZh c4414bZh2 = this.presenter;
c4414bZh2.b = cXH.HBt.EnumC0104HBt.LIVENESS_CHECK_STATE;
C4420bZn c4420bZn2 = new C4420bZn(c4414bZh2);
if (c4414bZh2.f != 0) {
c4420bZn2.e(c4414bZh2.f);
}
C4417bZk c4417bZk2 = new C4417bZk(c4414bZh2);
if (c4414bZh2.f != 0) {
c4417bZk2.e(c4414bZh2.f);
return;
}
return;
}
if (i2 == -1 && i == 1003) {
C4414bZh c4414bZh3 = this.presenter;
c4414bZh3.b = cXH.HBt.EnumC0104HBt.FINISHED_FLOW_STATE;
C4420bZn c4420bZn3 = new C4420bZn(c4414bZh3);
if (c4414bZh3.f != 0) {
c4420bZn3.e(c4414bZh3.f);
}
C4417bZk c4417bZk3 = new C4417bZk(c4414bZh3);
if (c4414bZh3.f != 0) {
c4417bZk3.e(c4414bZh3.f);
}
}
}
@Override // androidx.fragment.app.Fragment
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
C14249fpe.c(this, i, iArr);
}
@Override // androidx.fragment.app.Fragment
public void onResume() {
super.onResume();
this.presenter.e = true;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.presenter.w_();
super.onDestroy();
}
public static /* synthetic */ void avU_(NdidInstructionFragment ndidInstructionFragment, DialogInterface dialogInterface) {
dialogInterface.dismiss();
FragmentActivity activity = ndidInstructionFragment.getActivity();
if (activity != null) {
Intent intent = new Intent(ndidInstructionFragment.getActivity(), (Class<?>) NTBLandingActivity.class);
intent.addFlags(603979776);
ndidInstructionFragment.startActivity(intent);
activity.finish();
}
}
@OnClick
public void onNextButtonClick() {
this.presenter.d(C.DEFAULT);
}
@Override // o.InterfaceC9486dke
public final void b() {
QKH qkh = new QKH();
qkh.e("ndid");
qkh.d("feature", i());
if (getActivity() != null) {
qkh.c(((BaseActivity) getActivity()).scbAnalytics, "ekyc_verifysuccess");
}
this.d.d();
}
@Override // o.InterfaceC9486dke
public final void j() {
if (getActivity() != null) {
if (BaseActivity.P()) {
C14249fpe.c(this);
return;
}
}
C14249fpe.a(this);
}
protected String i() {
return "open_account";
}
}