337 lines
13 KiB
Java
337 lines
13 KiB
Java
|
package com.scb.phone.view.fragment.requesttopay;
|
||
|
|
||
|
import android.content.Intent;
|
||
|
import android.os.Bundle;
|
||
|
import android.text.TextUtils;
|
||
|
import android.view.LayoutInflater;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewGroup;
|
||
|
import android.widget.AdapterView;
|
||
|
import android.widget.ArrayAdapter;
|
||
|
import android.widget.SpinnerAdapter;
|
||
|
import android.widget.TextView;
|
||
|
import androidx.core.widget.NestedScrollView;
|
||
|
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.requesttopay.EnterProxyActivity;
|
||
|
import com.scb.phone.view.activity.requesttopay.SummaryDetailActivity;
|
||
|
import com.scb.phone.view.adapter.requesttopay.OutgoingAdapter;
|
||
|
import com.scb.phone.view.fragment.requesttopay.OutgoingFragment;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.List;
|
||
|
import o.BE;
|
||
|
import o.C0693Mj;
|
||
|
import o.C10461eEv;
|
||
|
import o.C10732eN;
|
||
|
import o.C10894eS;
|
||
|
import o.C1168Xb;
|
||
|
import o.C1189Xo;
|
||
|
import o.C16157lj;
|
||
|
import o.C5975cEs;
|
||
|
import o.C8238dFW;
|
||
|
import o.InterfaceC13391fZD;
|
||
|
import o.InterfaceC8929daC;
|
||
|
import o.LOB;
|
||
|
import o.NoP;
|
||
|
import o.VI;
|
||
|
import o.VL;
|
||
|
import o.irv;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public class OutgoingFragment extends Hilt_OutgoingFragment implements InterfaceC8929daC.IeS, OutgoingAdapter.RVV {
|
||
|
|
||
|
@BindView
|
||
|
TextView emptyOutgoingTextView;
|
||
|
private OutgoingAdapter i;
|
||
|
|
||
|
@InterfaceC13391fZD
|
||
|
public C5975cEs outgoingPresenter;
|
||
|
|
||
|
@BindView
|
||
|
RecyclerView outgoingRecyclerView;
|
||
|
|
||
|
public static OutgoingFragment a(String str) {
|
||
|
OutgoingFragment outgoingFragment = new OutgoingFragment();
|
||
|
Bundle bundle = new Bundle();
|
||
|
bundle.putString("source", str);
|
||
|
outgoingFragment.setArguments(bundle);
|
||
|
return outgoingFragment;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.fragment.app.Fragment
|
||
|
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||
|
View inflate = layoutInflater.inflate(R.layout.2131559876, viewGroup, false);
|
||
|
ButterKnife.c(this, inflate);
|
||
|
this.i = new OutgoingAdapter(this);
|
||
|
this.outgoingPresenter.e((C5975cEs) this);
|
||
|
C5975cEs c5975cEs = this.outgoingPresenter;
|
||
|
c5975cEs.d.e();
|
||
|
C8238dFW c8238dFW = c5975cEs.d;
|
||
|
c8238dFW.d(c8238dFW.i, new C5975cEs.Sts(c5975cEs, (byte) 0));
|
||
|
NestedScrollView nestedScrollView = this.scrollView;
|
||
|
if (nestedScrollView != null) {
|
||
|
nestedScrollView.setOnScrollChangeListener(new C10461eEv(this));
|
||
|
}
|
||
|
this.toolbarProxy.a(R.menu.2131689479);
|
||
|
((BaseRequestToPayFragment) this).c = this.toolbarProxy.jO_().findItem(R.id.menu_proxy_filter);
|
||
|
return inflate;
|
||
|
}
|
||
|
|
||
|
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||
|
public void onDestroyView() {
|
||
|
this.outgoingPresenter.w_();
|
||
|
RecyclerView recyclerView = this.outgoingRecyclerView;
|
||
|
if (recyclerView != null) {
|
||
|
recyclerView.setItemAnimator(null);
|
||
|
this.outgoingRecyclerView.setAdapter(null);
|
||
|
this.outgoingRecyclerView = null;
|
||
|
}
|
||
|
super.onDestroyView();
|
||
|
}
|
||
|
|
||
|
@OnClick
|
||
|
public void onNewRequestClick() {
|
||
|
Intent intent = new Intent(getContext(), (Class<?>) EnterProxyActivity.class);
|
||
|
intent.putExtra("source", Q());
|
||
|
startActivityForResult(intent, 6000);
|
||
|
}
|
||
|
|
||
|
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||
|
public void onActivityResult(int i, int i2, Intent intent) {
|
||
|
super.onActivityResult(i, i2, intent);
|
||
|
if (i == 6000 && i2 == -1) {
|
||
|
OutgoingAdapter outgoingAdapter = this.i;
|
||
|
if (outgoingAdapter.e) {
|
||
|
outgoingAdapter.e = false;
|
||
|
}
|
||
|
C5975cEs c5975cEs = this.outgoingPresenter;
|
||
|
c5975cEs.b = 1;
|
||
|
c5975cEs.a = 1;
|
||
|
e(((BaseRequestToPayFragment) this).d);
|
||
|
this.outgoingRecyclerView.setAdapter(null);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // androidx.fragment.app.Fragment
|
||
|
public void setMenuVisibility(boolean z) {
|
||
|
super.setMenuVisibility(z);
|
||
|
if (!z || this.outgoingPresenter == null) {
|
||
|
return;
|
||
|
}
|
||
|
this.customSpinner.setSelection(0);
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC8929daC.IeS
|
||
|
public final void b(List<VL> list) {
|
||
|
if (!list.isEmpty()) {
|
||
|
this.toolbarProxy.setVisibility(8);
|
||
|
this.newAliasLayout.setVisibility(0);
|
||
|
ArrayList arrayList = new ArrayList();
|
||
|
ArrayList arrayList2 = new ArrayList();
|
||
|
arrayList.add(new C10732eN(getString(R.string.request_money_all_alias), "ALL"));
|
||
|
arrayList.addAll(a(list));
|
||
|
arrayList2.addAll(d(list));
|
||
|
if (this.f == null) {
|
||
|
this.f = new ArrayAdapter<C10732eN>(this, getActivity(), arrayList) { // from class: com.scb.phone.view.fragment.requesttopay.OutgoingFragment.5
|
||
|
private OutgoingFragment c;
|
||
|
|
||
|
{
|
||
|
this.c = this;
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.ArrayAdapter, android.widget.Adapter
|
||
|
public final View getView(int i, View view, ViewGroup viewGroup) {
|
||
|
View view2 = super.getView(i, view, viewGroup);
|
||
|
((TextView) view2).setGravity(5);
|
||
|
return view2;
|
||
|
}
|
||
|
};
|
||
|
this.customSpinner.setAdapter((SpinnerAdapter) this.f);
|
||
|
this.customSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(this, arrayList, arrayList2) { // from class: com.scb.phone.view.fragment.requesttopay.OutgoingFragment.4
|
||
|
private OutgoingFragment a;
|
||
|
private ArrayList c;
|
||
|
private ArrayList d;
|
||
|
|
||
|
@Override // android.widget.AdapterView.OnItemSelectedListener
|
||
|
public final void onNothingSelected(AdapterView<?> adapterView) {
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.a = this;
|
||
|
this.c = arrayList;
|
||
|
this.d = arrayList2;
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.AdapterView.OnItemSelectedListener
|
||
|
public final void onItemSelected(AdapterView<?> adapterView, View view, int i, long j) {
|
||
|
if (TextUtils.equals(((C10732eN) this.c.get(i)).c, "ALL")) {
|
||
|
((BaseRequestToPayFragment) this.a).d = this.d;
|
||
|
} else {
|
||
|
((BaseRequestToPayFragment) this.a).d = OutgoingFragment.e((C10732eN) this.d.get(i - 1));
|
||
|
}
|
||
|
this.a.outgoingRecyclerView.setAdapter(null);
|
||
|
OutgoingAdapter outgoingAdapter = this.a.i;
|
||
|
if (outgoingAdapter.e) {
|
||
|
outgoingAdapter.e = false;
|
||
|
}
|
||
|
C5975cEs c5975cEs = this.a.outgoingPresenter;
|
||
|
c5975cEs.b = 1;
|
||
|
c5975cEs.a = 1;
|
||
|
OutgoingFragment outgoingFragment = this.a;
|
||
|
outgoingFragment.e(((BaseRequestToPayFragment) outgoingFragment).d);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
} else {
|
||
|
NoP noP = new irv(getContext(), this.toolbarProxy.findViewById(R.id.menu_proxy_filter)).c;
|
||
|
this.proxyIdTextView.setTag(null);
|
||
|
noP.clear();
|
||
|
}
|
||
|
((BaseRequestToPayFragment) this).c.setTitle(getString(R.string.request_money_selecting_proxy_title));
|
||
|
this.container.setVisibility(8);
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC8929daC.IeS
|
||
|
public final void b(boolean z, List<VI> list, int i) {
|
||
|
if (list == null) {
|
||
|
OutgoingAdapter outgoingAdapter = this.i;
|
||
|
if (outgoingAdapter.e) {
|
||
|
outgoingAdapter.e = false;
|
||
|
}
|
||
|
} else if (list.isEmpty() || i == 0) {
|
||
|
this.emptyOutgoingTextView.setVisibility(0);
|
||
|
this.container.setVisibility(8);
|
||
|
} else {
|
||
|
getContext();
|
||
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(1, false);
|
||
|
if (z) {
|
||
|
OutgoingAdapter outgoingAdapter2 = this.i;
|
||
|
outgoingAdapter2.d = list;
|
||
|
outgoingAdapter2.notifyDataSetChanged();
|
||
|
} else {
|
||
|
OutgoingAdapter outgoingAdapter3 = this.i;
|
||
|
outgoingAdapter3.d.addAll(list);
|
||
|
outgoingAdapter3.notifyDataSetChanged();
|
||
|
}
|
||
|
this.outgoingRecyclerView.setLayoutManager(linearLayoutManager);
|
||
|
this.outgoingRecyclerView.setNestedScrollingEnabled(false);
|
||
|
this.outgoingRecyclerView.setAdapter(this.i);
|
||
|
OutgoingAdapter outgoingAdapter4 = this.i;
|
||
|
if (outgoingAdapter4.e) {
|
||
|
outgoingAdapter4.e = false;
|
||
|
}
|
||
|
this.emptyOutgoingTextView.setVisibility(8);
|
||
|
this.container.setVisibility(0);
|
||
|
}
|
||
|
this.selectionProxyTextView.setVisibility(8);
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC8929daC.IeS
|
||
|
public final void c(C0693Mj c0693Mj) {
|
||
|
this.emptyOutgoingTextView.setVisibility(0);
|
||
|
this.emptyOutgoingTextView.setText(c0693Mj.c);
|
||
|
this.container.setVisibility(8);
|
||
|
this.outgoingRecyclerView.setAdapter(null);
|
||
|
this.selectionProxyTextView.setVisibility(8);
|
||
|
OutgoingAdapter outgoingAdapter = this.i;
|
||
|
if (outgoingAdapter.e) {
|
||
|
outgoingAdapter.e = false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.scb.phone.view.fragment.BaseFragment
|
||
|
public final void aJ_() {
|
||
|
super.aJ_();
|
||
|
e(((BaseRequestToPayFragment) this).d);
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: private */
|
||
|
public void e(final List<C10732eN> list) {
|
||
|
if (isMenuVisible()) {
|
||
|
C5975cEs c5975cEs = this.outgoingPresenter;
|
||
|
if (c5975cEs.b > c5975cEs.a) {
|
||
|
return;
|
||
|
}
|
||
|
this.container.setVisibility(0);
|
||
|
OutgoingAdapter outgoingAdapter = this.i;
|
||
|
OutgoingAdapter.LWm lWm = new OutgoingAdapter.LWm(this, list) { // from class: o.fzt
|
||
|
private List c;
|
||
|
private OutgoingFragment e;
|
||
|
|
||
|
@Override // com.scb.phone.view.adapter.requesttopay.OutgoingAdapter.LWm
|
||
|
public final void a(boolean z) {
|
||
|
OutgoingFragment.d(this.e, this.c, true);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.e = this;
|
||
|
this.c = list;
|
||
|
}
|
||
|
};
|
||
|
if (!outgoingAdapter.e) {
|
||
|
outgoingAdapter.e = true;
|
||
|
lWm.a(true);
|
||
|
}
|
||
|
this.selectionProxyTextView.setVisibility(8);
|
||
|
this.emptyOutgoingTextView.setVisibility(8);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ void d(OutgoingFragment outgoingFragment, List list, boolean z) {
|
||
|
if (z) {
|
||
|
C5975cEs c5975cEs = outgoingFragment.outgoingPresenter;
|
||
|
if (c5975cEs.b <= c5975cEs.a) {
|
||
|
if (c5975cEs.f != 0) {
|
||
|
c5975cEs.f.v();
|
||
|
}
|
||
|
C10894eS e = C10894eS.e();
|
||
|
e.c = list;
|
||
|
e.b = "90";
|
||
|
e.a = "10";
|
||
|
e.d = String.valueOf(c5975cEs.b);
|
||
|
C8238dFW c8238dFW = c5975cEs.d;
|
||
|
if (!c8238dFW.h.isDisposed()) {
|
||
|
c8238dFW.h.dispose();
|
||
|
}
|
||
|
c5975cEs.d.c(e);
|
||
|
C8238dFW c8238dFW2 = c5975cEs.d;
|
||
|
c8238dFW2.d(c8238dFW2.i, new C5975cEs.IeS(c5975cEs, (byte) 0));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.scb.phone.view.adapter.requesttopay.OutgoingAdapter.RVV
|
||
|
public final void a(int i) {
|
||
|
LOB lob = ((OutgoingAdapter) this.outgoingRecyclerView.g).d.get(i).a;
|
||
|
C1189Xo h = C1189Xo.h();
|
||
|
Intent intent = new Intent(getContext(), (Class<?>) SummaryDetailActivity.class);
|
||
|
C5975cEs c5975cEs = this.outgoingPresenter;
|
||
|
BE be = c5975cEs.e;
|
||
|
boolean T = c5975cEs.c.b.T();
|
||
|
h.ab = lob.l;
|
||
|
h.ac = lob.g;
|
||
|
h.Z = BE.b(lob.l, lob.j, T);
|
||
|
h.Y = lob.h;
|
||
|
h.T = lob.i;
|
||
|
h.U = BE.b(lob.h, lob.f, T);
|
||
|
C1168Xb.LWm lWm = new C1168Xb.LWm();
|
||
|
lWm.b = BE.c(Double.valueOf(lob.c));
|
||
|
h.j = new C1168Xb(lWm, (byte) 0);
|
||
|
h.w = be.a(lob.b);
|
||
|
h.O = lob.a;
|
||
|
h.au = lob.k == null ? "" : (String) C16157lj.c(new Object[]{be, lob.k}, 838289628, -838289623, System.identityHashCode(be));
|
||
|
h.aB = lob.f8250o;
|
||
|
h.aj = lob.n;
|
||
|
h.e("rtp.detail");
|
||
|
intent.addFlags(603979776);
|
||
|
intent.putExtra("request_to_pay.SummaryDetailActivity.titleName", getString(R.string.request_to_pay_outgoing_detail_title));
|
||
|
intent.putExtra("request_to_pay.SummaryDetailActivity.button.paynow", false);
|
||
|
intent.putExtra("com.scb.phone.EXTRA_REVIEW", h);
|
||
|
startActivity(intent);
|
||
|
}
|
||
|
}
|