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

608 lines
19 KiB
Java

package com.scb.phone.view.fragment.transferandpay;
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.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
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.common.ThirdPartySlipActivity;
import com.scb.phone.view.activity.transferandpay.FavouriteSelectedActivity;
import com.scb.phone.view.adapter.transferandpay.HistoryAdapter;
import com.scb.phone.view.fragment.BaseFragment;
import com.scb.phone.view.fragment.transferandpay.AnyTransferHistoryFragment;
import java.util.ArrayList;
import o.AbstractC14961gcz;
import o.AbstractC6226cMj;
import o.C1089Vj;
import o.C1093Vl;
import o.C14866gag;
import o.C14957gcv;
import o.C15296gmk;
import o.C15595gv;
import o.C16148leh;
import o.C8912dZm;
import o.InterfaceC14890gbN;
import o.InterfaceC14894gbR;
import o.InterfaceC9010dbe;
import o.QJy;
import o.kIT;
/* loaded from: classes5.dex */
public abstract class AnyTransferHistoryFragment extends Hilt_AnyTransferHistoryFragment implements InterfaceC9010dbe.IeS, C16148leh.HBt, C16148leh.IeS {
private HistoryAdapter c;
public boolean d;
@BindView
public RelativeLayout emptyCard;
@BindView
public TextView emptyDescription;
@BindView
public ImageView emptyImage;
@BindView
public TextView emptyTitle;
private C16148leh h;
@BindView
public View historyView;
private RecyclerView.Sts<?> j;
@BindView
public View loadingView;
@BindView
public TextView noHistoryDescriptionTextView;
@BindView
public View noHistoryDescriptionView;
@BindView
public RecyclerView recyclerView;
/* loaded from: classes5.dex */
public interface RVV {
void d();
}
public abstract void d(C1089Vj c1089Vj);
public abstract void e(C1089Vj c1089Vj);
public abstract String g();
public abstract AbstractC6226cMj j();
/* loaded from: classes5.dex */
public static final class HBt {
private HBt() {
}
public /* synthetic */ HBt(byte b) {
this();
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
View inflate = layoutInflater.inflate(R.layout.2131559954, viewGroup, false);
((BaseFragment) this).a = ButterKnife.c(this, inflate);
j().e((AbstractC6226cMj) this);
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityCreated(Bundle bundle) {
C16148leh c16148leh;
super.onActivityCreated(bundle);
getContext();
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(1, false);
TextView textView = null;
C16148leh c16148leh2 = new C16148leh(bundle != null ? bundle.getParcelable("RecyclerViewExpandableItemManager") : null);
this.h = c16148leh2;
AnyTransferHistoryFragment anyTransferHistoryFragment = this;
kIT kit = c16148leh2.j;
if (kit == null) {
c16148leh2.b = anyTransferHistoryFragment;
} else {
kit.e = anyTransferHistoryFragment;
}
C16148leh c16148leh3 = this.h;
if (c16148leh3 == null) {
C14957gcv.a("");
c16148leh3 = null;
}
AnyTransferHistoryFragment anyTransferHistoryFragment2 = this;
kIT kit2 = c16148leh3.j;
if (kit2 == null) {
c16148leh3.a = anyTransferHistoryFragment2;
} else {
kit2.b = anyTransferHistoryFragment2;
}
Context requireContext = requireContext();
C14957gcv.c(requireContext, "");
C16148leh c16148leh4 = this.h;
if (c16148leh4 == null) {
C14957gcv.a("");
c16148leh = null;
} else {
c16148leh = c16148leh4;
}
this.c = new HistoryAdapter(requireContext, c16148leh, new LWm(this), new IeS(this), new Sts(this));
C16148leh c16148leh5 = this.h;
if (c16148leh5 == null) {
C14957gcv.a("");
c16148leh5 = null;
}
HistoryAdapter historyAdapter = this.c;
if (historyAdapter == null) {
C14957gcv.a("");
historyAdapter = null;
}
RecyclerView.Sts<?> d = c16148leh5.d(historyAdapter);
C14957gcv.c(d, "");
this.j = d;
C8912dZm c8912dZm = new C8912dZm();
c8912dZm.setSupportsChangeAnimations(false);
RecyclerView recyclerView = this.recyclerView;
if (recyclerView == null) {
C14957gcv.a("");
recyclerView = null;
}
recyclerView.setLayoutManager(linearLayoutManager);
RecyclerView recyclerView2 = this.recyclerView;
if (recyclerView2 == null) {
C14957gcv.a("");
recyclerView2 = null;
}
RecyclerView.Sts<?> sts = this.j;
if (sts == null) {
C14957gcv.a("");
sts = null;
}
recyclerView2.setAdapter(sts);
RecyclerView recyclerView3 = this.recyclerView;
if (recyclerView3 == null) {
C14957gcv.a("");
recyclerView3 = null;
}
recyclerView3.setItemAnimator(c8912dZm);
RecyclerView recyclerView4 = this.recyclerView;
if (recyclerView4 == null) {
C14957gcv.a("");
recyclerView4 = null;
}
recyclerView4.setHasFixedSize(false);
RecyclerView recyclerView5 = this.recyclerView;
if (recyclerView5 == null) {
C14957gcv.a("");
recyclerView5 = null;
}
recyclerView5.setNestedScrollingEnabled(false);
C16148leh c16148leh6 = this.h;
if (c16148leh6 == null) {
C14957gcv.a("");
c16148leh6 = null;
}
RecyclerView recyclerView6 = this.recyclerView;
if (recyclerView6 == null) {
C14957gcv.a("");
recyclerView6 = null;
}
c16148leh6.b(recyclerView6);
RelativeLayout relativeLayout = this.emptyCard;
if (relativeLayout == null) {
C14957gcv.a("");
relativeLayout = null;
}
relativeLayout.setOnClickListener(new View.OnClickListener(this) { // from class: o.fCk
private AnyTransferHistoryFragment c;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
AnyTransferHistoryFragment.c(this.c);
}
{
this.c = this;
}
});
TextView textView2 = this.noHistoryDescriptionTextView;
if (textView2 != null) {
textView = textView2;
} else {
C14957gcv.a("");
}
textView.setText(g());
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onSaveInstanceState(Bundle bundle) {
C14957gcv.e(bundle, "");
super.onSaveInstanceState(bundle);
C16148leh c16148leh = this.h;
if (c16148leh == null) {
C14957gcv.a("");
c16148leh = null;
}
bundle.putParcelable("RecyclerViewExpandableItemManager", c16148leh.Oa_());
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroyView() {
RecyclerView recyclerView = this.recyclerView;
if (recyclerView == null) {
C14957gcv.a("");
recyclerView = null;
}
recyclerView.setItemAnimator(null);
RecyclerView recyclerView2 = this.recyclerView;
if (recyclerView2 == null) {
C14957gcv.a("");
recyclerView2 = null;
}
recyclerView2.setAdapter(null);
super.onDestroyView();
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
j().w_();
super.onDestroy();
}
/* loaded from: classes5.dex */
static final class IeS extends AbstractC14961gcz implements InterfaceC14894gbR<C1089Vj, C14866gag> {
private AnyTransferHistoryFragment b;
@Override // o.InterfaceC14894gbR
public final /* synthetic */ C14866gag invoke(C1089Vj c1089Vj) {
C1089Vj c1089Vj2 = c1089Vj;
C14957gcv.e(c1089Vj2, "");
this.b.d(c1089Vj2);
this.b.j().a(c1089Vj2);
return C14866gag.c;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
IeS(AnyTransferHistoryFragment anyTransferHistoryFragment) {
super(1);
this.b = anyTransferHistoryFragment;
}
}
/* loaded from: classes5.dex */
static final class LWm extends AbstractC14961gcz implements InterfaceC14894gbR<C1089Vj, C14866gag> {
private AnyTransferHistoryFragment e;
@Override // o.InterfaceC14894gbR
public final /* synthetic */ C14866gag invoke(C1089Vj c1089Vj) {
C1089Vj c1089Vj2 = c1089Vj;
C14957gcv.e(c1089Vj2, "");
this.e.e(c1089Vj2);
this.e.j().b(c1089Vj2);
return C14866gag.c;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
LWm(AnyTransferHistoryFragment anyTransferHistoryFragment) {
super(1);
this.e = anyTransferHistoryFragment;
}
}
/* loaded from: classes5.dex */
static final class Sts extends AbstractC14961gcz implements InterfaceC14890gbN<C14866gag> {
private AnyTransferHistoryFragment b;
@Override // o.InterfaceC14890gbN
public final /* synthetic */ C14866gag invoke() {
this.b.j().b();
return C14866gag.c;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
Sts(AnyTransferHistoryFragment anyTransferHistoryFragment) {
super(0);
this.b = anyTransferHistoryFragment;
}
}
@Override // o.InterfaceC9010dbe.IeS
public final void c() {
View view = this.loadingView;
View view2 = null;
if (view == null) {
C14957gcv.a("");
view = null;
}
view.setVisibility(8);
View view3 = this.historyView;
if (view3 == null) {
C14957gcv.a("");
view3 = null;
}
view3.setVisibility(8);
View view4 = this.noHistoryDescriptionView;
if (view4 != null) {
view2 = view4;
} else {
C14957gcv.a("");
}
view2.setVisibility(0);
}
@Override // o.InterfaceC9010dbe.IeS
public final void a() {
this.d = false;
HistoryAdapter historyAdapter = this.c;
View view = null;
if (historyAdapter == null) {
C14957gcv.a("");
historyAdapter = null;
}
historyAdapter.d(HistoryAdapter.Sts.ERROR);
View view2 = this.loadingView;
if (view2 == null) {
C14957gcv.a("");
view2 = null;
}
view2.setVisibility(8);
View view3 = this.historyView;
if (view3 != null) {
view = view3;
} else {
C14957gcv.a("");
}
view.setVisibility(0);
}
@Override // o.InterfaceC9010dbe.IeS
public final void d(String str, String str2) {
C14957gcv.e(str, "");
C14957gcv.e(str2, "");
this.d = false;
HistoryAdapter historyAdapter = this.c;
View view = null;
if (historyAdapter == null) {
C14957gcv.a("");
historyAdapter = null;
}
if (str == null) {
str = historyAdapter.b.getResources().getString(R.string.auto_regen_repeat_history_error_state_title);
C14957gcv.c((Object) str, "");
}
historyAdapter.a = str;
if (str2 == null) {
str2 = historyAdapter.b.getResources().getString(R.string.auto_regen_repeat_history_error_state_message);
C14957gcv.c((Object) str2, "");
}
historyAdapter.d = str2;
historyAdapter.d(HistoryAdapter.Sts.ERROR);
View view2 = this.loadingView;
if (view2 == null) {
C14957gcv.a("");
view2 = null;
}
view2.setVisibility(8);
View view3 = this.historyView;
if (view3 != null) {
view = view3;
} else {
C14957gcv.a("");
}
view.setVisibility(0);
}
private final void b(C1093Vl c1093Vl) {
HistoryAdapter historyAdapter = this.c;
if (historyAdapter == null) {
C14957gcv.a("");
historyAdapter = null;
}
historyAdapter.c = c1093Vl.a;
historyAdapter.notifyDataSetChanged();
}
@Override // com.scb.phone.view.fragment.BaseFragment, o.InterfaceC6638cYp
public final void v() {
View view = this.noHistoryDescriptionView;
View view2 = null;
if (view == null) {
C14957gcv.a("");
view = null;
}
view.setVisibility(8);
RelativeLayout relativeLayout = this.emptyCard;
if (relativeLayout == null) {
C14957gcv.a("");
relativeLayout = null;
}
relativeLayout.setVisibility(8);
View view3 = this.loadingView;
if (view3 == null) {
C14957gcv.a("");
view3 = null;
}
view3.setVisibility(0);
View view4 = this.historyView;
if (view4 != null) {
view2 = view4;
} else {
C14957gcv.a("");
}
view2.setVisibility(8);
}
@Override // o.InterfaceC9010dbe.IeS
public final void e() {
HistoryAdapter historyAdapter = this.c;
if (historyAdapter == null) {
C14957gcv.a("");
historyAdapter = null;
}
historyAdapter.d(HistoryAdapter.Sts.LOADING);
}
@Override // o.InterfaceC9010dbe.IeS
public final void b() {
HistoryAdapter historyAdapter = this.c;
if (historyAdapter == null) {
C14957gcv.a("");
historyAdapter = null;
}
historyAdapter.d(HistoryAdapter.Sts.NONE);
}
@Override // o.C16148leh.HBt
public final void d(int i) {
C1089Vj c = c(i);
if (c != null) {
c.h = true;
}
}
@Override // o.C16148leh.IeS
public final void e(int i) {
C1089Vj c = c(i);
if (c != null) {
c.h = false;
}
}
private final C1089Vj c(int i) {
HistoryAdapter historyAdapter = this.c;
if (historyAdapter == null) {
C14957gcv.a("");
historyAdapter = null;
}
ArrayList<C1089Vj> arrayList = historyAdapter.e;
if (i < arrayList.size()) {
return arrayList.get(i);
}
return null;
}
@Override // o.InterfaceC9010dbe.IeS
public final void bq_() {
Intent intent = new Intent(getContext(), (Class<?>) FavouriteSelectedActivity.class);
intent.putExtra("source", "repeat_transaction");
startActivity(intent);
}
@Override // o.InterfaceC9010dbe.IeS
public final void a(String str, QJy qJy) {
C14957gcv.e(str, "");
C14957gcv.e(qJy, "");
FragmentActivity activity = getActivity();
if (activity != null) {
ThirdPartySlipActivity.LWm lWm = ThirdPartySlipActivity.b;
startActivity(ThirdPartySlipActivity.LWm.aaD_(activity, str, qJy));
}
}
public static /* synthetic */ void c(AnyTransferHistoryFragment anyTransferHistoryFragment) {
C14957gcv.e(anyTransferHistoryFragment, "");
anyTransferHistoryFragment.j().c();
}
@Override // o.InterfaceC9010dbe.IeS
public final void a(C1093Vl c1093Vl) {
if (c1093Vl != null) {
this.d = !c1093Vl.b;
HistoryAdapter historyAdapter = this.c;
HistoryAdapter historyAdapter2 = null;
if (historyAdapter == null) {
C14957gcv.a("");
historyAdapter = null;
}
historyAdapter.d(HistoryAdapter.Sts.NONE);
View view = this.loadingView;
if (view == null) {
C14957gcv.a("");
view = null;
}
view.setVisibility(8);
View view2 = this.historyView;
if (view2 == null) {
C14957gcv.a("");
view2 = null;
}
view2.setVisibility(0);
HistoryAdapter historyAdapter3 = this.c;
if (historyAdapter3 == null) {
C14957gcv.a("");
} else {
historyAdapter2 = historyAdapter3;
}
C14957gcv.e(c1093Vl, "");
if (!c1093Vl.c.isEmpty()) {
int size = historyAdapter2.e.size();
int size2 = c1093Vl.c.size();
historyAdapter2.e.addAll(c1093Vl.c);
historyAdapter2.notifyItemRangeInserted(size, size2);
historyAdapter2.notifyItemChanged(size - 1);
}
b(c1093Vl);
C15296gmk.b().e(new C15595gv(true));
return;
}
a();
}
@Override // o.InterfaceC9010dbe.IeS
public final void d(C1093Vl c1093Vl) {
if (c1093Vl != null) {
this.d = !c1093Vl.b;
HistoryAdapter historyAdapter = this.c;
HistoryAdapter historyAdapter2 = null;
if (historyAdapter == null) {
C14957gcv.a("");
historyAdapter = null;
}
historyAdapter.d(HistoryAdapter.Sts.NONE);
View view = this.loadingView;
if (view == null) {
C14957gcv.a("");
view = null;
}
view.setVisibility(8);
View view2 = this.historyView;
if (view2 == null) {
C14957gcv.a("");
view2 = null;
}
view2.setVisibility(0);
HistoryAdapter historyAdapter3 = this.c;
if (historyAdapter3 == null) {
C14957gcv.a("");
} else {
historyAdapter2 = historyAdapter3;
}
C14957gcv.e(c1093Vl, "");
historyAdapter2.e.clear();
historyAdapter2.e.addAll(c1093Vl.c);
historyAdapter2.notifyDataSetChanged();
b(c1093Vl);
return;
}
a();
}
static {
new HBt((byte) 0);
}
}