package com.scb.phone.view.fragment.accountsummary; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RelativeLayout; import androidx.viewpager.widget.ViewPager; import butterknife.ButterKnife; import com.scb.phone.R; import com.scb.phone.view.activity.investment.InvestmentDetailsActivity; import com.scb.phone.view.activity.investment.MutualFundsDataSharingTCActivity; import com.scb.phone.view.activity.investment.scbs.ScbsDataSharingTCActivity; import com.scb.phone.view.activity.investment.scbs.ScbsLandingActivity; import com.scb.phone.view.activity.tc.MutualFundTermsAndConditionsActivity; import com.scb.phone.view.adapter.accountsummary.InvestmentViewPagerAdapter; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.accountsummary.InvestmentFragment; import java.util.List; import o.C0375Fe; import o.C1025UIz; import o.C10457eEr; import o.C14957gcv; import o.C17764zak; import o.C2361adE; import o.C2364adH; import o.C2365adI; import o.Icn; import o.InterfaceC13154fSb; import o.InterfaceC13391fZD; import o.InterfaceC14894gbR; import o.InterfaceC6627cYe; import o.QD; import o.VDK; import o.ZI; import o.fHO; import o.fSQ; import o.glR; import o.wCR; import org.threeten.bp.OffsetDateTime; /* loaded from: classes5.dex */ public class InvestmentFragment extends Hilt_InvestmentFragment implements InterfaceC6627cYe.ZqN, InvestmentViewPagerAdapter.Sts { @InterfaceC13391fZD public C2361adE investmentPresenter; @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559440, viewGroup, false); ButterKnife.c(this, inflate); ((BaseFragment) this).b = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_SWIPE_REFRESH")).subscribe(new fSQ(this) { // from class: o.eFN private InvestmentFragment b; @Override // o.fSQ public final void c(Object obj) { r0.investmentPresenter.e(this.b.W()); } { this.b = this; } }, new fSQ() { // from class: o.eFM @Override // o.fSQ public final void c(Object obj) { guQ.a((Throwable) obj); } }); ((BaseCardFragment) this).d = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_HOME_ACTIVITY_REFRESH")).subscribe(new fSQ(this) { // from class: o.eFK private InvestmentFragment c; @Override // o.fSQ public final void c(Object obj) { r0.investmentPresenter.e(this.c.W()); } { this.c = this; } }, new fSQ() { // from class: o.eFM @Override // o.fSQ public final void c(Object obj) { guQ.a((Throwable) obj); } }); ((BaseCardFragment) this).j = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_REGISTERED_ACCOUNTS_UPDATED")).subscribe(new fSQ(this) { // from class: o.eFO private InvestmentFragment b; @Override // o.fSQ public final void c(Object obj) { r0.investmentPresenter.e(this.b.W()); } { this.b = this; } }, new fSQ() { // from class: o.eFM @Override // o.fSQ public final void c(Object obj) { guQ.a((Throwable) obj); } }); this.mViewPager.addOnPageChangeListener(new ViewPager.ojQ(this) { // from class: com.scb.phone.view.fragment.accountsummary.InvestmentFragment.2 private InvestmentFragment c; @Override // androidx.viewpager.widget.ViewPager.ojQ public final void onPageScrollStateChanged(int i) { } @Override // androidx.viewpager.widget.ViewPager.ojQ public final void onPageScrolled(int i, float f, int i2) { } { this.c = this; } @Override // androidx.viewpager.widget.ViewPager.ojQ public final void onPageSelected(int i) { C2361adE c2361adE = this.c.investmentPresenter; List list = c2361adE.d; if (list == null || list.isEmpty()) { return; } C2364adH c2364adH = new C2364adH(c2361adE, i); if (c2361adE.f != 0) { c2364adH.e(c2361adE.f); } } }); this.investmentPresenter.e((C2361adE) this); return inflate; } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onActivityCreated(Bundle bundle) { super.onActivityCreated(bundle); C2361adE c2361adE = this.investmentPresenter; String W = W(); if (c2361adE.b) { return; } c2361adE.b = true; C2365adI c2365adI = new C2365adI(); if (c2361adE.f != 0) { c2365adI.e(c2361adE.f); } wCR wcr = c2361adE.e; Object[] objArr = {wcr}; System.identityHashCode(wcr); wCR wcr2 = c2361adE.e; wcr2.d(wcr2.i, new C2361adE.LWm(c2361adE, W.equalsIgnoreCase("en"))); } @Override // com.scb.phone.view.fragment.accountsummary.BaseCardFragment, com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { if (((BaseCardFragment) this).d != null && !((BaseCardFragment) this).d.isDisposed()) { ((BaseCardFragment) this).d.dispose(); } if (((BaseCardFragment) this).j != null && !((BaseCardFragment) this).j.isDisposed()) { ((BaseCardFragment) this).j.dispose(); } this.investmentPresenter.w_(); super.onDestroy(); } @Override // o.InterfaceC6627cYe.ZqN public final void d() { if (this.mParentLayout != null) { this.mParentLayout.setVisibility(8); } } @Override // o.InterfaceC6627cYe.ZqN public final void d(List list) { if (getContext() != null) { this.mViewPager.setVisibility(0); this.mViewPager.setAdapter(new InvestmentViewPagerAdapter(getContext(), list, this)); b(list); RelativeLayout relativeLayout = this.mParentLayout; if (relativeLayout != null) { relativeLayout.setVisibility(0); } } } @Override // o.InterfaceC6627cYe.ZqN public final void g() { startActivity(ScbsLandingActivity.ahH_(getContext())); } @Override // o.InterfaceC6627cYe.ZqN public final void j() { startActivity(ScbsDataSharingTCActivity.ahF_(getContext())); } @Override // com.scb.phone.view.fragment.BaseFragment, o.InterfaceC6638cYp public final void u() { if (this.mSwipeRefreshLayout != null) { this.mSwipeRefreshLayout.setRefreshing(false); } else { C10457eEr.aqd_(this, new Intent("com.scb.phone/BROADCAST_HIDE_SWIPE_REFRESH")); } } @Override // com.scb.phone.view.adapter.accountsummary.InvestmentViewPagerAdapter.Sts public final void b(int i) { if (getContext() != null) { if (i != 0) { if (i == 1) { final C2361adE c2361adE = this.investmentPresenter; if (c2361adE.f != 0) { c2361adE.f.y(); } c2361adE.i.b(new InterfaceC14894gbR(c2361adE) { // from class: o.adT private C2361adE b; @Override // o.InterfaceC14894gbR public final Object invoke(Object obj) { return C2361adE.e(this.b, (Boolean) obj); } { this.b = c2361adE; } }, new InterfaceC14894gbR(c2361adE) { // from class: o.adG private C2361adE a; @Override // o.InterfaceC14894gbR public final Object invoke(Object obj) { return C2361adE.b(this.a, (Throwable) obj); } { this.a = c2361adE; } }); return; } return; } final C2361adE c2361adE2 = this.investmentPresenter; if (c2361adE2.h.c()) { c2361adE2.a(); return; } if (c2361adE2.f != 0) { c2361adE2.f.y(); } c2361adE2.g.d(new InterfaceC14894gbR(c2361adE2) { // from class: o.adF private C2361adE e; @Override // o.InterfaceC14894gbR public final Object invoke(Object obj) { return C2361adE.a(this.e, (Boolean) obj); } { this.e = c2361adE2; } }, new InterfaceC14894gbR(c2361adE2) { // from class: o.adJ private C2361adE b; @Override // o.InterfaceC14894gbR public final Object invoke(Object obj) { return C2361adE.e(this.b, (Throwable) obj); } { this.b = c2361adE2; } }); } } @Override // o.InterfaceC6627cYe.ZqN public final void a() { if (getContext() != null) { startActivity(InvestmentDetailsActivity.agP_(getContext())); } } @Override // o.InterfaceC6627cYe.ZqN public final void e() { if (getContext() != null) { MutualFundTermsAndConditionsActivity.d(getContext()); } } @Override // o.InterfaceC6627cYe.ZqN public final void b() { if (getContext() != null) { MutualFundsDataSharingTCActivity.e(getContext()); } } @Override // o.InterfaceC6627cYe.ZqN public final void d(int i) { ViewGroup.LayoutParams layoutParams = this.mViewPager.getLayoutParams(); layoutParams.height = getResources().getDimensionPixelOffset(i); this.mViewPager.setLayoutParams(layoutParams); } @Override // com.scb.phone.view.adapter.accountsummary.InvestmentViewPagerAdapter.Sts public final void c() { this.investmentPresenter.e(W()); } @Override // o.InterfaceC6627cYe.IeS public final void e(C0375Fe c0375Fe) { a(c0375Fe, new fHO(this, c0375Fe) { // from class: com.scb.phone.view.fragment.accountsummary.InvestmentFragment.1 private InvestmentFragment c; private C0375Fe e; { this.c = this; this.e = c0375Fe; } @Override // o.fHO public final void c() { C2361adE c2361adE = this.c.investmentPresenter; String str = this.e.b; c2361adE.k.b(new InterfaceC13154fSb(c2361adE, str, this.e.e) { // from class: o.adE.4 private C2361adE a; private String c; private String d; @Override // o.InterfaceC13154fSb public final void onSubscribe(fSJ fsj) { } { this.a = c2361adE; this.d = str; this.c = r3; } @Override // o.InterfaceC13154fSb public final void onComplete() { C2361adE c2361adE2 = this.a; final String str2 = this.d; final String str3 = this.c; ZI.IeS ieS = new ZI.IeS(str2, str3) { // from class: o.adO private String b; private String d; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6627cYe.ZqN) obj).c(this.b, this.d); } { this.b = str2; this.d = str3; } }; if (c2361adE2.f != 0) { ieS.e(c2361adE2.f); } } @Override // o.InterfaceC13154fSb public final void onError(Throwable th) { C2361adE.d(this.a, th); } }, new Icn.IeS(str), c2361adE.c); } @Override // o.fHO public final void a() { C2361adE c2361adE = this.c.investmentPresenter; final String str = this.e.d; final String str2 = this.e.b; final String str3 = this.e.e; if (str != null) { ZI.IeS ieS = new ZI.IeS(str, str2, str3) { // from class: o.adL private String a; private String b; private String d; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6627cYe.ZqN) obj).a(this.d, this.a, this.b); } { this.d = str; this.a = str2; this.b = str3; } }; if (c2361adE.f != 0) { ieS.e(c2361adE.f); } } } }); } @Override // o.InterfaceC6627cYe.IeS public final void c(String str, String str2) { d(str, str2); } @Override // o.InterfaceC6627cYe.IeS public final void a(String str, String str2, String str3) { C1025UIz c1025UIz = this.investmentPresenter.a; OffsetDateTime now = OffsetDateTime.now(); C14957gcv.c(now, ""); c1025UIz.b(new VDK(str3, "contextual_banner", str2, now)); C17764zak.HBt hBt = C17764zak.CREATOR; C14957gcv.e(str2, ""); C14957gcv.e(str3, ""); g(C17764zak.HBt.d(str2, str3, C17764zak.HBt.IeS.CLICK)); e(str); } }