package com.scb.phone.view.fragment.accountsummary; 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 android.widget.TextView; import androidx.fragment.app.FragmentActivity; import butterknife.BindView; import butterknife.ButterKnife; import com.scb.phone.R; import com.scb.phone.view.activity.PreLoadCheckActivity; import com.scb.phone.view.activity.deposit.DepositDetailActivity; import com.scb.phone.view.adapter.accountsummary.DepositViewPagerAdapter; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.accountsummary.DepositFragment; import java.util.ArrayList; import java.util.Collections; import java.util.List; import o.C0375Fe; import o.C0383Fi; import o.C0386Fk; import o.C1025UIz; import o.C14957gcv; import o.C16097lF; import o.C17764zak; import o.C2396adn; import o.C7968cyO; import o.Gdg; import o.Icn; import o.InterfaceC13154fSb; import o.InterfaceC13391fZD; import o.InterfaceC6627cYe; import o.JNE; import o.VDK; import o.WYJ; import o.ZI; import o.fHO; import o.fSQ; import o.gHK; import o.glR; import o.mSw; import o.nOO; import org.threeten.bp.OffsetDateTime; /* loaded from: classes5.dex */ public class DepositFragment extends Hilt_DepositFragment implements InterfaceC6627cYe.ojQ { @InterfaceC13391fZD public C2396adn depositPresenter; private DepositViewPagerAdapter h; @BindView protected View layoutEmptyAccount; @BindView protected TextView mTotalAmount; @BindView protected TextView titleAccounts; @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559438, 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.eFA private DepositFragment a; @Override // o.fSQ public final void c(Object obj) { this.a.depositPresenter.b(); } { this.a = this; } }, new fSQ() { // from class: o.eFI @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.eFJ private DepositFragment e; @Override // o.fSQ public final void c(Object obj) { this.e.depositPresenter.b(); } { this.e = this; } }, new fSQ() { // from class: o.eFI @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.eFG private DepositFragment e; @Override // o.fSQ public final void c(Object obj) { this.e.depositPresenter.b(); } { this.e = this; } }, new fSQ() { // from class: o.eFI @Override // o.fSQ public final void c(Object obj) { guQ.a((Throwable) obj); } }); this.depositPresenter.e((C2396adn) this); C2396adn c2396adn = this.depositPresenter; gHK al = getActivity() instanceof PreLoadCheckActivity ? ((PreLoadCheckActivity) getActivity()).al() : null; c2396adn.b = W(); if (gHK.JURISTIC == al) { ZI.IeS ieS = new ZI.IeS() { // from class: o.adl @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6627cYe.ojQ) obj).e(); } }; if (c2396adn.f != 0) { ieS.e(c2396adn.f); } } return inflate; } @Override // androidx.fragment.app.Fragment public void onResume() { List arrayList; super.onResume(); WYJ adapter = this.mViewPager.getAdapter(); DepositViewPagerAdapter depositViewPagerAdapter = this.h; if (adapter == depositViewPagerAdapter && depositViewPagerAdapter.b != null) { C2396adn c2396adn = this.depositPresenter; List list = this.h.b; nOO e = c2396adn.c.a.e(); if (e == null) { ZI.IeS ieS = new ZI.IeS() { // from class: o.adi @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6627cYe.ojQ) obj).aM_(); } }; if (c2396adn.f != 0) { ieS.e(c2396adn.f); return; } return; } if (list != null) { C16097lF c16097lF = c2396adn.a; C7968cyO p = c2396adn.c.b.p(); if (p == null) { arrayList = new ArrayList<>(); } else { arrayList = p.a; } if (list.equals(c16097lF.a(e, arrayList, c2396adn.c.b.T()).c())) { return; } c2396adn.d(e); return; } return; } if (this.mViewPager.getAdapter() == ((BaseCardFragment) this).c) { C2396adn c2396adn2 = this.depositPresenter; nOO e2 = c2396adn2.c.a.e(); if (e2 != null) { c2396adn2.d(e2); } } } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onActivityCreated(Bundle bundle) { super.onActivityCreated(bundle); C2396adn c2396adn = this.depositPresenter; if (c2396adn.i) { return; } c2396adn.i = true; if (c2396adn.f != 0) { c2396adn.f.v(); } c2396adn.c.c(); mSw msw = c2396adn.c; msw.d(msw.i, new C2396adn.Sts(c2396adn, "en".equalsIgnoreCase(c2396adn.b))); } @Override // com.scb.phone.view.fragment.accountsummary.BaseCardFragment, com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { C2396adn c2396adn = this.depositPresenter; if (c2396adn != null) { c2396adn.w_(); } super.onDestroy(); } @Override // o.InterfaceC6627cYe.ojQ public final void b(C0383Fi c0383Fi) { Gdg gdg; C2396adn c2396adn = this.depositPresenter; C7968cyO p = c2396adn.c.b.p(); if (p.a.isEmpty() && p.e.isEmpty() && p.f.isEmpty() && p.j.isEmpty() && p.i.isEmpty() && p.d.isEmpty() && p.g.isEmpty()) { C7968cyO p2 = c2396adn.c.b.p(); if (p2 == null) { gdg = new Gdg(false, false); } else { gdg = p2.h; } if (!gdg.b) { e(new DepositViewPagerAdapter(getActivity(), Collections.emptyList(), getActivity() instanceof PreLoadCheckActivity ? ((PreLoadCheckActivity) getActivity()).al() : null)); this.mTotalAmount.setText(""); this.layoutEmptyAccount.setVisibility(0); return; } } this.mViewPager.setVisibility(0); this.layoutEmptyAccount.setVisibility(8); if (c0383Fi.c().isEmpty()) { RelativeLayout relativeLayout = this.mParentLayout; if (relativeLayout != null) { relativeLayout.setVisibility(8); return; } return; } this.mTotalAmount.setText(c0383Fi.b() != null ? c0383Fi.b() : ""); DepositViewPagerAdapter depositViewPagerAdapter = new DepositViewPagerAdapter(getActivity(), c0383Fi.c(), getActivity() instanceof PreLoadCheckActivity ? ((PreLoadCheckActivity) getActivity()).al() : null); this.h = depositViewPagerAdapter; depositViewPagerAdapter.d = this.depositPresenter; this.mViewPager.setAdapter(this.h); this.mViewPager.setClipToPadding(false); this.mViewPager.setPadding(getResources().getDimensionPixelOffset(R.dimen.f28542131166620), 0, getResources().getDimensionPixelOffset(R.dimen.f28542131166620), 0); b(c0383Fi.c()); RelativeLayout relativeLayout2 = this.mParentLayout; if (relativeLayout2 != null) { relativeLayout2.setVisibility(0); } } @Override // com.scb.phone.view.fragment.accountsummary.BaseCardFragment, com.scb.phone.view.fragment.BaseFragment, o.InterfaceC6638cYp public final void v() { FragmentActivity activity = getActivity(); if (activity != null) { this.mViewPager.setVisibility(0); this.layoutEmptyAccount.setVisibility(8); DepositViewPagerAdapter depositViewPagerAdapter = new DepositViewPagerAdapter(activity, Collections.emptyList(), getActivity() instanceof PreLoadCheckActivity ? ((PreLoadCheckActivity) getActivity()).al() : null); e(depositViewPagerAdapter); depositViewPagerAdapter.a = true; depositViewPagerAdapter.notifyDataSetChanged(); } } @Override // com.scb.phone.view.fragment.accountsummary.BaseCardFragment, o.InterfaceC6627cYe.HBt public final void aM_() { FragmentActivity activity = getActivity(); if (activity != null) { e(new DepositViewPagerAdapter(activity, Collections.singletonList(C0386Fk.c()), getActivity() instanceof PreLoadCheckActivity ? ((PreLoadCheckActivity) getActivity()).al() : null)); } this.h = null; } @Override // o.InterfaceC6627cYe.ojQ public final void b(int i, List list, C0383Fi c0383Fi) { startActivity(DepositDetailActivity.adW_(getContext(), i, list, c0383Fi)); } @Override // o.InterfaceC6627cYe.IeS public final void e(C0375Fe c0375Fe) { a(c0375Fe, new fHO(this, c0375Fe) { // from class: com.scb.phone.view.fragment.accountsummary.DepositFragment.5 private DepositFragment b; private C0375Fe d; { this.b = this; this.d = c0375Fe; } @Override // o.fHO public final void c() { C2396adn c2396adn = this.b.depositPresenter; String str = this.d.b; c2396adn.g.b(new InterfaceC13154fSb(c2396adn, str, this.d.e) { // from class: o.adn.4 private String a; private C2396adn c; private String e; @Override // o.InterfaceC13154fSb public final void onSubscribe(fSJ fsj) { } { this.c = c2396adn; this.a = str; this.e = r3; } @Override // o.InterfaceC13154fSb public final void onComplete() { C2396adn c2396adn2 = this.c; final String str2 = this.a; final String str3 = this.e; ZI.IeS ieS = new ZI.IeS(str2, str3) { // from class: o.adx private String b; private String c; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6627cYe.ojQ) obj).c(this.c, this.b); } { this.c = str2; this.b = str3; } }; if (c2396adn2.f != 0) { ieS.e(c2396adn2.f); } } @Override // o.InterfaceC13154fSb public final void onError(Throwable th) { C2396adn.a(this.c, th); } }, new Icn.IeS(str), c2396adn.e); } @Override // o.fHO public final void a() { C2396adn c2396adn = this.b.depositPresenter; final String str = this.d.d; final String str2 = this.d.b; final String str3 = this.d.e; if (str != null) { ZI.IeS ieS = new ZI.IeS(str, str2, str3) { // from class: o.adk private String c; private String d; private String e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6627cYe.ojQ) obj).a(this.c, this.d, this.e); } { this.c = str; this.d = str2; this.e = str3; } }; if (c2396adn.f != 0) { ieS.e(c2396adn.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.depositPresenter.d; 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); } @Override // o.InterfaceC6627cYe.ojQ public final void e() { this.titleAccounts.setText(getString(R.string.account_summary_my_business)); } @Override // o.InterfaceC6627cYe.ojQ public final void b() { v("accountsummary_depositdetails_retry"); } }