package com.scb.phone.view.fragment.creditcard; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.activity.creditcard.CreditCardBilledDetailActivity; import com.scb.phone.view.adapter.creditcard.CreditCardDetailBilledAdapter; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.creditcard.BilledTabFragment; import java.util.List; import o.C0530Iv; import o.C3542azX; import o.InterfaceC12842fIq; import o.InterfaceC13391fZD; import o.InterfaceC6618cYI; import o.fSQ; import o.glR; /* loaded from: classes5.dex */ public class BilledTabFragment extends Hilt_BilledTabFragment implements InterfaceC12842fIq, InterfaceC6618cYI.IeS { @InterfaceC13391fZD public C3542azX billedTabPresenter; private CreditCardDetailBilledAdapter c; public Handler d; @BindView RelativeLayout mContainerRelativeLayout; @BindView TextView mEmptyCenterTitle; @BindView TextView mEmptyDescription; @BindView ImageView mEmptyImage; @BindView TextView mEmptyTitle; @BindView RecyclerView mRecyclerView; @BindView TextView mShowMessages; public static BilledTabFragment a(String str, String str2) { BilledTabFragment billedTabFragment = new BilledTabFragment(); Bundle bundle = new Bundle(); bundle.putString("CREDIT_CARD_NUMBER", str); bundle.putString("CREDIT_CARD_STML_CLOSE_DATE", str2); billedTabFragment.setArguments(bundle); return billedTabFragment; } @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559519, viewGroup, false); ButterKnife.c(this, inflate); this.billedTabPresenter.e((C3542azX) this); if (getArguments() != null) { C3542azX c3542azX = this.billedTabPresenter; String string = getArguments().getString("CREDIT_CARD_NUMBER"); String string2 = getArguments().getString("CREDIT_CARD_STML_CLOSE_DATE"); c3542azX.d = string; c3542azX.a = string2; } getContext(); this.mRecyclerView.setLayoutManager(new LinearLayoutManager(1, false)); this.mRecyclerView.setNestedScrollingEnabled(false); this.billedTabPresenter.b(); this.d = new Handler(Looper.getMainLooper()); ((BaseFragment) this).b = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_UPDATE_LIST")).subscribe(new fSQ(this) { // from class: o.eNW private BilledTabFragment e; @Override // o.fSQ public final void c(Object obj) { BilledTabFragment billedTabFragment = this.e; billedTabFragment.d.post(new Runnable(billedTabFragment, (Intent) obj) { // from class: o.eNT private BilledTabFragment a; private Intent c; @Override // java.lang.Runnable public final void run() { BilledTabFragment.arq_(this.a, this.c); } { this.a = billedTabFragment; this.c = r2; } }); } { this.e = this; } }, new fSQ() { // from class: o.eNV @Override // o.fSQ public final void c(Object obj) { guQ.a((Throwable) obj); } }); return inflate; } @Override // o.InterfaceC12842fIq public final void b(int i) { Intent intent = new Intent(getContext(), (Class) CreditCardBilledDetailActivity.class); intent.putExtra("BILLED_DETAIL", this.billedTabPresenter.e.get(i)); startActivity(intent); } @Override // o.InterfaceC6618cYI.IeS public final void c(final List list) { this.mRecyclerView.setVisibility(0); if (this.c == null) { CreditCardDetailBilledAdapter creditCardDetailBilledAdapter = new CreditCardDetailBilledAdapter(list, this); this.c = creditCardDetailBilledAdapter; this.mRecyclerView.setAdapter(creditCardDetailBilledAdapter); return; } this.d.post(new Runnable(this, list) { // from class: o.eOb private BilledTabFragment c; private List d; @Override // java.lang.Runnable public final void run() { BilledTabFragment.e(this.c, this.d); } { this.c = this; this.d = list; } }); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { this.billedTabPresenter.w_(); super.onDestroy(); } @Override // o.InterfaceC6618cYI.IeS public final void e() { this.mEmptyTitle.setVisibility(8); this.mEmptyCenterTitle.setVisibility(0); this.mEmptyCenterTitle.setText(getResources().getString(R.string.custom_empty_no_transactions)); this.mEmptyDescription.setVisibility(8); this.mContainerRelativeLayout.setVisibility(0); this.mShowMessages.setVisibility(8); this.mRecyclerView.setVisibility(8); this.mEmptyImage.setVisibility(8); } @OnClick public void onClick() { this.billedTabPresenter.b(); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroyView() { super.onDestroyView(); this.d.removeCallbacksAndMessages(null); } @Override // com.scb.phone.view.fragment.BaseFragment, o.InterfaceC6638cYp public final void v() { this.mContainerRelativeLayout.setVisibility(8); this.mShowMessages.setVisibility(8); this.mRecyclerView.setVisibility(8); super.v(); } public static /* synthetic */ void e(BilledTabFragment billedTabFragment, List list) { CreditCardDetailBilledAdapter creditCardDetailBilledAdapter = billedTabFragment.c; creditCardDetailBilledAdapter.a.clear(); creditCardDetailBilledAdapter.a.addAll(list); creditCardDetailBilledAdapter.notifyDataSetChanged(); } public static /* synthetic */ void arq_(BilledTabFragment billedTabFragment, Intent intent) { if (intent.getExtras() != null) { billedTabFragment.mContainerRelativeLayout.setVisibility(8); billedTabFragment.mShowMessages.setVisibility(8); billedTabFragment.mRecyclerView.setVisibility(8); C3542azX c3542azX = billedTabFragment.billedTabPresenter; String stringExtra = intent.getStringExtra("CREDIT_CARD_NUMBER"); String stringExtra2 = intent.getStringExtra("CREDIT_CARD_STML_CLOSE_DATE"); c3542azX.d = stringExtra; c3542azX.a = stringExtra2; billedTabFragment.billedTabPresenter.b(); } } }