package com.scb.phone.view.fragment.creditcard; import android.content.Context; 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.FrameLayout; import androidx.fragment.app.Fragment; import androidx.viewpager.widget.ViewPager; import butterknife.BindView; import butterknife.ButterKnife; import com.google.android.gms.analytics.ecommerce.ProductAction; import com.google.android.material.tabs.TabLayout; import com.scb.phone.R; import com.scb.phone.view.activity.BaseActivity; import com.scb.phone.view.activity.ccrredemption.categories.RewardsHomeActivity; import com.scb.phone.view.activity.ccrredemption.pointtopay.CreditCardCoachMarkActivity; import com.scb.phone.view.adapter.creditcard.CreditCardDetailViewPagerAdapter; import com.scb.phone.view.custom.common.FragmentWrapContentViewPager; import com.scb.phone.view.custom.common.WrapContentViewPager; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.creditcard.CreditCardDetailFragment; import com.scb.phone.view.fragment.creditcard.PointTabFragment; import com.scb.phone.view.fragment.creditcard.SettingTabFragment; import java.util.ArrayList; import java.util.List; import me.relex.circleindicator.CircleIndicator; import o.C0367Fb; import o.C0537Iz; import o.C0690Mh; import o.C0693Mj; import o.C10457eEr; import o.C12159esu; import o.C1313aAf; import o.C1315aAh; import o.C1324aAq; import o.C1326aAs; import o.C1328aAu; import o.C1329aAv; import o.C1331aAx; import o.C1333aAz; import o.C6583cXR; import o.InterfaceC12841fIp; import o.InterfaceC13391fZD; import o.InterfaceC6618cYI; import o.ZI; import o.gxQ; import o.pug; /* loaded from: classes5.dex */ public class CreditCardDetailFragment extends Hilt_CreditCardDetailFragment implements InterfaceC6618cYI.HBt, ViewPager.ojQ, InterfaceC12841fIp, PointTabFragment.Sts, SettingTabFragment.HBt { public HBt c; @InterfaceC13391fZD public C1315aAh creditCardDetailPresenter; public boolean d; private String f; private CreditCardDetailViewPagerAdapter g; public int h; private InformationTabFragment i; private List j; private int k; private PointTabFragment l; private C0367Fb m; @BindView CircleIndicator mCircleIndicator; @BindView FragmentWrapContentViewPager mCreditCardDetailViewPager; @BindView TabLayout mCreditDetailTabLayout; @BindView WrapContentViewPager mViewPager; private int n; /* renamed from: o, reason: collision with root package name */ private SettingTabFragment f8030o; @BindView FrameLayout rootView; @BindView Button viewRewardsButton; /* loaded from: classes5.dex */ public interface HBt { void a(); } @Override // androidx.viewpager.widget.ViewPager.ojQ public void onPageScrollStateChanged(int i) { } @Override // androidx.viewpager.widget.ViewPager.ojQ public void onPageScrolled(int i, float f, int i2) { } @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559521, viewGroup, false); ((BaseFragment) this).a = ButterKnife.c(this, inflate); this.creditCardDetailPresenter.e((C1315aAh) this); super.aa(); u(getString(R.string.credit_card_detail_title)); setHasOptionsMenu(true); Y(); this.creditCardDetailPresenter.i = this.d; this.creditCardDetailPresenter.a = bundle; return inflate; } @Override // androidx.fragment.app.Fragment public void onViewCreated(View view, Bundle bundle) { super.onViewCreated(view, bundle); C1315aAh c1315aAh = this.creditCardDetailPresenter; if (!c1315aAh.d.d().isEmpty()) { ZI.IeS ieS = new ZI.IeS() { // from class: o.aAg @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6618cYI.HBt) obj).c(); } }; if (c1315aAh.f != 0) { ieS.e(c1315aAh.f); return; } return; } if (c1315aAh.i) { c1315aAh.d(); return; } C1313aAf c1313aAf = new C1313aAf(c1315aAh); if (c1315aAh.f != 0) { c1313aAf.e(c1315aAh.f); } } private void h() { if (getActivity() == null || getActivity().getIntent() == null) { return; } this.f = this.creditCardDetailPresenter.b; this.creditCardDetailPresenter.e = this.j; this.n = getActivity().getIntent().getIntExtra("SELECTED_CARD_POSITION", 0); if (!this.j.isEmpty()) { final C1315aAh c1315aAh = this.creditCardDetailPresenter; ZI.IeS ieS = new ZI.IeS(c1315aAh) { // from class: o.aAj private C1315aAh c; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC6618cYI.HBt) obj).c(this.c.e); } { this.c = c1315aAh; } }; if (c1315aAh.f != 0) { ieS.e(c1315aAh.f); } this.m = this.j.get(Math.min(this.n, this.creditCardDetailPresenter.e.size() - 1)); this.mCreditCardDetailViewPager.setOffscreenPageLimit(2); this.mCreditCardDetailViewPager.setEnableDrawDynamicViewHeight(true); this.mCreditCardDetailViewPager.setAdapter(new C12159esu(getChildFragmentManager(), getContext(), this.m, this.j, this.f, this.creditCardDetailPresenter.h, this.creditCardDetailPresenter.g)); this.mCreditDetailTabLayout.setupWithViewPager(this.mCreditCardDetailViewPager); this.mCreditCardDetailViewPager.addOnPageChangeListener(new ViewPager.ojQ(this) { // from class: com.scb.phone.view.fragment.creditcard.CreditCardDetailFragment.5 private CreditCardDetailFragment 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) { CreditCardDetailFragment.e(this.c, i); CreditCardDetailFragment creditCardDetailFragment = this.c; if (i == 0) { pug[] pugVarArr = {new pug("tab", ProductAction.ACTION_DETAIL)}; if (creditCardDetailFragment.getActivity() != null) { ((BaseActivity) creditCardDetailFragment.getActivity()).scbAnalytics.e("cardmgmt_carddetail", pugVarArr); return; } return; } if (i == 1) { pug[] pugVarArr2 = {new pug("tab", "point")}; if (creditCardDetailFragment.getActivity() != null) { ((BaseActivity) creditCardDetailFragment.getActivity()).scbAnalytics.e("cardmgmt_carddetail", pugVarArr2); return; } return; } if (i == 2) { pug[] pugVarArr3 = {new pug("tab", "setting")}; if (creditCardDetailFragment.getActivity() != null) { ((BaseActivity) creditCardDetailFragment.getActivity()).scbAnalytics.e("cardmgmt_carddetail", pugVarArr3); } } } }); c("cardmgmt_carddetail", new pug("tab", ProductAction.ACTION_DETAIL)); return; } C0693Mj c0693Mj = new C0693Mj(); c0693Mj.d = getString(R.string.unable_to_proceed_error_title); c0693Mj.c = getString(R.string.error_generic_resource); C0690Mh c0690Mh = new C0690Mh(); c0690Mh.e = C0690Mh.IeS.NAVIGATE_BACK; c0690Mh.b = getString(R.string.ok); c0693Mj.e = c0690Mh; e(c0693Mj); } @Override // o.InterfaceC6618cYI.HBt public final void ars_(Bundle bundle) { if (getActivity() == null || getActivity().getIntent() == null) { return; } if (bundle == null) { this.j = getActivity().getIntent().getParcelableArrayListExtra("CREDIT_CARD_DISPLAY_LIST"); } else { this.j = bundle.getParcelableArrayList("OUTSTATE_CREDIT_CARD_DISPLAY_LIST"); } ArrayList parcelableArrayListExtra = getActivity().getIntent().getParcelableArrayListExtra("ECOM_REMARK"); boolean booleanExtra = getActivity().getIntent().getBooleanExtra("ECOM_MAINTAINANCE_ENABLE", false); this.creditCardDetailPresenter.e = this.j; C1315aAh c1315aAh = this.creditCardDetailPresenter; c1315aAh.h = parcelableArrayListExtra; c1315aAh.g = booleanExtra; h(); } @Override // com.scb.phone.view.fragment.creditcard.Hilt_CreditCardDetailFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment public void onAttach(Context context) { super.onAttach(context); getChildFragmentManager().a(new gxQ(this) { // from class: o.eOc private CreditCardDetailFragment c; @Override // o.gxQ public final void d(yRS yrs, Fragment fragment) { CreditCardDetailFragment.a(this.c, fragment); } { this.c = this; } }); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { this.creditCardDetailPresenter.w_(); super.onDestroy(); } @Override // com.scb.phone.view.fragment.BaseFragment public final void aa() { super.aa(); u(getString(R.string.credit_card_detail_title)); setHasOptionsMenu(true); Y(); } @Override // o.InterfaceC6618cYI.HBt public final void d(C0537Iz c0537Iz) { CreditCardDetailViewPagerAdapter creditCardDetailViewPagerAdapter; if (c0537Iz == null || (creditCardDetailViewPagerAdapter = this.g) == null) { return; } creditCardDetailViewPagerAdapter.e(c0537Iz); if (this.m.g.equals(c0537Iz.b)) { this.m.ab = c0537Iz.h; this.m.j = c0537Iz.c; this.m.f = c0537Iz.a; this.m.i = c0537Iz.d; j(this.m); PointTabFragment pointTabFragment = this.l; if (pointTabFragment == null || this.k != 1) { return; } pointTabFragment.n(); } } /* JADX WARN: Removed duplicated region for block: B:10:? A[RETURN, SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:7:0x001c */ @Override // o.InterfaceC6618cYI.HBt /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void a(java.lang.String r3) { /* r2 = this; com.scb.phone.view.custom.common.WrapContentViewPager r0 = r2.mViewPager if (r0 == 0) goto L19 java.lang.String r1 = "CREDIT_CARD_NUMBER_ERROR" java.lang.String r3 = java.lang.String.valueOf(r3) java.lang.String r3 = r1.concat(r3) android.view.View r3 = r0.findViewWithTag(r3) boolean r0 = r3 instanceof android.widget.RelativeLayout if (r0 == 0) goto L19 android.widget.RelativeLayout r3 = (android.widget.RelativeLayout) r3 goto L1a L19: r3 = 0 L1a: if (r3 == 0) goto L20 r0 = 0 r3.setVisibility(r0) L20: return */ throw new UnsupportedOperationException("Method not decompiled: com.scb.phone.view.fragment.creditcard.CreditCardDetailFragment.a(java.lang.String):void"); } @Override // o.InterfaceC6618cYI.HBt public final void b(String str) { CreditCardDetailViewPagerAdapter creditCardDetailViewPagerAdapter = this.g; if (creditCardDetailViewPagerAdapter != null) { C0537Iz c0537Iz = new C0537Iz(); c0537Iz.b = str; c0537Iz.h = "-1"; creditCardDetailViewPagerAdapter.e(c0537Iz); if (this.m.g.equals(str)) { this.m.ab = "-1"; PointTabFragment pointTabFragment = this.l; if (pointTabFragment != null) { pointTabFragment.j(); } } } } @Override // o.InterfaceC6618cYI.HBt public final boolean e(C0367Fb c0367Fb) { return C1315aAh.b(c0367Fb); } @Override // o.InterfaceC6618cYI.HBt public final boolean b(C0367Fb c0367Fb) { return C1315aAh.c(c0367Fb); } @Override // o.InterfaceC6618cYI.HBt public final void c() { if (getActivity() != null) { startActivityForResult(CreditCardCoachMarkActivity.ZS_(getActivity()), 7201); } } @Override // androidx.viewpager.widget.ViewPager.ojQ public void onPageSelected(int i) { this.n = i; C0367Fb c0367Fb = this.j.get(i); this.m = c0367Fb; InformationTabFragment informationTabFragment = this.i; if (informationTabFragment != null) { String str = this.f; informationTabFragment.c = c0367Fb; informationTabFragment.d = str; C1326aAs c1326aAs = informationTabFragment.creditCardDetailTabPresenter; C1324aAq c1324aAq = new C1324aAq(c0367Fb); if (c1326aAs.f != 0) { c1324aAq.e(c1326aAs.f); } C1328aAu c1328aAu = new C1328aAu(c0367Fb); if (c1326aAs.f != 0) { c1328aAu.e(c1326aAs.f); } C1326aAs c1326aAs2 = informationTabFragment.creditCardDetailTabPresenter; C1329aAv c1329aAv = new C1329aAv(c1326aAs2, informationTabFragment.c); if (c1326aAs2.f != 0) { c1329aAv.e(c1326aAs2.f); } } j(c0367Fb); f(c0367Fb); PointTabFragment pointTabFragment = this.l; if (pointTabFragment == null || this.k != 1) { return; } pointTabFragment.n(); } @Override // o.InterfaceC6618cYI.HBt public final void c(List list) { this.j = list; if (getActivity() != null) { CreditCardDetailViewPagerAdapter creditCardDetailViewPagerAdapter = new CreditCardDetailViewPagerAdapter(getActivity(), list, this); this.g = creditCardDetailViewPagerAdapter; creditCardDetailViewPagerAdapter.d = this; this.mViewPager.setAdapter(this.g); this.mViewPager.addOnPageChangeListener(this); this.mViewPager.setClipToPadding(false); int i = (int) (C6583cXR.Wb_(getActivity()).widthPixels * 0.06f); this.mViewPager.setPadding(i, 0, i, 0); this.mViewPager.setOffscreenPageLimit(1); this.mCircleIndicator.setViewPager(this.mViewPager); this.mViewPager.setCurrentItem(this.n); if (list.size() >= 10) { this.mCircleIndicator.setVisibility(8); } else { this.mCircleIndicator.setVisibility(0); } C0367Fb c0367Fb = list.get(Math.min(this.n, this.creditCardDetailPresenter.e.size() - 1)); this.m = c0367Fb; f(c0367Fb); } } @Override // o.InterfaceC12841fIp public final void a(int i) { C1315aAh c1315aAh = this.creditCardDetailPresenter; c1315aAh.d(c1315aAh.e.get(i)); } @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 (i == 7200) { g(); return; } if (i == 7201) { C1315aAh c1315aAh = this.creditCardDetailPresenter; if (c1315aAh.i) { c1315aAh.d(); return; } C1313aAf c1313aAf = new C1313aAf(c1315aAh); if (c1315aAh.f != 0) { c1313aAf.e(c1315aAh.f); } } } @Override // com.scb.phone.view.fragment.creditcard.PointTabFragment.Sts public final void c(C0367Fb c0367Fb) { this.m = c0367Fb; g(); } @Override // com.scb.phone.view.fragment.creditcard.SettingTabFragment.HBt public final void i() { g(); } @Override // com.scb.phone.view.fragment.creditcard.SettingTabFragment.HBt public final void f() { g(); } @Override // com.scb.phone.view.fragment.creditcard.SettingTabFragment.HBt public final void j() { g(); } @Override // com.scb.phone.view.fragment.creditcard.SettingTabFragment.HBt public final void d(C0367Fb c0367Fb) { this.j.set(this.n, c0367Fb); c(this.j); } @Override // o.InterfaceC6618cYI.HBt public final void d(List list) { this.j = list; h(); } private void g() { C1315aAh c1315aAh = this.creditCardDetailPresenter; c1315aAh.c.a.a(); c1315aAh.c.a.c(); c1315aAh.c.a.e(); this.creditCardDetailPresenter.i = false; this.creditCardDetailPresenter.d(this.m); this.creditCardDetailPresenter.d(); Intent intent = new Intent("com.scb.phone/BROADCAST_UPDATE_LIST"); intent.putExtra("CREDIT_CARD_NUMBER", this.m.g); C10457eEr.aqd_(this, intent); HBt hBt = this.c; if (hBt != null) { hBt.a(); } } private void f(C0367Fb c0367Fb) { SettingTabFragment settingTabFragment = this.f8030o; if (settingTabFragment == null || !settingTabFragment.isAdded()) { return; } SettingTabFragment settingTabFragment2 = this.f8030o; settingTabFragment2.c = c0367Fb; settingTabFragment2.K(); } private void j(C0367Fb c0367Fb) { PointTabFragment pointTabFragment = this.l; if (pointTabFragment != null) { pointTabFragment.c = c0367Fb; C1333aAz c1333aAz = pointTabFragment.pointTabPresenter; C1331aAx c1331aAx = new C1331aAx(c1333aAz, c0367Fb); if (c1333aAz.f != 0) { c1331aAx.e(c1333aAz.f); } } } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onSaveInstanceState(Bundle bundle) { super.onSaveInstanceState(bundle); if (this.j != null) { bundle.putParcelableArrayList("OUTSTATE_CREDIT_CARD_DISPLAY_LIST", new ArrayList<>(this.j)); } } @Override // androidx.fragment.app.Fragment public void onViewStateRestored(Bundle bundle) { super.onViewStateRestored(bundle); if (bundle == null || this.j == null) { return; } this.j = bundle.getParcelableArrayList("OUTSTATE_CREDIT_CARD_DISPLAY_LIST"); } public static /* synthetic */ void a(CreditCardDetailFragment creditCardDetailFragment, Fragment fragment) { if (fragment instanceof PointTabFragment) { final PointTabFragment pointTabFragment = (PointTabFragment) fragment; creditCardDetailFragment.l = pointTabFragment; pointTabFragment.d = creditCardDetailFragment; Button art_ = creditCardDetailFragment.art_(); pointTabFragment.h = art_; if (art_ != null) { art_.setOnClickListener(new View.OnClickListener(pointTabFragment) { // from class: o.eOm private PointTabFragment a; @Override // android.view.View.OnClickListener public final void onClick(View view) { PointTabFragment.e(this.a); } { this.a = pointTabFragment; } }); return; } return; } if (fragment instanceof InformationTabFragment) { creditCardDetailFragment.i = (InformationTabFragment) fragment; return; } if (fragment instanceof SettingTabFragment) { SettingTabFragment settingTabFragment = (SettingTabFragment) fragment; creditCardDetailFragment.f8030o = settingTabFragment; settingTabFragment.d = creditCardDetailFragment; FragmentWrapContentViewPager fragmentWrapContentViewPager = creditCardDetailFragment.mCreditCardDetailViewPager; if (fragmentWrapContentViewPager != null) { fragmentWrapContentViewPager.setCurrentItem(creditCardDetailFragment.h); } } } static /* synthetic */ void e(CreditCardDetailFragment creditCardDetailFragment, int i) { PointTabFragment pointTabFragment; FragmentWrapContentViewPager fragmentWrapContentViewPager; creditCardDetailFragment.k = i; if (i != 0) { if (i != 1 || (pointTabFragment = creditCardDetailFragment.l) == null) { return; } pointTabFragment.n(); return; } InformationTabFragment informationTabFragment = creditCardDetailFragment.i; if (informationTabFragment == null || (fragmentWrapContentViewPager = informationTabFragment.mTabPager) == null) { return; } fragmentWrapContentViewPager.requestLayout(); } @Override // o.InterfaceC12841fIp public final void a(C0367Fb c0367Fb) { if (c0367Fb.ap != 1) { return; } this.m = c0367Fb; if (getActivity() != null) { ((BaseActivity) getActivity()).scbAnalytics.c("rewards_entry_pointbar"); } startActivityForResult(RewardsHomeActivity.ZH_(getContext(), c0367Fb), 7200); } /* JADX WARN: Removed duplicated region for block: B:14:? A[RETURN, SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:8:0x0020 */ @Override // o.InterfaceC6618cYI.HBt /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void c(o.C0537Iz r4) { /* r3 = this; if (r4 == 0) goto L37 java.lang.String r0 = r4.b com.scb.phone.view.custom.common.WrapContentViewPager r1 = r3.mViewPager if (r1 == 0) goto L1d java.lang.String r2 = "CREDIT_CARD_NUMBER" java.lang.String r0 = java.lang.String.valueOf(r0) java.lang.String r0 = r2.concat(r0) android.view.View r0 = r1.findViewWithTag(r0) boolean r1 = r0 instanceof android.widget.RelativeLayout if (r1 == 0) goto L1d android.widget.RelativeLayout r0 = (android.widget.RelativeLayout) r0 goto L1e L1d: r0 = 0 L1e: if (r0 == 0) goto L37 r1 = 0 r0.setVisibility(r1) com.scb.phone.view.custom.common.WrapContentViewPager r0 = r3.mViewPager java.lang.String r1 = r4.b android.view.View r0 = r0.findViewWithTag(r1) boolean r1 = r0 instanceof android.widget.TextView if (r1 == 0) goto L37 android.widget.TextView r0 = (android.widget.TextView) r0 java.lang.String r4 = r4.h r0.setText(r4) L37: return */ throw new UnsupportedOperationException("Method not decompiled: com.scb.phone.view.fragment.creditcard.CreditCardDetailFragment.c(o.Iz):void"); } @Override // com.scb.phone.view.fragment.creditcard.PointTabFragment.Sts public final Button art_() { return this.viewRewardsButton; } }