what-the-bank/sources/com/scb/phone/view/fragment/investment/FundActionsSearchFragment.java

618 lines
23 KiB
Java

package com.scb.phone.view.fragment.investment;
import android.content.Context;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.widget.ViewPager2;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.material.tabs.TabLayout;
import com.scb.phone.R;
import com.scb.phone.view.custom.common.DefaultButton;
import com.scb.phone.view.fragment.investment.FundActionsSearchFragment;
import com.scb.phone.view.fragment.investment.fundswitch.FundSwitchSearchListFragment;
import com.scb.phone.view.fragment.investment.purchase.SearchFundTabFragment;
import com.scb.phone.view.fragment.investment.redeem.FundRedeemSearchListFragment;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.function.BiFunction;
import o.AbstractC13173fSu;
import o.AbstractC13175fSw;
import o.AbstractC14961gcz;
import o.C0855Qa;
import o.C10454eEo;
import o.C12016eqJ;
import o.C12282evK;
import o.C13194fTh;
import o.C13371fYj;
import o.C13376fYo;
import o.C13396fZU;
import o.C13417fZt;
import o.C14851gaI;
import o.C14856gaP;
import o.C14866gag;
import o.C14957gcv;
import o.C15720hy;
import o.C5784bzb;
import o.EQ;
import o.EnumC0861Qd;
import o.InterfaceC13391fZD;
import o.InterfaceC13393fZL;
import o.InterfaceC14890gbN;
import o.InterfaceC14894gbR;
import o.InterfaceC14937gcb;
import o.InterfaceC6664cZg;
import o.MrX;
import o.PA;
import o.PD;
import o.PE;
import o.PW;
import o.PY;
import o.Wlt;
import o.WvI;
import o.ZI;
import o.fRR;
import o.fSJ;
import o.fSQ;
import o.fZZ;
import o.qeC;
/* loaded from: classes5.dex */
public final class FundActionsSearchFragment extends Hilt_FundActionsSearchFragment implements InterfaceC6664cZg.RVV {
private WvI c;
private String d;
private final InterfaceC13393fZL f;
private C12282evK g;
private fSJ i;
private String j;
@InterfaceC13391fZD
public C5784bzb presenter;
public FundActionsSearchFragment() {
Sts sts = Sts.b;
C14957gcv.e(sts, "");
this.f = new fZZ(sts);
this.j = "";
}
/* loaded from: classes5.dex */
public static final class RVV implements TextWatcher {
private FundActionsSearchFragment e;
@Override // android.text.TextWatcher
public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
public RVV(FundActionsSearchFragment fundActionsSearchFragment) {
this.e = fundActionsSearchFragment;
}
@Override // android.text.TextWatcher
public final void afterTextChanged(Editable editable) {
AbstractC13175fSw d = AbstractC13175fSw.d((Callable) new LWm(this.e, editable));
C14957gcv.c(d, "");
FundActionsSearchFragment fundActionsSearchFragment = this.e;
AbstractC13173fSu c = C13417fZt.c();
Objects.requireNonNull(c, "scheduler is null");
C13376fYo c13376fYo = new C13376fYo(d, c);
AbstractC13173fSu e = fRR.e();
Objects.requireNonNull(e, "scheduler is null");
fundActionsSearchFragment.i = new C13371fYj(c13376fYo, e).b(new fSQ(new HBt(this.e)) { // from class: com.scb.phone.view.fragment.investment.FundActionsSearchFragment.ojQ
private final InterfaceC14894gbR b;
@Override // o.fSQ
public final /* synthetic */ void c(Object obj) {
this.b.invoke(obj);
}
{
C14957gcv.e(r2, "");
this.b = r2;
}
}, C13194fTh.a);
}
}
@Override // androidx.fragment.app.Fragment
public final void onCreate(Bundle bundle) {
super.onCreate(bundle);
C5784bzb c5784bzb = this.presenter;
if (c5784bzb == null) {
C14957gcv.a("");
c5784bzb = null;
}
C15720hy c15720hy = c5784bzb.e;
if (c15720hy.a == null) {
c15720hy.a = c15720hy.b();
}
c5784bzb.a = c15720hy.a;
}
/* JADX WARN: Code restructure failed: missing block: B:23:0x0071, code lost:
if (r9 == null) goto L32;
*/
@Override // androidx.fragment.app.Fragment
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void onViewCreated(android.view.View r9, android.os.Bundle r10) {
/*
Method dump skipped, instructions count: 906
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.scb.phone.view.fragment.investment.FundActionsSearchFragment.onViewCreated(android.view.View, android.os.Bundle):void");
}
private final void a(boolean z) {
WvI wvI = this.c;
C14957gcv.e(wvI);
LinearLayout linearLayout = wvI.e;
C14957gcv.c(linearLayout, "");
C10454eEo.a(linearLayout, !z);
TabLayout tabLayout = wvI.d;
C14957gcv.c(tabLayout, "");
C10454eEo.a(tabLayout, z);
ViewPager2 viewPager2 = wvI.a;
C14957gcv.c(viewPager2, "");
C10454eEo.a(viewPager2, z);
}
@Override // o.InterfaceC6664cZg.RVV
public final void c(int[] iArr, List<? extends EnumC0861Qd> list, int i) {
C14957gcv.e(iArr, "");
C14957gcv.e(list, "");
FundActionsSearchFragment fundActionsSearchFragment = this;
C5784bzb c5784bzb = this.presenter;
if (c5784bzb == null) {
C14957gcv.a("");
c5784bzb = null;
}
this.g = new C12282evK(fundActionsSearchFragment, c5784bzb.d.d.s(), list);
WvI wvI = this.c;
C14957gcv.e(wvI);
ViewPager2 viewPager2 = wvI.a;
viewPager2.setAdapter(this.g);
C12282evK c12282evK = this.g;
viewPager2.setOffscreenPageLimit(c12282evK != null ? c12282evK.getItemCount() : -1);
Context requireContext = requireContext();
C14957gcv.c(requireContext, "");
C12016eqJ c12016eqJ = new C12016eqJ(requireContext, iArr, Float.valueOf(this.g != null ? r0.getItemCount() : BitmapDescriptorFactory.HUE_RED), false);
WvI wvI2 = this.c;
C14957gcv.e(wvI2);
new MrX(wvI2.d, viewPager2, c12016eqJ).b();
viewPager2.setCurrentItem(i);
}
/* loaded from: classes5.dex */
static final class ZqN extends AbstractC14961gcz implements InterfaceC14937gcb<String, Boolean, Boolean> {
private PW d;
@Override // o.InterfaceC14937gcb
public final /* synthetic */ Boolean invoke(String str, Boolean bool) {
boolean z;
String str2 = str;
C14957gcv.e(str2, "");
PW pw = this.d;
if (pw != null) {
C14957gcv.e(str2, "");
List<PY> orDefault = pw.b.getOrDefault(str2, C14851gaI.c);
C14957gcv.c(orDefault, "");
List<PY> list = orDefault;
if (list != null) {
z = list.isEmpty();
return Boolean.valueOf(z);
}
}
z = true;
return Boolean.valueOf(z);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
ZqN(PW pw) {
super(2);
this.d = pw;
}
}
@Override // o.InterfaceC6664cZg.RVV
public final void d(PW pw) {
HashMap hashMap = (HashMap) this.f.e();
final ZqN zqN = new ZqN(pw);
hashMap.replaceAll(new BiFunction(zqN) { // from class: o.ffK
private InterfaceC14937gcb c;
@Override // java.util.function.BiFunction
public final Object apply(Object obj, Object obj2) {
return FundActionsSearchFragment.d(this.c, obj, obj2);
}
{
this.c = zqN;
}
});
}
@Override // o.InterfaceC6664cZg.RVV
public final void c(PW pw) {
C14957gcv.e(pw, "");
C12282evK c12282evK = this.g;
if (c12282evK == null || !(!c12282evK.c.isEmpty())) {
return;
}
for (Map.Entry<String, SearchFundTabFragment> entry : c12282evK.c.entrySet()) {
String key = entry.getKey();
SearchFundTabFragment value = entry.getValue();
C14957gcv.e(key, "");
List<PY> orDefault = pw.b.getOrDefault(key, C14851gaI.c);
C14957gcv.c(orDefault, "");
List<PY> list = orDefault;
if (!((Boolean) ((HashMap) this.f.e()).getOrDefault(key, Boolean.FALSE)).booleanValue()) {
String str = this.j;
C14957gcv.e(str, "");
value.d = str;
value.c(list);
}
}
}
@Override // o.InterfaceC6664cZg.RVV
public final void e(C0855Qa c0855Qa) {
C14957gcv.e(c0855Qa, "");
FundRedeemSearchListFragment fundRedeemSearchListFragment = (FundRedeemSearchListFragment) getChildFragmentManager().findFragmentByTag("REDEEM_SEARCH_LIST_FRAGMENT");
if (fundRedeemSearchListFragment != null) {
String str = this.j;
C14957gcv.e(str, "");
fundRedeemSearchListFragment.c = str;
fundRedeemSearchListFragment.e(c0855Qa.d);
}
}
@Override // o.InterfaceC6664cZg.RVV
public final void d(PE pe) {
C14957gcv.e(pe, "");
FundSwitchSearchListFragment fundSwitchSearchListFragment = (FundSwitchSearchListFragment) getChildFragmentManager().findFragmentByTag("LIST_SWITCH_OUT_SEARCH");
if (fundSwitchSearchListFragment != null) {
String str = this.j;
C14957gcv.e(str, "");
fundSwitchSearchListFragment.c = str;
C14851gaI c14851gaI = pe.b;
if (c14851gaI == null) {
c14851gaI = C14851gaI.c;
}
fundSwitchSearchListFragment.b(c14851gaI);
}
}
@Override // o.InterfaceC6664cZg.RVV
public final void e(PA pa) {
C14957gcv.e(pa, "");
FundSwitchSearchListFragment fundSwitchSearchListFragment = (FundSwitchSearchListFragment) getChildFragmentManager().findFragmentByTag("LIST_SWITCH_IN_SEARCH");
if (fundSwitchSearchListFragment != null) {
String str = this.j;
C14957gcv.e(str, "");
fundSwitchSearchListFragment.c = str;
List<PD> list = pa.b;
C14957gcv.c(list, "");
fundSwitchSearchListFragment.c(list);
}
}
/* loaded from: classes5.dex */
static final class LWm<V> implements Callable {
private Editable a;
private FundActionsSearchFragment e;
@Override // java.util.concurrent.Callable
public final /* synthetic */ Object call() {
List<PY> list;
List<PY> list2;
List<PY> list3;
List<PY> list4;
List<PY> list5;
PW pw;
C5784bzb c5784bzb = this.e.presenter;
List<PY> list6 = null;
if (c5784bzb == null) {
C14957gcv.a("");
c5784bzb = null;
}
String str = this.e.d;
String valueOf = String.valueOf(this.a);
C14957gcv.e(valueOf, "");
C14957gcv.e(valueOf, "");
if (valueOf.length() <= 1) {
valueOf = "";
}
if (str == null) {
return null;
}
switch (str.hashCode()) {
case -2111590015:
if (str.equals("FUND_ACTION_SWITCH_IN")) {
return c5784bzb.c(valueOf);
}
return null;
case -1575706677:
if (str.equals("FUND_ACTION_REDEEM")) {
return c5784bzb.d(valueOf);
}
return null;
case -1034774958:
if (str.equals("FUND_ACTION_SWITCH_OUT")) {
return c5784bzb.a(valueOf);
}
return null;
case 97916784:
if (!str.equals("FUND_ACTION_PURCHASE")) {
return null;
}
C14957gcv.e(valueOf, "");
if (valueOf.length() == 0) {
pw = c5784bzb.a;
} else {
PW.HBt hBt = PW.c;
PW pw2 = new PW((byte) 0);
PW pw3 = c5784bzb.a;
if (pw3 != null) {
List<PY> orDefault = pw3.b.getOrDefault("FRAGMENT_PURCHASED", C14851gaI.c);
C14957gcv.c(orDefault, "");
list = orDefault;
} else {
list = null;
}
List<PY> d = C5784bzb.d(list, valueOf);
C14957gcv.e(d, "");
pw2.b.put("FRAGMENT_PURCHASED", d);
PW pw4 = c5784bzb.a;
if (pw4 != null) {
List<PY> orDefault2 = pw4.b.getOrDefault("FRAGMENT_OTHERS", C14851gaI.c);
C14957gcv.c(orDefault2, "");
list2 = orDefault2;
} else {
list2 = null;
}
List<PY> d2 = C5784bzb.d(list2, valueOf);
C14957gcv.e(d2, "");
pw2.b.put("FRAGMENT_OTHERS", d2);
PW pw5 = c5784bzb.a;
if (pw5 != null) {
List<PY> orDefault3 = pw5.b.getOrDefault("FRAGMENT_IPO", C14851gaI.c);
C14957gcv.c(orDefault3, "");
list3 = orDefault3;
} else {
list3 = null;
}
List<PY> d3 = C5784bzb.d(list3, valueOf);
C14957gcv.e(d3, "");
pw2.b.put("FRAGMENT_IPO", d3);
PW pw6 = c5784bzb.a;
if (pw6 != null) {
List<PY> orDefault4 = pw6.b.getOrDefault("FRAGMENT_SSF", C14851gaI.c);
C14957gcv.c(orDefault4, "");
list4 = orDefault4;
} else {
list4 = null;
}
List<PY> d4 = C5784bzb.d(list4, valueOf);
C14957gcv.e(d4, "");
pw2.b.put("FRAGMENT_SSF", d4);
PW pw7 = c5784bzb.a;
if (pw7 != null) {
List<PY> orDefault5 = pw7.b.getOrDefault("FRAGMENT_TESG", C14851gaI.c);
C14957gcv.c(orDefault5, "");
list5 = orDefault5;
} else {
list5 = null;
}
List<PY> d5 = C5784bzb.d(list5, valueOf);
C14957gcv.e(d5, "");
pw2.b.put("FRAGMENT_TESG", d5);
PW pw8 = c5784bzb.a;
if (pw8 != null) {
List<PY> orDefault6 = pw8.b.getOrDefault("FRAGMENT_ALL", C14851gaI.c);
C14957gcv.c(orDefault6, "");
list6 = orDefault6;
}
List<PY> d6 = C5784bzb.d(list6, valueOf);
C14957gcv.e(d6, "");
pw2.b.put("FRAGMENT_ALL", d6);
pw = pw2;
}
return pw;
default:
return null;
}
}
LWm(FundActionsSearchFragment fundActionsSearchFragment, Editable editable) {
this.e = fundActionsSearchFragment;
this.a = editable;
}
}
/* loaded from: classes5.dex */
static final class HBt extends AbstractC14961gcz implements InterfaceC14894gbR<EQ, C14866gag> {
private FundActionsSearchFragment a;
@Override // o.InterfaceC14894gbR
public final /* synthetic */ C14866gag invoke(EQ eq) {
final EQ eq2 = eq;
C5784bzb c5784bzb = this.a.presenter;
if (c5784bzb == null) {
C14957gcv.a("");
c5784bzb = null;
}
final String str = this.a.d;
if (eq2 != null) {
ZI.IeS ieS = new ZI.IeS(str, eq2) { // from class: o.bzj
private String b;
private EQ d;
@Override // o.ZI.IeS
public final void e(Object obj) {
C5784bzb.e(this.b, this.d, (InterfaceC6664cZg.RVV) obj);
}
{
this.b = str;
this.d = eq2;
}
};
if (c5784bzb.f != 0) {
ieS.e(c5784bzb.f);
}
}
return C14866gag.c;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
HBt(FundActionsSearchFragment fundActionsSearchFragment) {
super(1);
this.a = fundActionsSearchFragment;
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroyView() {
this.c = null;
super.onDestroyView();
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroy() {
C5784bzb c5784bzb = this.presenter;
if (c5784bzb == null) {
C14957gcv.a("");
c5784bzb = null;
}
c5784bzb.w_();
fSJ fsj = this.i;
if (fsj != null) {
fsj.dispose();
}
super.onDestroy();
}
/* loaded from: classes5.dex */
public static final class IeS {
private IeS() {
}
public /* synthetic */ IeS(byte b) {
this();
}
}
/* loaded from: classes5.dex */
static final class Sts extends AbstractC14961gcz implements InterfaceC14890gbN<HashMap<String, Boolean>> {
public static final Sts b = new Sts();
@Override // o.InterfaceC14890gbN
public final /* synthetic */ HashMap<String, Boolean> invoke() {
Boolean bool = Boolean.FALSE;
C13396fZU[] c13396fZUArr = {new C13396fZU("FRAGMENT_PURCHASED", bool), new C13396fZU("FRAGMENT_OTHERS", bool), new C13396fZU("FRAGMENT_IPO", bool), new C13396fZU("FRAGMENT_SSF", bool), new C13396fZU("FRAGMENT_TESG", bool), new C13396fZU("FRAGMENT_ALL", bool)};
C14957gcv.e(c13396fZUArr, "");
HashMap<String, Boolean> hashMap = new HashMap<>(C14856gaP.a(6));
C14856gaP.e(hashMap, c13396fZUArr);
return hashMap;
}
Sts() {
super(0);
}
}
public static /* synthetic */ boolean d(FundActionsSearchFragment fundActionsSearchFragment, int i) {
C14957gcv.e(fundActionsSearchFragment, "");
if (i != 3) {
return false;
}
fundActionsSearchFragment.aN_();
return true;
}
public static /* synthetic */ void e(Wlt wlt) {
C14957gcv.e(wlt, "");
wlt.b.setText("");
}
public static /* synthetic */ void a(FundActionsSearchFragment fundActionsSearchFragment) {
C14957gcv.e(fundActionsSearchFragment, "");
FragmentActivity activity = fundActionsSearchFragment.getActivity();
if (activity != null) {
activity.setResult(0);
activity.finish();
}
}
public static /* synthetic */ Boolean d(InterfaceC14937gcb interfaceC14937gcb, Object obj, Object obj2) {
C14957gcv.e(interfaceC14937gcb, "");
return (Boolean) interfaceC14937gcb.invoke(obj, obj2);
}
@Override // androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
View inflate = layoutInflater.inflate(R.layout.2131559664, viewGroup, false);
int i = R.id.fund_redeem_search_container;
LinearLayout linearLayout = (LinearLayout) qeC.e(inflate, R.id.fund_redeem_search_container);
if (linearLayout != null) {
i = R.id.fund_search_tab_layout;
TabLayout tabLayout = (TabLayout) qeC.e(inflate, R.id.fund_search_tab_layout);
if (tabLayout != null) {
i = R.id.layout_search_header;
View e = qeC.e(inflate, R.id.layout_search_header);
if (e != null) {
int i2 = R.id.cancel_button;
DefaultButton defaultButton = (DefaultButton) qeC.e(e, R.id.cancel_button);
if (defaultButton != null) {
LinearLayout linearLayout2 = (LinearLayout) e;
i2 = R.id.search_edit_clear;
ImageButton imageButton = (ImageButton) qeC.e(e, R.id.search_edit_clear);
if (imageButton != null) {
i2 = R.id.search_edit_text;
EditText editText = (EditText) qeC.e(e, R.id.search_edit_text);
if (editText != null) {
Wlt wlt = new Wlt(linearLayout2, defaultButton, linearLayout2, imageButton, editText);
ViewPager2 viewPager2 = (ViewPager2) qeC.e(inflate, R.id.vp_fund_search);
if (viewPager2 != null) {
WvI wvI = new WvI((LinearLayout) inflate, linearLayout, tabLayout, wlt, viewPager2);
this.c = wvI;
C14957gcv.e(wvI);
LinearLayout linearLayout3 = wvI.c;
C14957gcv.c(linearLayout3, "");
return linearLayout3;
}
i = R.id.vp_fund_search;
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(e.getResources().getResourceName(i2)));
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
}
static {
new IeS((byte) 0);
}
}