291 lines
10 KiB
Java
291 lines
10 KiB
Java
|
package com.scb.phone.view.fragment.transferandpay.transfer;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.content.Intent;
|
||
|
import android.content.IntentFilter;
|
||
|
import android.os.Bundle;
|
||
|
import android.os.SystemClock;
|
||
|
import android.view.LayoutInflater;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewGroup;
|
||
|
import android.widget.ImageView;
|
||
|
import android.widget.TextView;
|
||
|
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.transferandpay.transfer.TransferToMeStep1Adapter;
|
||
|
import com.scb.phone.view.fragment.BaseFragment;
|
||
|
import com.scb.phone.view.fragment.transferandpay.transfer.TransferToMeStep1Fragment;
|
||
|
import java.util.List;
|
||
|
import o.AbstractC1237Yr;
|
||
|
import o.C10457eEr;
|
||
|
import o.C1223Yj;
|
||
|
import o.C1233Yp;
|
||
|
import o.C12891fKc;
|
||
|
import o.GEP;
|
||
|
import o.InterfaceC13391fZD;
|
||
|
import o.InterfaceC9010dbe;
|
||
|
import o.Jel;
|
||
|
import o.YKU;
|
||
|
import o.ZI;
|
||
|
import o.cWT;
|
||
|
import o.fSJ;
|
||
|
import o.fSQ;
|
||
|
import o.glR;
|
||
|
import o.nMh;
|
||
|
import o.yGw;
|
||
|
import o.zEQ;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public class TransferToMeStep1Fragment extends Hilt_TransferToMeStep1Fragment implements InterfaceC9010dbe.WNf, TransferToMeStep1Adapter.IeS {
|
||
|
private fSJ c;
|
||
|
private TransferToMeStep1Adapter d;
|
||
|
private boolean f = false;
|
||
|
private boolean g;
|
||
|
private fSJ h;
|
||
|
|
||
|
@BindView
|
||
|
protected ImageView imageIcon;
|
||
|
private long j;
|
||
|
|
||
|
@InterfaceC13391fZD
|
||
|
public cWT presenter;
|
||
|
|
||
|
@BindView
|
||
|
RecyclerView recyclerView;
|
||
|
|
||
|
@BindView
|
||
|
protected TextView textTitle;
|
||
|
|
||
|
@BindView
|
||
|
ViewGroup viewGroupNoTargets;
|
||
|
|
||
|
public static TransferToMeStep1Fragment d(String str, AbstractC1237Yr abstractC1237Yr) {
|
||
|
Bundle bundle = new Bundle();
|
||
|
bundle.putString("account_source", str);
|
||
|
bundle.putParcelable("transfer_display", abstractC1237Yr);
|
||
|
TransferToMeStep1Fragment transferToMeStep1Fragment = new TransferToMeStep1Fragment();
|
||
|
transferToMeStep1Fragment.setArguments(bundle);
|
||
|
return transferToMeStep1Fragment;
|
||
|
}
|
||
|
|
||
|
public static TransferToMeStep1Fragment a(String str, String str2, AbstractC1237Yr abstractC1237Yr) {
|
||
|
Bundle bundle = new Bundle();
|
||
|
bundle.putString("account_source", str);
|
||
|
bundle.putString("transfer_function", str2);
|
||
|
bundle.putParcelable("fixed_transfer_display", new C1223Yj().d(abstractC1237Yr));
|
||
|
TransferToMeStep1Fragment transferToMeStep1Fragment = new TransferToMeStep1Fragment();
|
||
|
transferToMeStep1Fragment.setArguments(bundle);
|
||
|
return transferToMeStep1Fragment;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.fragment.app.Fragment
|
||
|
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||
|
View inflate = layoutInflater.inflate(R.layout.2131559970, viewGroup, false);
|
||
|
((BaseFragment) this).a = ButterKnife.c(this, inflate);
|
||
|
this.presenter.e((cWT) this);
|
||
|
this.recyclerView.setNestedScrollingEnabled(false);
|
||
|
if (getArguments() != null) {
|
||
|
AbstractC1237Yr abstractC1237Yr = (AbstractC1237Yr) getArguments().getParcelable("transfer_display");
|
||
|
this.presenter.b(getArguments().getString("account_source"));
|
||
|
Bundle arguments = getArguments();
|
||
|
if ((arguments != null ? arguments.getString("transfer_function", "TRANSFER") : "TRANSFER").equals("FIXED_TRANSFER")) {
|
||
|
this.f = true;
|
||
|
abstractC1237Yr = (AbstractC1237Yr) getArguments().getParcelable("fixed_transfer_display");
|
||
|
this.presenter.b = abstractC1237Yr;
|
||
|
}
|
||
|
if (abstractC1237Yr != null) {
|
||
|
Context context = getContext();
|
||
|
this.textTitle.setText(abstractC1237Yr.i);
|
||
|
String str = abstractC1237Yr.e;
|
||
|
if (context != null) {
|
||
|
C12891fKc.azg_(context, nMh.getDrawable(context, R.drawable.bankicon_scb), this.imageIcon, str, context.getResources().getDimensionPixelOffset(R.dimen.f15222131165286), nMh.getColor(context, R.color.f3412131099849));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return inflate;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.fragment.app.Fragment
|
||
|
public void onStart() {
|
||
|
super.onStart();
|
||
|
if (this.g) {
|
||
|
return;
|
||
|
}
|
||
|
this.h = glR.Ge_(getContext(), new IntentFilter("FAVORITE")).subscribe(new fSQ(this) { // from class: o.fHr
|
||
|
private TransferToMeStep1Fragment a;
|
||
|
|
||
|
@Override // o.fSQ
|
||
|
public final void c(Object obj) {
|
||
|
TransferToMeStep1Fragment.d(this.a);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.a = this;
|
||
|
}
|
||
|
}, new fSQ() { // from class: o.fHt
|
||
|
@Override // o.fSQ
|
||
|
public final void c(Object obj) {
|
||
|
guQ.a((Throwable) obj);
|
||
|
}
|
||
|
});
|
||
|
this.c = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_BANK_RECEIVED")).subscribe(new fSQ(this) { // from class: o.fHv
|
||
|
private TransferToMeStep1Fragment e;
|
||
|
|
||
|
@Override // o.fSQ
|
||
|
public final void c(Object obj) {
|
||
|
TransferToMeStep1Fragment.e(this.e);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.e = this;
|
||
|
}
|
||
|
}, new fSQ() { // from class: o.fHt
|
||
|
@Override // o.fSQ
|
||
|
public final void c(Object obj) {
|
||
|
guQ.a((Throwable) obj);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
@Override // androidx.fragment.app.Fragment
|
||
|
public void onStop() {
|
||
|
fSJ fsj = this.h;
|
||
|
if (fsj != null && !fsj.isDisposed()) {
|
||
|
this.h.dispose();
|
||
|
}
|
||
|
fSJ fsj2 = this.c;
|
||
|
if (fsj2 != null && !fsj2.isDisposed()) {
|
||
|
this.c.dispose();
|
||
|
}
|
||
|
super.onStop();
|
||
|
}
|
||
|
|
||
|
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||
|
public void onDestroy() {
|
||
|
this.presenter.w_();
|
||
|
super.onDestroy();
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC9010dbe.WNf
|
||
|
public final void b(List<C1233Yp> list) {
|
||
|
if (list.isEmpty()) {
|
||
|
this.viewGroupNoTargets.setVisibility(0);
|
||
|
this.recyclerView.setVisibility(8);
|
||
|
return;
|
||
|
}
|
||
|
this.viewGroupNoTargets.setVisibility(8);
|
||
|
this.recyclerView.setVisibility(0);
|
||
|
TransferToMeStep1Adapter transferToMeStep1Adapter = this.d;
|
||
|
if (transferToMeStep1Adapter == null) {
|
||
|
TransferToMeStep1Adapter transferToMeStep1Adapter2 = new TransferToMeStep1Adapter(list);
|
||
|
this.d = transferToMeStep1Adapter2;
|
||
|
transferToMeStep1Adapter2.c = this;
|
||
|
this.recyclerView.setAdapter(this.d);
|
||
|
return;
|
||
|
}
|
||
|
transferToMeStep1Adapter.d = list;
|
||
|
transferToMeStep1Adapter.notifyDataSetChanged();
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC9010dbe.WNf
|
||
|
public final void e(C1233Yp c1233Yp) {
|
||
|
e(c1233Yp, true);
|
||
|
this.g = true;
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC9010dbe.WNf
|
||
|
public final void a(AbstractC1237Yr abstractC1237Yr, boolean z) {
|
||
|
Intent intent;
|
||
|
if (z) {
|
||
|
intent = new Intent("com.scb.phone/BROADCAST_TRANSFER_NEXT_FAVOURITE_STEP");
|
||
|
} else {
|
||
|
intent = new Intent("com.scb.phone/BROADCAST_TRANSFER_NEXT_STEP");
|
||
|
}
|
||
|
intent.putExtra("com.scb.phone.EXTRA_TRANSFER_TARGET_DATA", abstractC1237Yr);
|
||
|
intent.putExtra("com.scb.phone.EXTRA_FROM_TRANSFER_TO_ME_PAGE", true);
|
||
|
Bundle arguments = getArguments();
|
||
|
if ((arguments != null ? arguments.getString("transfer_function", "TRANSFER") : "TRANSFER").equals("FIXED_TRANSFER")) {
|
||
|
intent.putExtra("com.scb.phone.EXTRA_TRANSFER_FUNCTION", "FIXED_TRANSFER");
|
||
|
intent.putExtra("com.scb.phone.EXTRA_TRANSFER_TO_MAIN_AUTO", false);
|
||
|
}
|
||
|
C10457eEr.aqd_(this, intent);
|
||
|
}
|
||
|
|
||
|
@Override // com.scb.phone.view.adapter.transferandpay.transfer.TransferToMeStep1Adapter.IeS
|
||
|
public final void b(C1233Yp c1233Yp) {
|
||
|
e(c1233Yp, false);
|
||
|
}
|
||
|
|
||
|
private void e(C1233Yp c1233Yp, boolean z) {
|
||
|
if (SystemClock.elapsedRealtime() - this.j < 300) {
|
||
|
return;
|
||
|
}
|
||
|
this.j = SystemClock.elapsedRealtime();
|
||
|
this.presenter.e(c1233Yp, z);
|
||
|
}
|
||
|
|
||
|
@OnClick
|
||
|
public void onCloseButtonClicked() {
|
||
|
if (getContext() != null) {
|
||
|
Intent intent = new Intent("com.scb.phone/BROADCAST_TRANSFER_BACK_STEP");
|
||
|
if (this.f) {
|
||
|
this.f = false;
|
||
|
intent.putExtra("com.scb.phone.EXTRA_TRANSFER_FUNCTION", "FIXED_TRANSFER");
|
||
|
}
|
||
|
C10457eEr.aqd_(this, intent);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ void e(TransferToMeStep1Fragment transferToMeStep1Fragment) {
|
||
|
cWT cwt = transferToMeStep1Fragment.presenter;
|
||
|
cwt.e.a.j(transferToMeStep1Fragment.W());
|
||
|
yGw ygw = cwt.e;
|
||
|
ygw.d(ygw.i, new cWT.Sts(cwt, (byte) 0));
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ void d(TransferToMeStep1Fragment transferToMeStep1Fragment) {
|
||
|
final zEQ d;
|
||
|
final cWT cwt = transferToMeStep1Fragment.presenter;
|
||
|
YKU yku = new YKU(cwt.c);
|
||
|
YKU yku2 = new YKU(yku.a, new GEP(yku.b, new Jel(cwt) { // from class: o.cWY
|
||
|
private cWT c;
|
||
|
|
||
|
@Override // o.Jel
|
||
|
public final boolean e(Object obj) {
|
||
|
boolean equals;
|
||
|
equals = ((C1233Yp) obj).d.equals(this.c.e.a.n().b);
|
||
|
return equals;
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.c = cwt;
|
||
|
}
|
||
|
}));
|
||
|
if (yku2.b.hasNext()) {
|
||
|
d = zEQ.a(yku2.b.next());
|
||
|
} else {
|
||
|
d = zEQ.d();
|
||
|
}
|
||
|
if (d.d != 0) {
|
||
|
ZI.IeS ieS = new ZI.IeS(d) { // from class: o.cXb
|
||
|
private zEQ e;
|
||
|
|
||
|
@Override // o.ZI.IeS
|
||
|
public final void e(Object obj) {
|
||
|
cWT.b(this.e, (InterfaceC9010dbe.WNf) obj);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.e = d;
|
||
|
}
|
||
|
};
|
||
|
if (cwt.f != 0) {
|
||
|
ieS.e(cwt.f);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|