what-the-bank/sources/com/scb/phone/view/fragment/investment/select/SelectInvestmentFragment.java

312 lines
9.7 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.investment.select;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.huawei.hms.support.api.entity.common.CommonConstant;
import com.scb.phone.R;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.activity.bond.BondLandingActivity;
import com.scb.phone.view.activity.investment.InvestmentDetailsActivity;
import com.scb.phone.view.activity.investment.MutualFundsDataSharingTCActivity;
import com.scb.phone.view.activity.investment.onboarding.FundOnboardingLandingActivity;
import com.scb.phone.view.activity.investment.roboadvisor.RoboAdvisorLandingActivity;
import com.scb.phone.view.activity.investment.scbs.AddAccountInfoActivity;
import com.scb.phone.view.activity.investment.scbs.ScbsDataSharingTCActivity;
import com.scb.phone.view.activity.investment.scbs.ScbsLandingActivity;
import com.scb.phone.view.activity.prelogin.PinLoginActivity;
import com.scb.phone.view.activity.tc.MutualFundTermsAndConditionsActivity;
import com.scb.phone.view.fragment.BaseFragment;
import o.BzM;
import o.C3939bLb;
import o.C8064dAG;
import o.FI;
import o.InterfaceC13391fZD;
import o.YIo;
import o.ZI;
import o.bKN;
import o.cXH;
import o.cZG;
import o.eXH;
import o.guQ;
/* loaded from: classes5.dex */
public class SelectInvestmentFragment extends Hilt_SelectInvestmentFragment implements cZG.ZqN {
@BindView
RelativeLayout debentureLayout;
@BindView
RelativeLayout purchaseBondDltLayout;
@BindView
RelativeLayout purchaseBondScbLayout;
@InterfaceC13391fZD
public bKN selectInvestmentPresenter;
private BzM d = new BzM();
private eXH c = new eXH();
public static SelectInvestmentFragment m() {
return new SelectInvestmentFragment();
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559905, viewGroup, false);
((BaseFragment) this).a = ButterKnife.c(this, inflate);
this.selectInvestmentPresenter.e((bKN) this);
return inflate;
}
@Override // androidx.fragment.app.Fragment
public void onViewCreated(View view, Bundle bundle) {
YIo yIo;
YIo yIo2;
YIo yIo3;
super.onViewCreated(view, bundle);
bKN bkn = this.selectInvestmentPresenter;
C8064dAG a = bkn.a.b.a();
boolean z = false;
boolean z2 = (a == null || (yIo3 = a.r) == null) ? false : yIo3.l;
ZI.IeS ieS = new ZI.IeS() { // from class: o.bKP
@Override // o.ZI.IeS
public final void e(Object obj) {
((cZG.ZqN) obj).i();
}
};
if (z2 && bkn.f != 0) {
ieS.e(bkn.f);
}
C8064dAG a2 = bkn.b.b.c.a();
boolean z3 = (a2 == null || (yIo2 = a2.r) == null) ? false : yIo2.S;
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.bKY
@Override // o.ZI.IeS
public final void e(Object obj) {
((cZG.ZqN) obj).o();
}
};
if (z3 && bkn.f != 0) {
ieS2.e(bkn.f);
}
C8064dAG a3 = bkn.b.b.c.a();
if (a3 != null && (yIo = a3.r) != null) {
z = yIo.R;
}
ZI.IeS ieS3 = new ZI.IeS() { // from class: o.bLc
@Override // o.ZI.IeS
public final void e(Object obj) {
((cZG.ZqN) obj).l();
}
};
if (!z || bkn.f == 0) {
return;
}
ieS3.e(bkn.f);
}
@Override // o.cZG.ZqN
public final void i() {
this.debentureLayout.setVisibility(0);
}
@Override // o.cZG.ZqN
public final void o() {
this.purchaseBondScbLayout.setVisibility(0);
}
@Override // o.cZG.ZqN
public final void l() {
this.purchaseBondDltLayout.setVisibility(0);
}
@Override // o.cZG.ZqN
public final void h() {
Context context = getContext();
if (context != null) {
startActivity(ScbsDataSharingTCActivity.ahF_(context));
}
}
@OnClick
public void onClickMutualFund() {
this.d.d("feature", "fund");
BzM bzM = this.d;
if (getActivity() != null) {
bzM.c(((BaseActivity) getActivity()).scbAnalytics, "investment_landing_bs");
}
bKN bkn = this.selectInvestmentPresenter;
bkn.c = bKN.HBt.MUTUAL_FUND;
C3939bLb c3939bLb = new C3939bLb();
if (bkn.f != 0) {
c3939bLb.e(bkn.f);
}
}
@OnClick
public void onClickScbsInvestment() {
this.d.d("feature", "scbsinvestment");
BzM bzM = this.d;
if (getActivity() != null) {
bzM.c(((BaseActivity) getActivity()).scbAnalytics, "investment_landing_bs");
}
bKN bkn = this.selectInvestmentPresenter;
bkn.c = bKN.HBt.SCBS_INVESTMENT;
C3939bLb c3939bLb = new C3939bLb();
if (bkn.f != 0) {
c3939bLb.e(bkn.f);
}
}
@OnClick
public void onClickPurchaseBondScb() {
this.d.d("feature", "bond");
BzM bzM = this.d;
if (getActivity() != null) {
bzM.c(((BaseActivity) getActivity()).scbAnalytics, "investment_landing_bs");
}
this.selectInvestmentPresenter.d(cXH.IeS.EnumC0105IeS.SCB);
}
@OnClick
public void onClickPurchaseBondDlt() {
this.d.d("feature", "bond");
BzM bzM = this.d;
if (getActivity() != null) {
bzM.c(((BaseActivity) getActivity()).scbAnalytics, "investment_landing_bs");
}
this.selectInvestmentPresenter.d(cXH.IeS.EnumC0105IeS.DLT);
}
@OnClick
public void onClickDebenture() {
this.d.d("feature", "debenture");
BzM bzM = this.d;
if (getActivity() != null) {
bzM.c(((BaseActivity) getActivity()).scbAnalytics, "investment_landing_bs");
}
bKN bkn = this.selectInvestmentPresenter;
bkn.c = bKN.HBt.DEBENTURE;
C3939bLb c3939bLb = new C3939bLb();
if (bkn.f != 0) {
c3939bLb.e(bkn.f);
}
}
@OnClick
public void onClickRoboAdvisor() {
this.d.d("feature", "roboadvisor");
BzM bzM = this.d;
if (getActivity() != null) {
bzM.c(((BaseActivity) getActivity()).scbAnalytics, "investment_landing_bs");
}
bKN bkn = this.selectInvestmentPresenter;
bkn.c = bKN.HBt.ROBO_ADVISOR;
C3939bLb c3939bLb = new C3939bLb();
if (bkn.f != 0) {
c3939bLb.e(bkn.f);
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
super.onDestroy();
this.selectInvestmentPresenter.w_();
}
@Override // o.cZG.ZqN
public final void d() {
startActivity(new Intent(getContext(), (Class<?>) InvestmentDetailsActivity.class));
}
@Override // o.cZG.ZqN
public final void e() {
MutualFundTermsAndConditionsActivity.d(requireContext());
}
@Override // o.cZG.ZqN
public final void c() {
startActivity(new Intent(getContext(), (Class<?>) FundOnboardingLandingActivity.class));
}
@Override // o.cZG.ZqN
public final void d(FI fi, cXH.IeS.EnumC0105IeS enumC0105IeS) {
if (getContext() != null) {
startActivity(BondLandingActivity.Yw_(getContext(), fi, enumC0105IeS));
}
}
@Override // o.cZG.ZqN
public final void c(String str) {
try {
eXH exh = this.c;
if (getActivity() != null) {
exh.c(((BaseActivity) getActivity()).scbAnalytics, "debenture_web_loaded");
}
Intent intent = new Intent(CommonConstant.ACTION.HWID_SCHEME_URL, Uri.parse(str));
intent.putExtra("IS_NEED_HISTORY_STACK", true);
startActivity(intent);
} catch (ActivityNotFoundException | NullPointerException e) {
guQ.e(e);
}
}
@Override // o.cZG.ZqN
public final void f() {
startActivity(RoboAdvisorLandingActivity.ahv_(requireContext()));
}
@Override // o.cZG.ZqN
public final void b() {
if (getContext() != null) {
MutualFundsDataSharingTCActivity.e(getContext());
}
}
@Override // o.cZG.ZqN
public final void g() {
AddAccountInfoActivity.b(requireContext());
}
@Override // o.cZG.ZqN
public final void j() {
startActivity(ScbsLandingActivity.ahH_(getContext()));
}
@Override // o.cZG.ZqN
public final void k() {
this.selectInvestmentPresenter.c(R.string.error_generic_resource);
}
@Override // o.cZG.ZqN
public final void a() {
if (getActivity() instanceof BaseActivity) {
BaseActivity baseActivity = (BaseActivity) getActivity();
if (!baseActivity.X() || baseActivity.z_()) {
startActivityForResult((Intent) PinLoginActivity.c(new Object[]{getContext()}, 117128045, -117128019, (int) System.currentTimeMillis()), 1111);
baseActivity.ae();
} else {
this.selectInvestmentPresenter.a();
}
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
if (i == 1111 && i2 == -1) {
this.selectInvestmentPresenter.a();
} else {
super.onActivityResult(i, i2, intent);
}
}
}