what-the-bank/sources/com/scb/phone/view/fragment/personalize/PersonalizeFragment.java

298 lines
11 KiB
Java

package com.scb.phone.view.fragment.personalize;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
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.adapter.transferandpay.FavouriteTargetAdapter;
import com.scb.phone.view.fragment.personalize.PersonalizeFragment;
import java.util.List;
import o.AyW;
import o.C0693Mj;
import o.C10457eEr;
import o.C1182Xi;
import o.C12891fKc;
import o.C6176cL;
import o.C6274cO;
import o.C6583cXR;
import o.C7260ckt;
import o.CvN;
import o.EnumC15824isw;
import o.InterfaceC12824fIT;
import o.InterfaceC13391fZD;
import o.InterfaceC9010dbe;
import o.ZI;
import o.gHK;
import o.nMh;
/* loaded from: classes5.dex */
public class PersonalizeFragment extends Hilt_PersonalizeFragment implements InterfaceC9010dbe.cSf {
@BindView
RelativeLayout addPromptPay;
@BindView
RelativeLayout addQuickBalance;
@BindView
ImageView avatarPromtPay;
@BindView
ImageView avatarQuickBalance;
@BindView
TextView billPaymentTitle;
@BindView
RecyclerView favouriteBillPaymentRecyclerView;
@BindView
RecyclerView favouriteRemittanceRecyclerView;
@BindView
RecyclerView favouriteTopUpRecyclerView;
@BindView
RecyclerView favouriteTransferRecyclerView;
@BindView
protected LinearLayout mFavouriteBillPaymentEmpty;
@BindView
protected LinearLayout mFavouriteRemittanceEmpty;
@BindView
protected LinearLayout mFavouriteTopUpEmpty;
@BindView
protected LinearLayout mFavouriteTransferEmpty;
@InterfaceC13391fZD
public C7260ckt presenter;
@BindView
LinearLayout remittanceContainer;
@BindView
TextView remittanceTitle;
@BindView
TextView topUpTitle;
@BindView
TextView transferTitle;
public static PersonalizeFragment e(long j) {
PersonalizeFragment personalizeFragment = new PersonalizeFragment();
Bundle bundle = new Bundle();
bundle.putLong("com.scb.phone.EXTRA_PARENT_ID", j);
personalizeFragment.setArguments(bundle);
return personalizeFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
byte b = 0;
View inflate = layoutInflater.inflate(R.layout.2131559810, viewGroup, false);
ButterKnife.c(this, inflate);
this.presenter.e2((InterfaceC9010dbe.cSf) this);
this.transferTitle.setText(getString(R.string.personalize_favorite_transfer_empty));
this.topUpTitle.setText(getString(R.string.favorite_top_up_empty));
this.billPaymentTitle.setText(getString(R.string.favorite_bill_payment_empty));
String obj = C6583cXR.VS_(getContext(), R.drawable.ic_promp_pay_lg).toString();
String obj2 = C6583cXR.VS_(getContext(), R.drawable.ic_portfolio).toString();
Drawable drawable = nMh.getDrawable(getContext(), R.drawable.bankicon_place_holder);
C12891fKc.azg_(getContext(), drawable, this.avatarPromtPay, obj, getContext().getResources().getDimensionPixelOffset(R.dimen.f15212131165285), nMh.getColor(getContext(), R.color.f3412131099849));
C12891fKc.azg_(getContext(), drawable, this.avatarQuickBalance, obj2, getContext().getResources().getDimensionPixelOffset(R.dimen.f15212131165285), nMh.getColor(getContext(), R.color.f3412131099849));
TextView textView = (TextView) this.mFavouriteTopUpEmpty.findViewById(R.id.tv_favourite_add_suggestion);
TextView textView2 = (TextView) this.mFavouriteTransferEmpty.findViewById(R.id.tv_favourite_add_suggestion);
TextView textView3 = (TextView) this.mFavouriteBillPaymentEmpty.findViewById(R.id.tv_favourite_add_suggestion);
textView.setText(R.string.favorite_add_suggestion_top_up);
textView2.setText(R.string.favorite_add_favorite_personalized_tile);
textView3.setText(R.string.favorite_add_suggestion_bill_payment);
C7260ckt c7260ckt = this.presenter;
if (gHK.INDIVIDUAL.equals(c7260ckt.e.d())) {
ZI.IeS ieS = new ZI.IeS() { // from class: o.cky
@Override // o.ZI.IeS
public final void e(Object obj3) {
((InterfaceC9010dbe.cSf) obj3).e();
}
};
if (c7260ckt.f != 0) {
ieS.e(c7260ckt.f);
}
} else {
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.ckw
@Override // o.ZI.IeS
public final void e(Object obj3) {
((InterfaceC9010dbe.cSf) obj3).c();
}
};
if (c7260ckt.f != 0) {
ieS2.e(c7260ckt.f);
}
}
C7260ckt c7260ckt2 = this.presenter;
c7260ckt2.a.e();
CvN cvN = c7260ckt2.a;
cvN.d(cvN.i, new C7260ckt.LWm(c7260ckt2, b));
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.presenter.w_();
super.onDestroy();
}
@Override // com.scb.phone.view.fragment.BaseFragment, o.InterfaceC6638cYp
public final void e(C0693Mj c0693Mj) {
super.e(c0693Mj);
this.favouriteTransferRecyclerView.setClickable(true);
this.favouriteTopUpRecyclerView.setClickable(true);
this.favouriteBillPaymentRecyclerView.setClickable(true);
this.favouriteRemittanceRecyclerView.setClickable(true);
}
@Override // o.InterfaceC9010dbe.cSf
public final void d(List<C1182Xi> list) {
if (list != null && !list.isEmpty()) {
this.mFavouriteTransferEmpty.setVisibility(8);
c(list, this.favouriteTransferRecyclerView);
this.transferTitle.setText(getString(R.string.favorite_transfer, Integer.valueOf(list.size())));
return;
}
this.transferTitle.setText(getString(R.string.personalize_favorite_transfer_empty));
}
@Override // o.InterfaceC9010dbe.cSf
public final void b(List<C1182Xi> list) {
if (list != null && !list.isEmpty()) {
this.mFavouriteTopUpEmpty.setVisibility(8);
c(list, this.favouriteTopUpRecyclerView);
this.topUpTitle.setText(getString(R.string.favorite_top_up, Integer.valueOf(list.size())));
return;
}
this.topUpTitle.setText(getString(R.string.favorite_top_up_empty));
}
@Override // o.InterfaceC9010dbe.cSf
public final void a(List<C1182Xi> list) {
if (list != null && !list.isEmpty()) {
this.mFavouriteBillPaymentEmpty.setVisibility(8);
c(list, this.favouriteBillPaymentRecyclerView);
this.billPaymentTitle.setText(getString(R.string.favorite_bill_payment, Integer.valueOf(list.size())));
return;
}
this.billPaymentTitle.setText(getString(R.string.favorite_bill_payment_empty));
}
@Override // o.InterfaceC9010dbe.cSf
public final void c(List<C1182Xi> list) {
if (list != null && !list.isEmpty()) {
this.mFavouriteRemittanceEmpty.setVisibility(8);
c(list, this.favouriteRemittanceRecyclerView);
this.remittanceTitle.setText(getString(R.string.favorite_remittance, Integer.valueOf(list.size())));
return;
}
this.remittanceTitle.setText(getString(R.string.favorite_remittance_empty));
}
private void c(final List<C1182Xi> list, final RecyclerView recyclerView) {
getContext();
recyclerView.setLayoutManager(new LinearLayoutManager(0, false));
recyclerView.setAdapter(new FavouriteTargetAdapter(getContext(), list, new InterfaceC12824fIT(this, recyclerView, list) { // from class: o.fsc
private PersonalizeFragment c;
private RecyclerView d;
private List e;
@Override // o.InterfaceC12824fIT
public final void a(int i) {
PersonalizeFragment.c(this.c, this.d, this.e, i);
}
{
this.c = this;
this.d = recyclerView;
this.e = list;
}
}));
}
@Override // o.InterfaceC9010dbe.cSf
public final void d(String str) {
if (getActivity() == null) {
return;
}
C10457eEr.aqd_(this, new Intent(str));
getActivity().finish();
}
@Override // o.InterfaceC9010dbe.cSf
public final void b() {
this.favouriteBillPaymentRecyclerView.setClickable(true);
this.favouriteTopUpRecyclerView.setClickable(true);
this.favouriteTransferRecyclerView.setClickable(true);
}
@Override // o.InterfaceC9010dbe.cSf
public final void e() {
this.remittanceContainer.setVisibility(0);
((TextView) this.mFavouriteRemittanceEmpty.findViewById(R.id.tv_favourite_add_suggestion)).setText(R.string.favorite_add_suggestion_remittance);
this.favouriteRemittanceRecyclerView.setClickable(true);
}
@Override // o.InterfaceC9010dbe.cSf
public final void c() {
this.remittanceContainer.setVisibility(8);
}
public static /* synthetic */ void c(PersonalizeFragment personalizeFragment, RecyclerView recyclerView, List list, int i) {
if (recyclerView.isClickable()) {
recyclerView.setClickable(false);
recyclerView.setEnabled(false);
C7260ckt c7260ckt = personalizeFragment.presenter;
long j = personalizeFragment.getArguments().getLong("com.scb.phone.EXTRA_PARENT_ID");
C1182Xi c1182Xi = (C1182Xi) list.get(i);
C6274cO d = C6274cO.d();
Integer num = c1182Xi.q;
C6176cL d2 = C6176cL.d();
d2.d = num;
d.a = d2;
d.d = EnumC15824isw.FAVOURITE.toString();
d.b = AyW.SHORTCUT.toString();
d.e = j;
if (c7260ckt.f != 0) {
c7260ckt.f.y();
}
c7260ckt.a.a(d);
CvN cvN = c7260ckt.a;
cvN.d(cvN.i, new C7260ckt.IeS(c7260ckt, j));
}
}
@OnClick
public void addQuickBalance() {
this.presenter.d(getArguments().getLong("com.scb.phone.EXTRA_PARENT_ID"), EnumC15824isw.QUICKBALANCE);
this.addQuickBalance.setClickable(false);
}
@OnClick
public void addQuickPromptPay() {
this.presenter.d(getArguments().getLong("com.scb.phone.EXTRA_PARENT_ID"), EnumC15824isw.QUICKPROMPTPAY);
this.addPromptPay.setClickable(false);
}
}