what-the-bank/sources/com/scb/phone/view/fragment/purchase/PurchaseCreditCardFragment....

178 lines
5.8 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.purchase;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.adapter.creditcard.CreditCardDetailPurchaseViewPagerAdapter;
import java.util.Arrays;
import java.util.List;
import me.relex.circleindicator.CircleIndicator;
import o.AbstractC13482fbE;
import o.C0367Fb;
import o.C1203Xy;
import o.C7856cwI;
import o.InterfaceC13391fZD;
import o.InterfaceC8972dat;
/* loaded from: classes5.dex */
public class PurchaseCreditCardFragment extends Hilt_PurchaseCreditCardFragment implements InterfaceC8972dat.RVV {
private PurchaseCreditCardInputFragment c;
private List<String> d;
@BindView
TextView errorDescription;
@BindView
TextView errorTitle;
private C1203Xy h;
@BindView
LinearLayout layoutCards;
@BindView
LinearLayout layoutError;
@BindView
LinearLayout layoutNoCard;
@BindView
CircleIndicator mIndicator;
@InterfaceC13391fZD
public C7856cwI mPresenter;
@BindView
ViewPager mViewPager;
@BindView
TextView noCardDescriptionTextView;
@BindView
TextView noCardTitleTextView;
public static PurchaseCreditCardFragment c(String[] strArr, C1203Xy c1203Xy) {
Bundle bundle = new Bundle();
bundle.putStringArray("com.scb.phone.EXTRA_PURCHASE_CARD_SCHEME_ALLOW", strArr);
bundle.putParcelable("com.scb.phone.TransferTabFragment.EXTRA_BILL_SCAN", c1203Xy);
PurchaseCreditCardFragment purchaseCreditCardFragment = new PurchaseCreditCardFragment();
purchaseCreditCardFragment.setArguments(bundle);
return purchaseCreditCardFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559842, viewGroup, false);
ButterKnife.c(this, inflate);
this.mPresenter.e((C7856cwI) this);
Bundle arguments = getArguments();
if (arguments != null) {
String[] stringArray = arguments.getStringArray("com.scb.phone.EXTRA_PURCHASE_CARD_SCHEME_ALLOW");
if (stringArray != null) {
this.d = Arrays.asList(stringArray);
}
if (getArguments().getParcelable("com.scb.phone.TransferTabFragment.EXTRA_BILL_SCAN") != null) {
this.h = (C1203Xy) getArguments().getParcelable("com.scb.phone.TransferTabFragment.EXTRA_BILL_SCAN");
}
}
this.mViewPager.setClipToPadding(false);
this.mViewPager.setPadding(getResources().getDimensionPixelOffset(R.dimen.f28542131166620), 0, getResources().getDimensionPixelOffset(R.dimen.f28542131166620), 0);
return inflate;
}
@Override // androidx.fragment.app.Fragment
public void onViewCreated(View view, Bundle bundle) {
this.c = PurchaseCreditCardInputFragment.c(this.h);
AbstractC13482fbE a = getChildFragmentManager().a();
a.b(R.id.credit_card_input_container, this.c, null, 2);
a.b();
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityCreated(Bundle bundle) {
super.onActivityCreated(bundle);
this.mPresenter.c(this.d);
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
super.onDestroy();
this.mPresenter.w_();
}
@Override // com.scb.phone.view.fragment.BaseFragment, o.InterfaceC6638cYp
public final void v() {
super.v();
this.layoutCards.setVisibility(8);
this.layoutNoCard.setVisibility(8);
this.layoutError.setVisibility(8);
}
@Override // o.InterfaceC8972dat.RVV
public final void c(List<C0367Fb> list) {
this.layoutCards.setVisibility(0);
this.mViewPager.setAdapter(new CreditCardDetailPurchaseViewPagerAdapter(getContext(), list));
this.mIndicator.setViewPager(this.mViewPager);
this.c.b(list.get(0));
this.mViewPager.addOnPageChangeListener(new ViewPager.ojQ(this, list) { // from class: com.scb.phone.view.fragment.purchase.PurchaseCreditCardFragment.4
private PurchaseCreditCardFragment a;
private List d;
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageScrollStateChanged(int i) {
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageScrolled(int i, float f, int i2) {
}
{
this.a = this;
this.d = list;
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageSelected(int i) {
this.a.c.b((C0367Fb) this.d.get(i));
}
});
}
@Override // o.InterfaceC8972dat.RVV
public final void b() {
C1203Xy c1203Xy;
if (!isAdded() || (c1203Xy = this.h) == null || c1203Xy.f == null) {
return;
}
this.layoutNoCard.setVisibility(0);
this.noCardDescriptionTextView.setText(this.h.f.e);
}
@Override // o.InterfaceC8972dat.RVV
public final void d() {
this.mIndicator.setVisibility(0);
}
@Override // o.InterfaceC8972dat.RVV
public final void c() {
this.mIndicator.setVisibility(8);
}
@Override // o.InterfaceC8972dat.RVV
public final void e() {
this.layoutError.setVisibility(0);
}
@OnClick
public void onRefreshErrorCard() {
this.mPresenter.c(this.d);
}
}