what-the-bank/sources/com/scb/phone/view/fragment/transferandpay/BaseBillersFragment.java

127 lines
4.0 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.transferandpay;
import android.content.DialogInterface;
import android.os.SystemClock;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.adapter.transferandpay.BillerAdapter;
import com.scb.phone.view.custom.common.CustomDialog;
import com.scb.phone.view.fragment.transferandpay.BaseBillersFragment;
import java.util.List;
import o.AbstractC1181Xh;
import o.InterfaceC12823fIP;
import o.InterfaceC12824fIT;
import o.InterfaceC9010dbe;
import o.gjJ;
/* loaded from: classes5.dex */
public abstract class BaseBillersFragment extends Hilt_BaseBillersFragment implements InterfaceC9010dbe.vUG, InterfaceC12824fIT, InterfaceC12823fIP {
public BillerAdapter c;
private long d;
@BindView
protected View mDividerView;
@BindView
protected RelativeLayout mEmptyCard;
@BindView
protected TextView mEmptyDescription;
@BindView
protected ImageView mEmptyImage;
@BindView
protected TextView mEmptyTitle;
@BindView
protected View mFooterView;
@BindView
public RecyclerView mRecyclerView;
public void c(List<AbstractC1181Xh> list) {
this.mRecyclerView.setVisibility(0);
this.mFooterView.setVisibility(0);
this.mDividerView.setVisibility(0);
BillerAdapter billerAdapter = this.c;
if (billerAdapter == null) {
this.c = new BillerAdapter(getContext(), list, this);
} else {
billerAdapter.d = list;
billerAdapter.notifyDataSetChanged();
}
this.c.c = this;
this.mRecyclerView.setNestedScrollingEnabled(false);
this.mRecyclerView.setAdapter(this.c);
}
@Override // o.InterfaceC9010dbe.vUG
public final void d(List<AbstractC1181Xh> list) {
BillerAdapter billerAdapter = this.c;
if (billerAdapter == null) {
this.c = new BillerAdapter(getContext(), list, this);
} else {
billerAdapter.d.addAll(list);
this.mRecyclerView.post(new Runnable(this) { // from class: o.fCG
private BaseBillersFragment c;
@Override // java.lang.Runnable
public final void run() {
BaseBillersFragment baseBillersFragment = this.c;
baseBillersFragment.c.notifyItemInserted(baseBillersFragment.getItemCount() - 1);
}
{
this.c = this;
}
});
}
}
public void a(int i) {
if (SystemClock.elapsedRealtime() - this.d < 300) {
return;
}
this.d = SystemClock.elapsedRealtime();
}
public void e() {
this.mEmptyTitle.setText(getResources().getString(R.string.custom_error_title));
this.mEmptyDescription.setText(getResources().getString(R.string.custom_error_description));
this.mEmptyCard.setVisibility(0);
}
@Override // o.InterfaceC12823fIP
public final void h() {
CustomDialog b = CustomDialog.b(getContext());
String string = getString(R.string.error_default_title);
if (gjJ.a(string)) {
b.mTitleTextView.setVisibility(0);
b.mTitleTextView.setText(string);
}
String string2 = getString(R.string.error_default_description);
if (gjJ.a(string2)) {
b.mTextTextView.setVisibility(0);
b.mTextTextView.setText(string2);
}
b.aoT_(R.string.ok, new DialogInterface.OnClickListener() { // from class: o.fCF
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}).show();
}
@OnClick
public void onEmptyLayoutClick() {
this.mEmptyCard.setVisibility(8);
}
}