package com.scb.phone.view.fragment.prepaid.traveltab; import android.content.Context; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import butterknife.ButterKnife; import com.scb.phone.R; import com.scb.phone.view.activity.prepaid.PrepaidDetailsActivity; import com.scb.phone.view.adapter.prepaid.PrepaidTransactionAdapter; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.prepaid.traveltab.PrepaidTravelDetailTabFragment; import java.util.ArrayList; import java.util.List; import o.C1042Ui; import o.C1046Ul; import o.C1049Un; import o.C1054Up; import o.C1062Uu; import o.C14957gcv; import o.C16148leh; import o.C7658csV; import o.C8912dZm; import o.InterfaceC13391fZD; import o.InterfaceC9510dlB; import o.Tlu; import o.kIT; import o.nMh; /* loaded from: classes5.dex */ public final class PrepaidTravelDetailTabFragment extends Hilt_PrepaidTravelDetailTabFragment implements PrepaidDetailsActivity.Sts, InterfaceC9510dlB.HBt { private C1049Un c; private C1054Up d; private PrepaidTransactionAdapter g; @BindView public LinearLayout llCustomError; @BindView public LinearLayout llViewCustomError; @BindView public LinearLayout llViewCustomProgress; @InterfaceC13391fZD public C7658csV presenter; @BindView public RecyclerView rvTransactions; @BindView public Toolbar toolbarTxnHeader; @BindView public TextView tvErrorMessage; @BindView public TextView tvMonthHeader; @BindView public TextView tvTxnHeader; public static /* synthetic */ void l() { } /* loaded from: classes5.dex */ public static final class LWm { private LWm() { } public /* synthetic */ LWm(byte b) { this(); } } @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); return layoutInflater.inflate(R.layout.2131559825, viewGroup, false); } @Override // androidx.fragment.app.Fragment public final void onViewCreated(View view, Bundle bundle) { C14957gcv.e(view, ""); super.onViewCreated(view, bundle); ((BaseFragment) this).a = ButterKnife.c(this, view); C7658csV c7658csV = this.presenter; RecyclerView recyclerView = null; if (c7658csV == null) { C14957gcv.a(""); c7658csV = null; } c7658csV.e((C7658csV) this); Bundle arguments = getArguments(); if (arguments != null) { this.c = (C1049Un) arguments.getParcelable("ARGS_PREPAID_CARD_DISPLAY"); this.d = (C1054Up) arguments.getParcelable("ARGS_PREPAID_CARD_SUMMARY_DISPLAY"); } TextView textView = this.tvTxnHeader; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(getString(R.string.debit_transaction_label)); final C16148leh c16148leh = new C16148leh(null); C16148leh.IeS ieS = new C16148leh.IeS() { // from class: o.fuh @Override // o.C16148leh.IeS public final void e(int i) { PrepaidTravelDetailTabFragment.l(); } }; kIT kit = c16148leh.j; if (kit == null) { c16148leh.a = ieS; } else { kit.b = ieS; } C16148leh.HBt hBt = new C16148leh.HBt(c16148leh) { // from class: o.fuf private C16148leh c; @Override // o.C16148leh.HBt public final void d(int i) { PrepaidTravelDetailTabFragment.b(this.c, i); } { this.c = c16148leh; } }; kIT kit2 = c16148leh.j; if (kit2 == null) { c16148leh.b = hBt; } else { kit2.e = hBt; } PrepaidTransactionAdapter prepaidTransactionAdapter = new PrepaidTransactionAdapter(getContext(), (byte) 0); this.g = prepaidTransactionAdapter; RecyclerView.Sts d = c16148leh.d(prepaidTransactionAdapter); C14957gcv.c(d, ""); C8912dZm c8912dZm = new C8912dZm(); c8912dZm.setSupportsChangeAnimations(false); RecyclerView recyclerView2 = this.rvTransactions; if (recyclerView2 == null) { C14957gcv.a(""); recyclerView2 = null; } getContext(); recyclerView2.setLayoutManager(new LinearLayoutManager(1, false)); RecyclerView recyclerView3 = this.rvTransactions; if (recyclerView3 == null) { C14957gcv.a(""); recyclerView3 = null; } recyclerView3.setAdapter(d); RecyclerView recyclerView4 = this.rvTransactions; if (recyclerView4 == null) { C14957gcv.a(""); recyclerView4 = null; } recyclerView4.setItemAnimator(c8912dZm); RecyclerView recyclerView5 = this.rvTransactions; if (recyclerView5 == null) { C14957gcv.a(""); recyclerView5 = null; } recyclerView5.setNestedScrollingEnabled(false); RecyclerView recyclerView6 = this.rvTransactions; if (recyclerView6 == null) { C14957gcv.a(""); recyclerView6 = null; } recyclerView6.setHasFixedSize(false); RecyclerView recyclerView7 = this.rvTransactions; if (recyclerView7 != null) { recyclerView = recyclerView7; } else { C14957gcv.a(""); } c16148leh.b(recyclerView); } @Override // com.scb.phone.view.activity.prepaid.PrepaidDetailsActivity.Sts public final void b(C1049Un c1049Un) { C14957gcv.e(c1049Un, ""); this.c = c1049Un; C7658csV c7658csV = this.presenter; if (c7658csV == null) { C14957gcv.a(""); c7658csV = null; } C1054Up c1054Up = this.d; String str = c1054Up != null ? c1054Up.c : null; c7658csV.c(str != null ? str : "", c1049Un); } @Override // com.scb.phone.view.activity.prepaid.PrepaidDetailsActivity.Sts public final void o() { C7658csV c7658csV = this.presenter; if (c7658csV == null) { C14957gcv.a(""); c7658csV = null; } C7658csV.c(new Object[]{c7658csV}, 336060668, -336060666, System.identityHashCode(c7658csV)); } @Override // o.InterfaceC9510dlB.HBt public final void g() { RecyclerView recyclerView = this.rvTransactions; PrepaidTransactionAdapter prepaidTransactionAdapter = null; if (recyclerView == null) { C14957gcv.a(""); recyclerView = null; } if (recyclerView.B > 0) { return; } PrepaidTransactionAdapter prepaidTransactionAdapter2 = this.g; if (prepaidTransactionAdapter2 == null) { C14957gcv.a(""); } else { prepaidTransactionAdapter = prepaidTransactionAdapter2; } prepaidTransactionAdapter.b(true); } @Override // o.InterfaceC9510dlB.HBt public final void f() { RecyclerView recyclerView = this.rvTransactions; PrepaidTransactionAdapter prepaidTransactionAdapter = null; if (recyclerView == null) { C14957gcv.a(""); recyclerView = null; } if (recyclerView.B > 0) { return; } PrepaidTransactionAdapter prepaidTransactionAdapter2 = this.g; if (prepaidTransactionAdapter2 == null) { C14957gcv.a(""); } else { prepaidTransactionAdapter = prepaidTransactionAdapter2; } prepaidTransactionAdapter.b(false); } @Override // o.InterfaceC9510dlB.HBt public final void b(List list) { C14957gcv.e(list, ""); Context context = getContext(); if (context != null) { c(context); Toolbar toolbar = this.toolbarTxnHeader; Toolbar toolbar2 = null; if (toolbar == null) { C14957gcv.a(""); toolbar = null; } Menu jO_ = toolbar.jO_(); jO_.clear(); for (C1042Ui c1042Ui : list) { if (jO_ != null) { jO_.add(c1042Ui.c); } } final ArrayList arrayList = new ArrayList(); int size = jO_.size(); for (int i = 0; i < size; i++) { arrayList.add(jO_.getItem(i)); } Toolbar toolbar3 = this.toolbarTxnHeader; if (toolbar3 != null) { toolbar2 = toolbar3; } else { C14957gcv.a(""); } toolbar2.setOnMenuItemClickListener(new Toolbar.HBt(this, arrayList) { // from class: o.fun private ArrayList d; private PrepaidTravelDetailTabFragment e; @Override // androidx.appcompat.widget.Toolbar.HBt public final boolean awL_(MenuItem menuItem) { return PrepaidTravelDetailTabFragment.awK_(this.e, this.d, menuItem); } { this.e = this; this.d = arrayList; } }); } } private final void c(Context context) { Drawable drawable = nMh.getDrawable(context, R.drawable.ic_filter_list_black_24dp); Toolbar toolbar = null; Drawable mutate = drawable != null ? drawable.mutate() : null; if (mutate != null) { Tlu.pE_(mutate, nMh.getColor(context, R.color.f13682131100876)); Toolbar toolbar2 = this.toolbarTxnHeader; if (toolbar2 != null) { toolbar = toolbar2; } else { C14957gcv.a(""); } toolbar.setOverflowIcon(mutate); } } @Override // o.InterfaceC9510dlB.HBt public final void h() { LinearLayout linearLayout = this.llViewCustomProgress; LinearLayout linearLayout2 = null; if (linearLayout == null) { C14957gcv.a(""); linearLayout = null; } linearLayout.setVisibility(8); LinearLayout linearLayout3 = this.llViewCustomError; if (linearLayout3 == null) { C14957gcv.a(""); linearLayout3 = null; } linearLayout3.setVisibility(8); TextView textView = this.tvErrorMessage; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setVisibility(8); RecyclerView recyclerView = this.rvTransactions; if (recyclerView == null) { C14957gcv.a(""); recyclerView = null; } recyclerView.setVisibility(8); LinearLayout linearLayout4 = this.llCustomError; if (linearLayout4 != null) { linearLayout2 = linearLayout4; } else { C14957gcv.a(""); } linearLayout2.setVisibility(0); } @Override // o.InterfaceC9510dlB.HBt public final void i() { LinearLayout linearLayout = this.llViewCustomProgress; LinearLayout linearLayout2 = null; if (linearLayout == null) { C14957gcv.a(""); linearLayout = null; } linearLayout.setVisibility(0); LinearLayout linearLayout3 = this.llViewCustomError; if (linearLayout3 == null) { C14957gcv.a(""); linearLayout3 = null; } linearLayout3.setVisibility(8); TextView textView = this.tvErrorMessage; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setVisibility(8); RecyclerView recyclerView = this.rvTransactions; if (recyclerView == null) { C14957gcv.a(""); recyclerView = null; } recyclerView.setVisibility(8); LinearLayout linearLayout4 = this.llCustomError; if (linearLayout4 != null) { linearLayout2 = linearLayout4; } else { C14957gcv.a(""); } linearLayout2.setVisibility(8); } @Override // o.InterfaceC9510dlB.HBt public final void b() { LinearLayout linearLayout = this.llViewCustomProgress; LinearLayout linearLayout2 = null; if (linearLayout == null) { C14957gcv.a(""); linearLayout = null; } linearLayout.setVisibility(8); LinearLayout linearLayout3 = this.llViewCustomError; if (linearLayout3 == null) { C14957gcv.a(""); linearLayout3 = null; } linearLayout3.setVisibility(8); TextView textView = this.tvErrorMessage; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setVisibility(8); RecyclerView recyclerView = this.rvTransactions; if (recyclerView == null) { C14957gcv.a(""); recyclerView = null; } recyclerView.setVisibility(0); LinearLayout linearLayout4 = this.llCustomError; if (linearLayout4 != null) { linearLayout2 = linearLayout4; } else { C14957gcv.a(""); } linearLayout2.setVisibility(8); } @Override // o.InterfaceC9510dlB.HBt public final void d() { LinearLayout linearLayout = this.llViewCustomProgress; LinearLayout linearLayout2 = null; if (linearLayout == null) { C14957gcv.a(""); linearLayout = null; } linearLayout.setVisibility(8); LinearLayout linearLayout3 = this.llViewCustomError; if (linearLayout3 == null) { C14957gcv.a(""); linearLayout3 = null; } linearLayout3.setVisibility(0); TextView textView = this.tvErrorMessage; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setVisibility(8); RecyclerView recyclerView = this.rvTransactions; if (recyclerView == null) { C14957gcv.a(""); recyclerView = null; } recyclerView.setVisibility(8); LinearLayout linearLayout4 = this.llCustomError; if (linearLayout4 != null) { linearLayout2 = linearLayout4; } else { C14957gcv.a(""); } linearLayout2.setVisibility(8); } @Override // o.InterfaceC9510dlB.HBt public final void c() { LinearLayout linearLayout = this.llViewCustomProgress; LinearLayout linearLayout2 = null; if (linearLayout == null) { C14957gcv.a(""); linearLayout = null; } linearLayout.setVisibility(8); LinearLayout linearLayout3 = this.llViewCustomError; if (linearLayout3 == null) { C14957gcv.a(""); linearLayout3 = null; } linearLayout3.setVisibility(8); TextView textView = this.tvErrorMessage; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(getString(R.string.prepaid_travel_empty_no_transactions)); TextView textView2 = this.tvErrorMessage; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setVisibility(0); RecyclerView recyclerView = this.rvTransactions; if (recyclerView == null) { C14957gcv.a(""); recyclerView = null; } recyclerView.setVisibility(8); LinearLayout linearLayout4 = this.llCustomError; if (linearLayout4 != null) { linearLayout2 = linearLayout4; } else { C14957gcv.a(""); } linearLayout2.setVisibility(8); } @Override // o.InterfaceC9510dlB.HBt public final void b(C1046Ul c1046Ul, boolean z) { C14957gcv.e(c1046Ul, ""); PrepaidTransactionAdapter prepaidTransactionAdapter = null; if (!z) { PrepaidTransactionAdapter prepaidTransactionAdapter2 = this.g; if (prepaidTransactionAdapter2 == null) { C14957gcv.a(""); } else { prepaidTransactionAdapter = prepaidTransactionAdapter2; } List list = c1046Ul.a; if (list != null) { prepaidTransactionAdapter.d.addAll(list); } prepaidTransactionAdapter.notifyDataSetChanged(); return; } PrepaidTransactionAdapter prepaidTransactionAdapter3 = this.g; if (prepaidTransactionAdapter3 == null) { C14957gcv.a(""); } else { prepaidTransactionAdapter = prepaidTransactionAdapter3; } List list2 = c1046Ul.a; prepaidTransactionAdapter.d.clear(); if (list2 != null) { prepaidTransactionAdapter.d.addAll(list2); } prepaidTransactionAdapter.notifyDataSetChanged(); } @Override // o.InterfaceC9510dlB.HBt public final void a() { PrepaidTransactionAdapter prepaidTransactionAdapter = this.g; PrepaidTransactionAdapter prepaidTransactionAdapter2 = null; if (prepaidTransactionAdapter == null) { C14957gcv.a(""); prepaidTransactionAdapter = null; } prepaidTransactionAdapter.d.clear(); PrepaidTransactionAdapter prepaidTransactionAdapter3 = this.g; if (prepaidTransactionAdapter3 == null) { C14957gcv.a(""); } else { prepaidTransactionAdapter2 = prepaidTransactionAdapter3; } prepaidTransactionAdapter2.notifyDataSetChanged(); } @Override // o.InterfaceC9510dlB.HBt public final void j() { Toolbar toolbar = this.toolbarTxnHeader; TextView textView = null; if (toolbar == null) { C14957gcv.a(""); toolbar = null; } toolbar.setVisibility(0); Context context = getContext(); if (context != null) { c(context); } TextView textView2 = this.tvMonthHeader; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setVisibility(0); TextView textView3 = this.tvMonthHeader; if (textView3 != null) { textView = textView3; } else { C14957gcv.a(""); } textView.setText(getString(R.string.deposit_detail_filter_this_month)); } @Override // o.InterfaceC9510dlB.HBt public final void e() { Toolbar toolbar = this.toolbarTxnHeader; TextView textView = null; if (toolbar == null) { C14957gcv.a(""); toolbar = null; } toolbar.jO_().clear(); Toolbar toolbar2 = this.toolbarTxnHeader; if (toolbar2 == null) { C14957gcv.a(""); toolbar2 = null; } toolbar2.setOverflowIcon(null); TextView textView2 = this.tvMonthHeader; if (textView2 != null) { textView = textView2; } else { C14957gcv.a(""); } textView.setVisibility(8); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroyView() { C7658csV c7658csV = this.presenter; if (c7658csV == null) { C14957gcv.a(""); c7658csV = null; } c7658csV.w_(); super.onDestroyView(); } public static /* synthetic */ boolean awK_(PrepaidTravelDetailTabFragment prepaidTravelDetailTabFragment, ArrayList arrayList, MenuItem menuItem) { C14957gcv.e(prepaidTravelDetailTabFragment, ""); C14957gcv.e(arrayList, ""); menuItem.getItemId(); TextView textView = prepaidTravelDetailTabFragment.tvMonthHeader; C7658csV c7658csV = null; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(menuItem.getTitle()); int indexOf = arrayList.indexOf(menuItem); C7658csV c7658csV2 = prepaidTravelDetailTabFragment.presenter; if (c7658csV2 == null) { C14957gcv.a(""); c7658csV2 = null; } C7658csV c7658csV3 = prepaidTravelDetailTabFragment.presenter; if (c7658csV3 != null) { c7658csV = c7658csV3; } else { C14957gcv.a(""); } C7658csV.c(new Object[]{c7658csV2, c7658csV.a().get(indexOf)}, 1087736017, -1087736016, System.identityHashCode(c7658csV2)); return true; } public static /* synthetic */ void b(C16148leh c16148leh, int i) { kIT kit; C14957gcv.e(c16148leh, ""); int d = c16148leh.j.a.d(); for (int i2 = 0; i2 < d; i2++) { if (i2 != i && (kit = c16148leh.j) != null) { kit.e(i2, false); } } } public static final PrepaidTravelDetailTabFragment e(C1049Un c1049Un, C1054Up c1054Up) { C14957gcv.e(c1049Un, ""); C14957gcv.e(c1054Up, ""); PrepaidTravelDetailTabFragment prepaidTravelDetailTabFragment = new PrepaidTravelDetailTabFragment(); Bundle bundle = new Bundle(); bundle.putParcelable("ARGS_PREPAID_CARD_DISPLAY", c1049Un); bundle.putParcelable("ARGS_PREPAID_CARD_SUMMARY_DISPLAY", c1054Up); prepaidTravelDetailTabFragment.setArguments(bundle); return prepaidTravelDetailTabFragment; } static { new LWm((byte) 0); } }