what-the-bank/sources/com/scb/phone/view/fragment/accountsummary/CreditCardFragment.java

273 lines
9.4 KiB
Java

package com.scb.phone.view.fragment.accountsummary;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.activity.creditcard.CreditCardDetailActivity;
import com.scb.phone.view.adapter.accountsummary.CardViewPagerAdapter;
import com.scb.phone.view.fragment.BaseFragment;
import com.scb.phone.view.fragment.accountsummary.CreditCardFragment;
import java.util.List;
import o.C0375Fe;
import o.C0377Ff;
import o.C1025UIz;
import o.C14957gcv;
import o.C17764zak;
import o.C2329acZ;
import o.Icn;
import o.InterfaceC12840fIo;
import o.InterfaceC13154fSb;
import o.InterfaceC13391fZD;
import o.InterfaceC6627cYe;
import o.VDK;
import o.ZI;
import o.fHO;
import o.fSQ;
import o.glR;
import org.threeten.bp.OffsetDateTime;
/* loaded from: classes5.dex */
public class CreditCardFragment extends Hilt_CreditCardFragment implements InterfaceC6627cYe.Sts, InterfaceC12840fIo {
@InterfaceC13391fZD
public C2329acZ creditCardPresenter;
@Override // androidx.fragment.app.Fragment
public void onResume() {
super.onResume();
C2329acZ c2329acZ = this.creditCardPresenter;
if (c2329acZ.c.equalsIgnoreCase(W())) {
return;
}
ZI.IeS ieS = new ZI.IeS() { // from class: o.adf
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6627cYe.Sts) obj).a();
}
};
if (c2329acZ.f != 0) {
ieS.e(c2329acZ.f);
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559436, viewGroup, false);
ButterKnife.c(this, inflate);
((BaseFragment) this).b = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_SWIPE_REFRESH")).subscribe(new fSQ(this) { // from class: o.eFu
private CreditCardFragment c;
@Override // o.fSQ
public final void c(Object obj) {
r0.creditCardPresenter.e(this.c.W(), true);
}
{
this.c = this;
}
}, new fSQ() { // from class: o.eFr
@Override // o.fSQ
public final void c(Object obj) {
guQ.a((Throwable) obj);
}
});
((BaseCardFragment) this).d = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_HOME_ACTIVITY_REFRESH")).subscribe(new fSQ(this) { // from class: o.eFu
private CreditCardFragment c;
@Override // o.fSQ
public final void c(Object obj) {
r0.creditCardPresenter.e(this.c.W(), true);
}
{
this.c = this;
}
}, new fSQ() { // from class: o.eFr
@Override // o.fSQ
public final void c(Object obj) {
guQ.a((Throwable) obj);
}
});
((BaseCardFragment) this).j = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_REGISTERED_ACCOUNTS_UPDATED")).subscribe(new fSQ(this) { // from class: o.eFu
private CreditCardFragment c;
@Override // o.fSQ
public final void c(Object obj) {
r0.creditCardPresenter.e(this.c.W(), true);
}
{
this.c = this;
}
}, new fSQ() { // from class: o.eFr
@Override // o.fSQ
public final void c(Object obj) {
guQ.a((Throwable) obj);
}
});
this.creditCardPresenter.e((C2329acZ) this);
this.creditCardPresenter.c = W();
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityCreated(Bundle bundle) {
super.onActivityCreated(bundle);
this.creditCardPresenter.e(W(), true);
}
@Override // com.scb.phone.view.fragment.accountsummary.BaseCardFragment, com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
C2329acZ c2329acZ = this.creditCardPresenter;
if (c2329acZ != null) {
c2329acZ.w_();
}
super.onDestroy();
}
@Override // o.InterfaceC6627cYe.Sts
public final void a(List<C0377Ff> list) {
if (list.isEmpty()) {
RelativeLayout relativeLayout = this.mParentLayout;
if (relativeLayout != null) {
relativeLayout.setVisibility(8);
return;
}
return;
}
this.mViewPager.setAdapter(new CardViewPagerAdapter(getActivity(), list, this));
this.mViewPager.setClipToPadding(false);
this.mViewPager.setPadding(getResources().getDimensionPixelOffset(R.dimen.f28542131166620), 0, getResources().getDimensionPixelOffset(R.dimen.f28542131166620), 0);
b(list);
RelativeLayout relativeLayout2 = this.mParentLayout;
if (relativeLayout2 != null) {
relativeLayout2.setVisibility(0);
}
}
@Override // o.InterfaceC6627cYe.Sts
public final void a() {
this.creditCardPresenter.e(W(), false);
}
@Override // o.InterfaceC12840fIo
public final void d(int i) {
startActivity(CreditCardDetailActivity.aaE_(requireContext(), i));
}
@Override // o.InterfaceC6627cYe.IeS
public final void e(C0375Fe c0375Fe) {
a(c0375Fe, new fHO(this, c0375Fe) { // from class: com.scb.phone.view.fragment.accountsummary.CreditCardFragment.2
private C0375Fe d;
private CreditCardFragment e;
{
this.e = this;
this.d = c0375Fe;
}
@Override // o.fHO
public final void c() {
C2329acZ c2329acZ = this.e.creditCardPresenter;
String str = this.d.b;
c2329acZ.a.b(new InterfaceC13154fSb(c2329acZ, str, this.d.e) { // from class: o.acZ.2
private C2329acZ a;
private String b;
private String d;
@Override // o.InterfaceC13154fSb
public final void onSubscribe(fSJ fsj) {
}
{
this.a = c2329acZ;
this.b = str;
this.d = r3;
}
@Override // o.InterfaceC13154fSb
public final void onComplete() {
C2329acZ c2329acZ2 = this.a;
final String str2 = this.b;
final String str3 = this.d;
ZI.IeS ieS = new ZI.IeS(str2, str3) { // from class: o.adc
private String b;
private String c;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6627cYe.Sts) obj).c(this.b, this.c);
}
{
this.b = str2;
this.c = str3;
}
};
if (c2329acZ2.f != 0) {
ieS.e(c2329acZ2.f);
}
}
@Override // o.InterfaceC13154fSb
public final void onError(Throwable th) {
C2329acZ.e(this.a, th);
}
}, new Icn.IeS(str), c2329acZ.d);
}
@Override // o.fHO
public final void a() {
C2329acZ c2329acZ = this.e.creditCardPresenter;
final String str = this.d.d;
final String str2 = this.d.b;
final String str3 = this.d.e;
if (str != null) {
ZI.IeS ieS = new ZI.IeS(str, str2, str3) { // from class: o.adg
private String a;
private String b;
private String e;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6627cYe.Sts) obj).a(this.e, this.b, this.a);
}
{
this.e = str;
this.b = str2;
this.a = str3;
}
};
if (c2329acZ.f != 0) {
ieS.e(c2329acZ.f);
}
}
}
});
}
@Override // o.InterfaceC6627cYe.IeS
public final void c(String str, String str2) {
d(str, str2);
}
@Override // o.InterfaceC6627cYe.IeS
public final void a(String str, String str2, String str3) {
C1025UIz c1025UIz = this.creditCardPresenter.b;
OffsetDateTime now = OffsetDateTime.now();
C14957gcv.c(now, "");
c1025UIz.b(new VDK(str3, "contextual_banner", str2, now));
C17764zak.HBt hBt = C17764zak.CREATOR;
C14957gcv.e(str2, "");
C14957gcv.e(str3, "");
g(C17764zak.HBt.d(str2, str3, C17764zak.HBt.IeS.CLICK));
e(str);
}
}