package com.scb.phone.view.fragment.landingpage; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.view.View; import android.view.ViewConfiguration; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.huawei.hms.support.api.entity.common.CommonConstant; import com.scb.phone.R; import com.scb.phone.view.activity.HomeActivity; import com.scb.phone.view.activity.PreLoadCheckActivity; import com.scb.phone.view.activity.bankingaccount.BankingActionActivity; import com.scb.phone.view.activity.contactus.ContactUsActivity; import com.scb.phone.view.activity.donations.DonationsLandingActivity; import com.scb.phone.view.activity.easycash.EasycashLandingActivity; import com.scb.phone.view.activity.etb.ETBCheckEligibilityActivity; import com.scb.phone.view.activity.financialmall.FinancialMallLandingActivity; import com.scb.phone.view.activity.findus.FindUsActivity; import com.scb.phone.view.activity.friends.FriendsLandingActivity; import com.scb.phone.view.activity.hml.HmlETBLandingActivity; import com.scb.phone.view.activity.investment.scbs.ScbsLandingActivity; import com.scb.phone.view.activity.juristic.JuristicOnboardingLandingActivity; import com.scb.phone.view.activity.juristic.JuristicRequestFormActivity; import com.scb.phone.view.activity.landingpage.GroupBillerActivity; import com.scb.phone.view.activity.landingpage.GroupFavoriteActivity; import com.scb.phone.view.activity.landingpage.PartnerWebViewActivity; import com.scb.phone.view.activity.landingpage.PredictiveTilesLearnMoreActivity; import com.scb.phone.view.activity.mwpartner.MwLandingActivity; import com.scb.phone.view.activity.partner.PartnerLandingActivity; import com.scb.phone.view.activity.personalize.PersonalizeActivity; import com.scb.phone.view.activity.personallimit.PersonalLimitActivity; import com.scb.phone.view.activity.requesttopay.GoManagePromptPayActivity; import com.scb.phone.view.activity.requesttopay.RequestToPayActivity; import com.scb.phone.view.activity.sme.SMELandingPageActivity; import com.scb.phone.view.activity.sme.gifting.GiftSelectionActivity; import com.scb.phone.view.activity.transferandpay.ScanPaymentActivity; import com.scb.phone.view.activity.transferandpay.billpayment.BillPaymentActivity; import com.scb.phone.view.activity.transferandpay.cardlessatm.CardlessATMTutorialActivity; import com.scb.phone.view.activity.transferandpay.topup.TopUpActivity; import com.scb.phone.view.activity.transferandpay.transfer.TransferActivity; import com.scb.phone.view.adapter.landingpage.TileAdapter; import com.scb.phone.view.custom.common.CustomDialog; import com.scb.phone.view.custom.common.CustomGridLayoutManager; import com.scb.phone.view.fragment.landingpage.BaseDragAndDropFragment; import java.util.ArrayList; import java.util.Collections; import java.util.List; import o.BvX; import o.C0907Rf; import o.C12354ewd; import o.C14098fml; import o.C14957gcv; import o.C15703hqi; import o.C17113tyF; import o.C9482dka; import o.EKR; import o.EVU; import o.EnumC15824isw; import o.InterfaceC12854fJL; import o.InterfaceC13391fZD; import o.InterfaceC6633cYk; import o.InterfaceC9505dkx; import o.Jel; import o.MKu; import o.PRA; import o.QS; import o.YKU; import o.gHK; import o.guQ; import o.qHQ; import o.ury; /* loaded from: classes5.dex */ public abstract class BaseDragAndDropFragment extends Hilt_BaseDragAndDropFragment implements InterfaceC6633cYk, InterfaceC12854fJL { public TileAdapter c; private CustomGridLayoutManager d; private C15703hqi g; private C14098fml h; @InterfaceC13391fZD public InterfaceC9505dkx iDeviceCompatibilityHelper; private RecyclerView.Sts j; @BindView public RecyclerView mRecyclerView; public void E() { } public void L() { } protected void a(long j, String str, boolean z) { } public void c(C0907Rf.Sts sts) { } public void d(C0907Rf.Sts sts) { } /* JADX INFO: Access modifiers changed from: protected */ public void e(long j) { } public void i(C0907Rf.Sts sts) { } /* JADX INFO: Access modifiers changed from: protected */ public final void e(RecyclerView recyclerView, View view, final TileAdapter.ZqN zqN) { this.mRecyclerView = recyclerView; C15703hqi c15703hqi = new C15703hqi(); this.g = c15703hqi; c15703hqi.y = true; this.g.b = true; this.g.w = false; this.g.A = 750; this.g.D = 1; this.g.z = new C15703hqi.RVV(this) { // from class: com.scb.phone.view.fragment.landingpage.BaseDragAndDropFragment.1 private BaseDragAndDropFragment c; { this.c = this; } }; this.g.k.e = 250; this.g.k.a = 0.8f; this.g.k.i = 1.3f; this.g.k.b = BitmapDescriptorFactory.HUE_RED; TileAdapter tileAdapter = new TileAdapter(view, new TileAdapter.ZqN(this, zqN) { // from class: o.flx private TileAdapter.ZqN a; private BaseDragAndDropFragment d; @Override // com.scb.phone.view.adapter.landingpage.TileAdapter.ZqN public final void a(boolean z) { BaseDragAndDropFragment.d(this.d, this.a, z); } { this.d = this; this.a = zqN; } }, this, new TileAdapter.vUG(this) { // from class: o.flz private BaseDragAndDropFragment b; @Override // com.scb.phone.view.adapter.landingpage.TileAdapter.vUG public final void b() { this.b.g.D = 1; } { this.b = this; } }, new TileAdapter.vUG(this) { // from class: o.flw private BaseDragAndDropFragment d; @Override // com.scb.phone.view.adapter.landingpage.TileAdapter.vUG public final void b() { this.d.g.D = 0; } { this.d = this; } }); this.c = tileAdapter; tileAdapter.b = getLifecycle(); this.h = new C14098fml(this.c); C15703hqi c15703hqi2 = this.g; TileAdapter tileAdapter2 = this.c; if (!tileAdapter2.hasStableIds()) { throw new IllegalArgumentException("The passed adapter does not support stable IDs"); } if (c15703hqi2.P != null) { throw new IllegalStateException("already have a wrapped adapter"); } qHQ qhq = new qHQ(c15703hqi2, tileAdapter2); c15703hqi2.P = qhq; this.j = qhq; C9482dka c9482dka = new C9482dka(); getContext(); CustomGridLayoutManager customGridLayoutManager = new CustomGridLayoutManager(); this.d = customGridLayoutManager; ((GridLayoutManager) customGridLayoutManager).a = this.h; this.mRecyclerView.setLayoutManager(this.d); this.mRecyclerView.setAdapter(this.j); this.mRecyclerView.setItemAnimator(c9482dka); this.mRecyclerView.setNestedScrollingEnabled(false); C15703hqi c15703hqi3 = this.g; RecyclerView recyclerView2 = this.mRecyclerView; if (c15703hqi3.u != null) { if (c15703hqi3.F != null) { throw new IllegalStateException("RecyclerView instance has already been set"); } c15703hqi3.F = recyclerView2; RecyclerView.dAO dao = c15703hqi3.x; if (recyclerView2.S == null) { recyclerView2.S = new ArrayList(); } recyclerView2.S.add(dao); c15703hqi3.F.E.add(c15703hqi3.u); c15703hqi3.f = c15703hqi3.F.getResources().getDisplayMetrics().density; int scaledTouchSlop = ViewConfiguration.get(c15703hqi3.F.getContext()).getScaledTouchSlop(); c15703hqi3.R = scaledTouchSlop; c15703hqi3.M = (int) ((scaledTouchSlop * 1.5f) + 0.5f); c15703hqi3.t = new C15703hqi.IeS(c15703hqi3); int d = BvX.d(c15703hqi3.F.x); if (d == 0) { c15703hqi3.f9162o = new C17113tyF(c15703hqi3.F); } else if (d == 1) { c15703hqi3.f9162o = new MKu(c15703hqi3.F); } EKR ekr = c15703hqi3.f9162o; if (ekr != null) { ekr.d(); return; } return; } throw new IllegalStateException("Accessing released object"); } @Override // o.InterfaceC6633cYk public final void b(List list) { this.c.e(list); } public void c(final long j) { TileAdapter tileAdapter = this.c; tileAdapter.e((List) new YKU(tileAdapter.e).b(new Jel(j) { // from class: o.ewv private long b; @Override // o.Jel public final boolean e(Object obj) { return TileAdapter.c(this.b, (C0907Rf.Sts) obj); } { this.b = j; } }).a(new PRA.Sts(new PRA.AnonymousClass4(), new PRA.AnonymousClass8()))); } @Override // o.InterfaceC12854fJL public final void a(long j) { PersonalizeActivity.d(getContext(), j); } /* renamed from: com.scb.phone.view.fragment.landingpage.BaseDragAndDropFragment$5, reason: invalid class name */ /* loaded from: classes5.dex */ static /* synthetic */ class AnonymousClass5 { static final int[] d; static { int[] iArr = new int[EnumC15824isw.values().length]; d = iArr; try { iArr[EnumC15824isw.BILLER.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { d[EnumC15824isw.FAVOURITE.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { d[EnumC15824isw.CONTACTUS.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { d[EnumC15824isw.DONATION.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } try { d[EnumC15824isw.MANAGE_SCB_PROMPTPAY.ordinal()] = 5; } catch (NoSuchFieldError unused5) { } try { d[EnumC15824isw.ACCOUNT_SUMMARY.ordinal()] = 6; } catch (NoSuchFieldError unused6) { } try { d[EnumC15824isw.CARDLESS_ATM.ordinal()] = 7; } catch (NoSuchFieldError unused7) { } try { d[EnumC15824isw.CHANGE_TRANSFER_LIMIT.ordinal()] = 8; } catch (NoSuchFieldError unused8) { } try { d[EnumC15824isw.TOP_UP.ordinal()] = 9; } catch (NoSuchFieldError unused9) { } try { d[EnumC15824isw.TRANSFER.ordinal()] = 10; } catch (NoSuchFieldError unused10) { } try { d[EnumC15824isw.REQUEST_MONEY.ordinal()] = 11; } catch (NoSuchFieldError unused11) { } try { d[EnumC15824isw.FIND_US.ordinal()] = 12; } catch (NoSuchFieldError unused12) { } try { d[EnumC15824isw.BILL_PAYMENT.ordinal()] = 13; } catch (NoSuchFieldError unused13) { } try { d[EnumC15824isw.BILLERSCAN.ordinal()] = 14; } catch (NoSuchFieldError unused14) { } try { d[EnumC15824isw.INVESTMENT_TILE.ordinal()] = 15; } catch (NoSuchFieldError unused15) { } try { d[EnumC15824isw.PROMTPAY_QR.ordinal()] = 16; } catch (NoSuchFieldError unused16) { } try { d[EnumC15824isw.GIFTING.ordinal()] = 17; } catch (NoSuchFieldError unused17) { } try { d[EnumC15824isw.SCB_ONE.ordinal()] = 18; } catch (NoSuchFieldError unused18) { } try { d[EnumC15824isw.OPEN_SCB_ACCOUNT_ETB.ordinal()] = 19; } catch (NoSuchFieldError unused19) { } try { d[EnumC15824isw.MAE_MANEE_SHOP.ordinal()] = 20; } catch (NoSuchFieldError unused20) { } try { d[EnumC15824isw.SCBS_INVESTMENT.ordinal()] = 21; } catch (NoSuchFieldError unused21) { } try { d[EnumC15824isw.HML_LANDING.ordinal()] = 22; } catch (NoSuchFieldError unused22) { } try { d[EnumC15824isw.DOCUMENT_FORMS.ordinal()] = 23; } catch (NoSuchFieldError unused23) { } try { d[EnumC15824isw.REQUEST_TO_ADD_JURISTIC_ACCOUNT.ordinal()] = 24; } catch (NoSuchFieldError unused24) { } try { d[EnumC15824isw.GO_TO_PERSONAL.ordinal()] = 25; } catch (NoSuchFieldError unused25) { } try { d[EnumC15824isw.FRIENDS_GET_FRIENDS.ordinal()] = 26; } catch (NoSuchFieldError unused26) { } try { d[EnumC15824isw.WEBVIEWTILE.ordinal()] = 27; } catch (NoSuchFieldError unused27) { } try { d[EnumC15824isw.APPLICATION.ordinal()] = 28; } catch (NoSuchFieldError unused28) { } try { d[EnumC15824isw.TILES.ordinal()] = 29; } catch (NoSuchFieldError unused29) { } try { d[EnumC15824isw.TILE_CATEGORY.ordinal()] = 30; } catch (NoSuchFieldError unused30) { } try { d[EnumC15824isw.WEBVIEW_PARTNER.ordinal()] = 31; } catch (NoSuchFieldError unused31) { } try { d[EnumC15824isw.SME_SERVICES.ordinal()] = 32; } catch (NoSuchFieldError unused32) { } try { d[EnumC15824isw.DEEPLINK.ordinal()] = 33; } catch (NoSuchFieldError unused33) { } try { d[EnumC15824isw.FINANCIAL_MALL.ordinal()] = 34; } catch (NoSuchFieldError unused34) { } try { d[EnumC15824isw.FUNCTION.ordinal()] = 35; } catch (NoSuchFieldError unused35) { } } } @Override // o.InterfaceC12854fJL public final void j(C0907Rf.Sts sts) { int i = AnonymousClass5.d[sts.M.ordinal()]; if (i == 1) { Intent intent = new Intent(getActivity(), (Class) GroupBillerActivity.class); intent.putExtra("EXTRA_TILE_PROPERTIES", sts); startActivity(intent); } else if (i == 2) { Intent intent2 = new Intent(getActivity(), (Class) GroupFavoriteActivity.class); intent2.putExtra("EXTRA_TILE_PROPERTIES", sts); startActivity(intent2); } } @Override // o.InterfaceC6633cYk public final void a(List list) { SMELandingPageActivity.d(getContext(), list); } public void g() { startActivity(new Intent(getContext(), (Class) GoManagePromptPayActivity.class)); } public void c() { Intent intent = new Intent(getContext(), (Class) HomeActivity.class); intent.addFlags(603979776); intent.putExtra("com.scb.phone.EXTRA_NEW_INSTANCE_LAYOUT", R.id.account_summary_tab); intent.putExtra("com.scb.phone.EXTRA_FROM_BANKING_ACTION", true); startActivity(intent); } public void a() { FindUsActivity.d(getContext(), false); } public void m() { startActivity(new Intent(getContext(), (Class) PersonalLimitActivity.class)); } public void h() { RequestToPayActivity.b(getContext(), ""); } public void d() { CardlessATMTutorialActivity.e(getContext(), "bankingservice"); } public void k() { if (this.iDeviceCompatibilityHelper.d()) { startActivity(new Intent(getActivity(), (Class) ScanPaymentActivity.class)); } } public void c(long j, boolean z, int i) { Intent intent = new Intent(getActivity(), (Class) PartnerWebViewActivity.class); intent.putExtra("com.scb.phone.EXTRA_PARTNER_ID", j); intent.putExtra("EXTRA_REQUIRE_LOGIN", i); startActivity(intent); } public void e() { startActivity(new Intent(getActivity(), (Class) DonationsLandingActivity.class)); } public void b() { startActivity(new Intent(getContext(), (Class) ContactUsActivity.class)); } public void n() { TileAdapter tileAdapter = this.c; C12354ewd c12354ewd = tileAdapter.a; C12354ewd.LWm pop = c12354ewd.d.isEmpty() ? null : c12354ewd.d.pop(); if (pop != null) { int i = pop.a; int i2 = pop.e; ArrayList arrayList = new ArrayList(tileAdapter.e); Collections.swap(arrayList, i, i2); tileAdapter.e(arrayList); } } @Override // o.InterfaceC6633cYk public final void c(QS qs) { if (getContext() != null) { startActivity(JuristicOnboardingLandingActivity.ahQ_(getContext(), qs)); } } @Override // o.InterfaceC6633cYk public final void i() { if (getActivity() instanceof PreLoadCheckActivity) { PreLoadCheckActivity preLoadCheckActivity = (PreLoadCheckActivity) getActivity(); PreLoadCheckActivity.f(new Object[]{preLoadCheckActivity}, -1090434572, 1090434587, System.identityHashCode(preLoadCheckActivity)); } } public static /* synthetic */ void d(BaseDragAndDropFragment baseDragAndDropFragment, TileAdapter.ZqN zqN, boolean z) { baseDragAndDropFragment.d.C = z; if (zqN != null) { zqN.a(z); } } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroyView() { RecyclerView.dAO dao; List list; RecyclerView.jNh jnh; C15703hqi c15703hqi = this.g; if (c15703hqi != null) { c15703hqi.b(true); C15703hqi.IeS ieS = c15703hqi.t; if (ieS != null) { ieS.removeCallbacksAndMessages(null); ieS.c = null; c15703hqi.t = null; } EKR ekr = c15703hqi.f9162o; if (ekr != null) { if (ekr.i) { ekr.b.e(ekr); } ekr.a(); ekr.b = null; ekr.i = false; c15703hqi.f9162o = null; } RecyclerView recyclerView = c15703hqi.F; if (recyclerView != null && (jnh = c15703hqi.u) != null) { recyclerView.E.remove(jnh); if (recyclerView.p == jnh) { recyclerView.p = null; } } c15703hqi.u = null; RecyclerView recyclerView2 = c15703hqi.F; if (recyclerView2 != null && (dao = c15703hqi.x) != null && (list = recyclerView2.S) != null) { list.remove(dao); } c15703hqi.x = null; C15703hqi.HBt hBt = c15703hqi.L; if (hBt != null) { hBt.a.clear(); hBt.d = false; c15703hqi.L = null; } c15703hqi.P = null; c15703hqi.F = null; c15703hqi.S = null; this.g = null; } RecyclerView recyclerView3 = this.mRecyclerView; if (recyclerView3 != null) { recyclerView3.setItemAnimator(null); this.mRecyclerView.setAdapter(null); this.mRecyclerView = null; } TileAdapter tileAdapter = this.c; if (tileAdapter != null) { tileAdapter.b = null; } RecyclerView.Sts sts = this.j; if (sts != null) { ury.d(sts); this.j = null; } this.c = null; this.d = null; super.onDestroyView(); } @Override // o.InterfaceC12854fJL public final void f(final C0907Rf.Sts sts) { if (sts.u) { ((CustomDialog) CustomDialog.e(new Object[]{CustomDialog.b(getContext()).c(R.string.confirm_delete_tile).d(R.string.confirm_delete_tile_description).aoT_(R.string.yes_delete, new DialogInterface.OnClickListener(this, sts) { // from class: o.fls private C0907Rf.Sts a; private BaseDragAndDropFragment e; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { this.e.e(this.a.x); } { this.e = this; this.a = sts; } }), Integer.valueOf(R.string.no_keep_it), new DialogInterface.OnClickListener() { // from class: o.flr @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }})).show(); return; } CustomDialog.b(getContext()).c(R.string.remove_item).d(R.string.tile_cannot_be_deleted).aoT_(R.string.ok, new DialogInterface.OnClickListener() { // from class: o.flv @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }).show(); } @Override // o.InterfaceC12854fJL public final void K() { getActivity().startActivity(new Intent(getActivity(), (Class) PredictiveTilesLearnMoreActivity.class)); } public void bf_() { getActivity().startActivity(new Intent(getActivity(), (Class) BankingActionActivity.class)); } public void a(C0907Rf.Sts sts) { v(sts.p); switch (AnonymousClass5.d[sts.M.ordinal()]) { case 27: c(sts.x, sts.i, sts.E); return; case 28: d(sts); return; case 29: SMELandingPageActivity.d(getContext(), sts.J); return; case 30: startActivity(PartnerLandingActivity.ajZ_(getContext(), sts.x)); return; case 31: a(sts.x, sts.a, sts.i); return; case 32: i(sts); return; case 33: try { startActivity(new Intent(CommonConstant.ACTION.HWID_SCHEME_URL, Uri.parse(sts.m))); return; } catch (ActivityNotFoundException e) { guQ.e(e); return; } case 34: int i = sts.E; if (getContext() != null) { Intent aft_ = FinancialMallLandingActivity.aft_(getContext(), "LIFESTYLE_LANDING_FLOW"); aft_.putExtra("EXTRA_REQUIRE_LOGIN", i); startActivity(aft_); return; } return; case 35: if (sts.r == null) { return; } switch (AnonymousClass5.d[sts.r.ordinal()]) { case 3: b(); return; case 4: e(); return; case 5: g(); return; case 6: c(); return; case 7: d(); return; case 8: m(); return; case 9: a(sts.M); return; case 10: b(sts.M); return; case 11: h(); return; case 12: a(); return; case 13: e(sts.M); return; case 14: k(); return; case 15: j(); return; case 16: f(); return; case 17: startActivity(new Intent(getActivity(), (Class) GiftSelectionActivity.class)); return; case 18: startActivity(new Intent(getActivity(), (Class) EasycashLandingActivity.class)); return; case 19: startActivity(ETBCheckEligibilityActivity.aff_(getContext())); return; case 20: startActivity(MwLandingActivity.aiu_(getContext())); return; case 21: v("investment_landing"); startActivity(ScbsLandingActivity.ahH_(getContext())); return; case 22: HmlETBLandingActivity.HBt hBt = HmlETBLandingActivity.k; startActivity(HmlETBLandingActivity.HBt.afM_(getContext(), EVU.GENERAL)); return; case 23: case 24: Context context = getContext(); if (context != null) { startActivity(JuristicRequestFormActivity.ahR_(context)); return; } return; case 25: if (getActivity() instanceof PreLoadCheckActivity) { PreLoadCheckActivity preLoadCheckActivity = (PreLoadCheckActivity) getActivity(); PreLoadCheckActivity.f(new Object[]{preLoadCheckActivity, gHK.INDIVIDUAL}, -1850284507, 1850284508, ((Context) Class.forName("android.app.ActivityThread").getMethod("currentApplication", new Class[0]).invoke(null, null)).getApplicationContext().getResources().getString(R.string.security_block_enable_accessibility_description).substring(121, 122).codePointAt(0) - 873277988); preLoadCheckActivity.l(true); return; } return; case 26: Context context2 = getContext(); C14957gcv.e(context2, ""); startActivity(new Intent(context2, (Class) FriendsLandingActivity.class)); return; default: return; } default: return; } } public void e(EnumC15824isw enumC15824isw) { if (enumC15824isw.equals(EnumC15824isw.FAVOURITE)) { BillPaymentActivity.e(getContext(), "favourite"); } else { BillPaymentActivity.e(getContext(), "tile"); } } public void a(EnumC15824isw enumC15824isw) { if (enumC15824isw.equals(EnumC15824isw.FAVOURITE)) { TopUpActivity.e(getContext(), "favourite"); } else { TopUpActivity.e(getContext(), "tile"); } } public void b(EnumC15824isw enumC15824isw) { if (enumC15824isw.equals(EnumC15824isw.FAVOURITE)) { Object[] objArr = {getContext(), "favourite"}; TransferActivity.a(objArr); } else { Object[] objArr2 = {getContext(), "tile"}; TransferActivity.a(objArr2); } } }