what-the-bank/sources/com/scb/phone/view/fragment/creditcard/UnbilledTabFragment.java

157 lines
5.5 KiB
Java

package com.scb.phone.view.fragment.creditcard;
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.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.adapter.creditcard.CreditCardDetailUnbilledAdapter;
import com.scb.phone.view.fragment.BaseFragment;
import com.scb.phone.view.fragment.creditcard.UnbilledTabFragment;
import o.C16148leh;
import o.IA;
import o.InterfaceC13391fZD;
import o.InterfaceC6618cYI;
import o.aAR;
import o.fSQ;
import o.glR;
/* loaded from: classes5.dex */
public class UnbilledTabFragment extends Hilt_UnbilledTabFragment implements InterfaceC6618cYI.LWm {
private CreditCardDetailUnbilledAdapter c;
@BindView
RelativeLayout mContainerRelativeLayout;
@BindView
TextView mEmptyCenterTitle;
@BindView
TextView mEmptyDescription;
@BindView
ImageView mEmptyImage;
@BindView
TextView mEmptyTitle;
@BindView
RecyclerView mRecyclerView;
@BindView
TextView mShowMessages;
@InterfaceC13391fZD
public aAR unbilledTabPresenter;
public static UnbilledTabFragment c(String str) {
Bundle bundle = new Bundle();
bundle.putString("CREDIT_CARD_NUMBER", str);
UnbilledTabFragment unbilledTabFragment = new UnbilledTabFragment();
unbilledTabFragment.setArguments(bundle);
return unbilledTabFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559525, viewGroup, false);
ButterKnife.c(this, inflate);
this.unbilledTabPresenter.e((aAR) this);
this.unbilledTabPresenter.b(getArguments().getString("CREDIT_CARD_NUMBER"));
((BaseFragment) this).b = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_UPDATE_LIST")).subscribe(new fSQ(this) { // from class: o.eOK
private UnbilledTabFragment a;
@Override // o.fSQ
public final void c(Object obj) {
UnbilledTabFragment unbilledTabFragment = this.a;
Intent intent = (Intent) obj;
if (intent.getExtras() != null) {
unbilledTabFragment.unbilledTabPresenter.b(intent.getStringExtra("CREDIT_CARD_NUMBER"));
}
}
{
this.a = this;
}
}, new fSQ() { // from class: o.eOM
@Override // o.fSQ
public final void c(Object obj) {
guQ.a((Throwable) obj);
}
});
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.unbilledTabPresenter.w_();
super.onDestroy();
}
@Override // o.InterfaceC6618cYI.LWm
public final void c(IA ia) {
this.mContainerRelativeLayout.setVisibility(8);
this.mShowMessages.setVisibility(8);
this.mRecyclerView.setVisibility(0);
CreditCardDetailUnbilledAdapter creditCardDetailUnbilledAdapter = this.c;
if (creditCardDetailUnbilledAdapter != null) {
creditCardDetailUnbilledAdapter.d = ia;
creditCardDetailUnbilledAdapter.notifyDataSetChanged();
return;
}
getContext();
this.mRecyclerView.setLayoutManager(new LinearLayoutManager(1, false));
this.mRecyclerView.setNestedScrollingEnabled(false);
C16148leh c16148leh = new C16148leh(null);
CreditCardDetailUnbilledAdapter creditCardDetailUnbilledAdapter2 = new CreditCardDetailUnbilledAdapter(getContext(), ia);
this.c = creditCardDetailUnbilledAdapter2;
this.mRecyclerView.setAdapter(c16148leh.d(creditCardDetailUnbilledAdapter2));
c16148leh.b(this.mRecyclerView);
}
@Override // o.InterfaceC6618cYI.LWm
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);
}
@Override // o.InterfaceC6618cYI.LWm
public final void a() {
this.mEmptyTitle.setText(getResources().getString(R.string.custom_empty_title));
this.mEmptyDescription.setText(getResources().getString(R.string.custom_empty_description));
this.mContainerRelativeLayout.setVisibility(0);
this.mEmptyImage.setVisibility(0);
this.mShowMessages.setVisibility(8);
this.mRecyclerView.setVisibility(8);
}
@OnClick
public void onClick() {
this.unbilledTabPresenter.b(getArguments().getString("CREDIT_CARD_NUMBER"));
}
@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();
}
}