package com.scb.phone.view.fragment.ndid; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.res.ColorStateList; import android.content.res.Resources; import android.os.Bundle; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.TextView; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.fragment.app.FragmentActivity; import butterknife.BindView; import butterknife.ButterKnife; import com.scb.phone.R; import com.scb.phone.view.activity.BaseActivity; import com.scb.phone.view.activity.cardmanagement.deejungtransfer.DeejungTermsAndConditionsActivity; import com.scb.phone.view.activity.ndid.NdidIdpMenuSuccessActivity; import com.scb.phone.view.activity.prelogin.PinLoginActivity; import com.scb.phone.view.custom.common.CustomDialog; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.ndid.NdidIdpServiceStatusFragment; import o.AbstractC14961gcz; import o.C11560ehe; import o.C14866gag; import o.C14957gcv; import o.C4386bYm; import o.Heg; import o.InterfaceC0834Plv; import o.InterfaceC13391fZD; import o.InterfaceC14890gbN; import o.InterfaceC9426djX; import o.ZI; import o.fKB; import o.huo; import o.nMh; /* loaded from: classes5.dex */ public final class NdidIdpServiceStatusFragment extends Hilt_NdidIdpServiceStatusFragment implements InterfaceC9426djX.HBt { public static final Sts d = new Sts(0); @BindView public Button btNext; private huo c; @BindView public CheckBox checkBoxTermsConditions; @BindView public ImageView ivNdidEnroll; @BindView public ImageView ivNdidNotEnroll; @BindView public ConstraintLayout layoutTermsAndCond; @InterfaceC13391fZD public C4386bYm presenter; @BindView public TextView tvStatusDescription; @BindView public TextView tvStatusHeader; @BindView public TextView tvTermsConditions; @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); View inflate = layoutInflater.inflate(R.layout.2131559781, viewGroup, false); ((BaseFragment) this).a = ButterKnife.c(this, inflate); return inflate; } @Override // androidx.fragment.app.Fragment public final void onViewCreated(View view, Bundle bundle) { final String string; C14957gcv.e(view, ""); super.onViewCreated(view, bundle); C4386bYm c4386bYm = this.presenter; C4386bYm c4386bYm2 = null; if (c4386bYm == null) { C14957gcv.a(""); c4386bYm = null; } c4386bYm.e((C4386bYm) this); Bundle arguments = getArguments(); if (arguments != null && (string = arguments.getString("EXTRA_ENROLLED_STATUS")) != null) { C4386bYm c4386bYm3 = this.presenter; if (c4386bYm3 != null) { c4386bYm2 = c4386bYm3; } else { C14957gcv.a(""); } C14957gcv.e(string, ""); ZI.IeS ieS = new ZI.IeS(string) { // from class: o.bYn private String c; @Override // o.ZI.IeS public final void e(Object obj) { C4386bYm.b(this.c, (InterfaceC9426djX.HBt) obj); } { this.c = string; } }; if (c4386bYm2.f != 0) { ieS.e(c4386bYm2.f); } } huo registerForActivityResult = registerForActivityResult(new C11560ehe.Sts(), new InterfaceC0834Plv(this) { // from class: o.foJ private NdidIdpServiceStatusFragment e; @Override // o.InterfaceC0834Plv public final void d(Object obj) { NdidIdpServiceStatusFragment.b(this.e, (Heg) obj); } { this.e = this; } }); C14957gcv.c(registerForActivityResult, ""); this.c = registerForActivityResult; } @Override // o.InterfaceC9426djX.HBt public final void a() { ImageView imageView = this.ivNdidEnroll; Button button = null; if (imageView == null) { C14957gcv.a(""); imageView = null; } imageView.setVisibility(0); TextView textView = this.tvStatusHeader; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(getString(R.string.ndid_service_status_enrolled_header)); TextView textView2 = this.tvStatusDescription; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setText(getString(R.string.ndid_service_status_enrolled_description)); Button button2 = this.btNext; if (button2 != null) { button = button2; } else { C14957gcv.a(""); } button.setBackgroundTintList(ColorStateList.valueOf(nMh.getColor(button.getContext(), R.color.f13582131100866))); button.setText(getString(R.string.ndid_service_status_unenroll_button)); button.setOnClickListener(new View.OnClickListener(this) { // from class: o.foy private NdidIdpServiceStatusFragment d; @Override // android.view.View.OnClickListener public final void onClick(View view) { NdidIdpServiceStatusFragment.d(this.d); } { this.d = this; } }); } @Override // o.InterfaceC9426djX.HBt public final void c() { ImageView imageView = this.ivNdidNotEnroll; TextView textView = null; if (imageView == null) { C14957gcv.a(""); imageView = null; } imageView.setVisibility(0); ConstraintLayout constraintLayout = this.layoutTermsAndCond; if (constraintLayout == null) { C14957gcv.a(""); constraintLayout = null; } constraintLayout.setVisibility(0); TextView textView2 = this.tvStatusHeader; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setText(getString(R.string.ndid_service_status_not_enroll_header)); TextView textView3 = this.tvStatusDescription; if (textView3 == null) { C14957gcv.a(""); textView3 = null; } textView3.setText(getString(R.string.ndid_service_status_not_enroll_description)); Button button = this.btNext; if (button == null) { C14957gcv.a(""); button = null; } button.setText(getString(R.string.ndid_service_status_enroll_button)); button.setEnabled(false); button.setOnClickListener(new View.OnClickListener(this) { // from class: o.foA private NdidIdpServiceStatusFragment c; @Override // android.view.View.OnClickListener public final void onClick(View view) { NdidIdpServiceStatusFragment.a(this.c); } { this.c = this; } }); CheckBox checkBox = this.checkBoxTermsConditions; if (checkBox == null) { C14957gcv.a(""); checkBox = null; } checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(this) { // from class: o.foF private NdidIdpServiceStatusFragment e; @Override // android.widget.CompoundButton.OnCheckedChangeListener public final void onCheckedChanged(CompoundButton compoundButton, boolean z) { NdidIdpServiceStatusFragment.e(this.e, z); } { this.e = this; } }); Resources resources = getResources(); C14957gcv.c(resources, ""); String string = getString(R.string.ndid_service_status_terms_and_conditions_clickable); C14957gcv.c((Object) string, ""); String string2 = getString(R.string.ndid_service_status_terms_and_conditions_not_clickable_start); C14957gcv.c((Object) string2, ""); String string3 = getString(R.string.ndid_service_status_terms_and_conditions_not_clickable_end); C14957gcv.c((Object) string3, ""); CharSequence azW_ = fKB.azW_(resources, string, string2, string3, true, 0, new RVV(this), 96); TextView textView4 = this.tvTermsConditions; if (textView4 != null) { textView = textView4; } else { C14957gcv.a(""); } textView.setText(azW_); textView.setMovementMethod(LinkMovementMethod.getInstance()); textView.setHighlightColor(0); } /* loaded from: classes5.dex */ static final class RVV extends AbstractC14961gcz implements InterfaceC14890gbN { private NdidIdpServiceStatusFragment b; @Override // o.InterfaceC14890gbN public final /* synthetic */ C14866gag invoke() { C4386bYm c4386bYm = this.b.presenter; if (c4386bYm == null) { C14957gcv.a(""); c4386bYm = null; } final String W = this.b.W(); C14957gcv.c((Object) W, ""); C14957gcv.e(W, ""); ZI.IeS ieS = new ZI.IeS(W) { // from class: o.bYo private String e; @Override // o.ZI.IeS public final void e(Object obj) { C4386bYm.d(this.e, (InterfaceC9426djX.HBt) obj); } { this.e = W; } }; if (c4386bYm.f != 0) { ieS.e(c4386bYm.f); } return C14866gag.c; } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ RVV(NdidIdpServiceStatusFragment ndidIdpServiceStatusFragment) { super(0); this.b = ndidIdpServiceStatusFragment; } } @Override // o.InterfaceC9426djX.HBt public final void e(String str) { C14957gcv.e(str, ""); FragmentActivity activity = getActivity(); if (activity != null) { DeejungTermsAndConditionsActivity.RVV rvv = DeejungTermsAndConditionsActivity.b; FragmentActivity fragmentActivity = activity; C14957gcv.e(fragmentActivity, ""); Intent intent = new Intent(fragmentActivity, (Class) DeejungTermsAndConditionsActivity.class); intent.putExtra("EXTRA_DEEJUNG_TERMS_AND_CONDITIONS_URL", str); startActivity(intent); } } @Override // o.InterfaceC9426djX.HBt public final void b(String str, String str2) { C14957gcv.e(str, ""); C14957gcv.e(str2, ""); Context context = getContext(); if (context != null) { NdidIdpMenuSuccessActivity.IeS ieS = NdidIdpMenuSuccessActivity.l; C14957gcv.e(context, ""); C14957gcv.e(str, ""); C14957gcv.e(str2, ""); Intent intent = new Intent(context, (Class) NdidIdpMenuSuccessActivity.class); intent.putExtra("submit_date_time", str); intent.putExtra("register_status", str2); startActivity(intent); } FragmentActivity activity = getActivity(); if (activity != null) { activity.finish(); } } @Override // o.InterfaceC9426djX.HBt public final void d() { Intent intent = (Intent) PinLoginActivity.c(new Object[]{getContext()}, -1331046698, 1331046709, (int) System.currentTimeMillis()); huo huoVar = this.c; if (huoVar == null) { C14957gcv.a(""); huoVar = null; } huoVar.d(intent, null); if (getActivity() instanceof BaseActivity) { FragmentActivity activity = getActivity(); C14957gcv.d(activity, ""); ((BaseActivity) activity).ae(); } } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroy() { C4386bYm c4386bYm = this.presenter; huo huoVar = null; if (c4386bYm == null) { C14957gcv.a(""); c4386bYm = null; } c4386bYm.w_(); huo huoVar2 = this.c; if (huoVar2 == null) { C14957gcv.a(""); } else { huoVar = huoVar2; } huoVar.e(); super.onDestroy(); } /* loaded from: classes5.dex */ public static final class Sts { private Sts() { } public /* synthetic */ Sts(byte b) { this(); } } public static /* synthetic */ void d(final NdidIdpServiceStatusFragment ndidIdpServiceStatusFragment) { C14957gcv.e(ndidIdpServiceStatusFragment, ""); ((CustomDialog) CustomDialog.e(new Object[]{CustomDialog.b(ndidIdpServiceStatusFragment.getContext()).c(R.string.ndid_service_status_confirm_title).d(R.string.ndid_service_status_confirm_description).aoT_(R.string.ndid_service_status_confirm, new DialogInterface.OnClickListener(ndidIdpServiceStatusFragment) { // from class: o.foH private NdidIdpServiceStatusFragment b; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { NdidIdpServiceStatusFragment.e(this.b); } { this.b = ndidIdpServiceStatusFragment; } }), Integer.valueOf(R.string.ndid_service_status_cancel), new DialogInterface.OnClickListener() { // from class: o.foI @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }})).show(); } public static /* synthetic */ void a(NdidIdpServiceStatusFragment ndidIdpServiceStatusFragment) { C14957gcv.e(ndidIdpServiceStatusFragment, ""); C4386bYm c4386bYm = ndidIdpServiceStatusFragment.presenter; if (c4386bYm == null) { C14957gcv.a(""); c4386bYm = null; } c4386bYm.d("Registered"); } public static /* synthetic */ void e(NdidIdpServiceStatusFragment ndidIdpServiceStatusFragment, boolean z) { C14957gcv.e(ndidIdpServiceStatusFragment, ""); Button button = ndidIdpServiceStatusFragment.btNext; if (button == null) { C14957gcv.a(""); button = null; } button.setEnabled(z); } public static /* synthetic */ void e(NdidIdpServiceStatusFragment ndidIdpServiceStatusFragment) { C14957gcv.e(ndidIdpServiceStatusFragment, ""); C4386bYm c4386bYm = ndidIdpServiceStatusFragment.presenter; if (c4386bYm == null) { C14957gcv.a(""); c4386bYm = null; } c4386bYm.d("Unregistered"); } public static /* synthetic */ void b(NdidIdpServiceStatusFragment ndidIdpServiceStatusFragment, Heg heg) { C14957gcv.e(ndidIdpServiceStatusFragment, ""); if (heg.e == -1) { C4386bYm c4386bYm = ndidIdpServiceStatusFragment.presenter; if (c4386bYm == null) { C14957gcv.a(""); c4386bYm = null; } c4386bYm.d((String) null); return; } if (heg.e == 0) { ndidIdpServiceStatusFragment.ar_(); } } }