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

212 lines
7.0 KiB
Java

package com.scb.phone.view.fragment.accountsummary;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import butterknife.ButterKnife;
import com.huawei.hms.support.api.entity.common.CommonConstant;
import com.scb.phone.R;
import com.scb.phone.view.activity.loan.LoanDetailActivity;
import com.scb.phone.view.fragment.BaseFragment;
import com.scb.phone.view.fragment.accountsummary.LoanFragment;
import java.util.ArrayList;
import java.util.List;
import o.C0385Fj;
import o.C12025eqS;
import o.C14831gS;
import o.C14957gcv;
import o.C2381adY;
import o.InterfaceC12826fIa;
import o.InterfaceC13391fZD;
import o.InterfaceC6627cYe;
import o.ZI;
import o.fSQ;
import o.glR;
import o.mSw;
import o.pug;
/* loaded from: classes5.dex */
public class LoanFragment extends Hilt_LoanFragment implements InterfaceC6627cYe.tOB, InterfaceC12826fIa {
@InterfaceC13391fZD
public C2381adY loanPresenter;
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559441, viewGroup, false);
ButterKnife.c(this, inflate);
this.loanPresenter.e((C2381adY) this);
((BaseFragment) this).b = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_SWIPE_REFRESH")).subscribe(new fSQ(this) { // from class: o.eFP
private LoanFragment c;
@Override // o.fSQ
public final void c(Object obj) {
this.c.loanPresenter.c();
}
{
this.c = this;
}
}, new fSQ() { // from class: o.eFQ
@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.eFT
private LoanFragment c;
@Override // o.fSQ
public final void c(Object obj) {
this.c.loanPresenter.c();
}
{
this.c = this;
}
}, new fSQ() { // from class: o.eFQ
@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.eFR
private LoanFragment c;
@Override // o.fSQ
public final void c(Object obj) {
this.c.loanPresenter.c();
}
{
this.c = this;
}
}, new fSQ() { // from class: o.eFQ
@Override // o.fSQ
public final void c(Object obj) {
guQ.a((Throwable) obj);
}
});
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityCreated(Bundle bundle) {
super.onActivityCreated(bundle);
C2381adY c2381adY = this.loanPresenter;
if (c2381adY.c) {
return;
}
c2381adY.c = true;
if (c2381adY.f != 0) {
c2381adY.f.v();
}
c2381adY.b.b();
mSw msw = c2381adY.b;
msw.d(msw.i, new C2381adY.HBt(c2381adY, (byte) 0));
}
@Override // com.scb.phone.view.fragment.accountsummary.BaseCardFragment, com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
C2381adY c2381adY = this.loanPresenter;
if (c2381adY != null) {
c2381adY.w_();
}
super.onDestroy();
}
@Override // o.InterfaceC6627cYe.tOB
public final void e(List<C0385Fj> list) {
if (list.isEmpty()) {
RelativeLayout relativeLayout = this.mParentLayout;
if (relativeLayout != null) {
relativeLayout.setVisibility(8);
return;
}
return;
}
C12025eqS c12025eqS = new C12025eqS(getActivity(), list);
C14957gcv.e(this, "");
if (c12025eqS.d == null) {
c12025eqS.d = this;
}
this.mViewPager.setAdapter(c12025eqS);
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.tOB
public final void c(int i) {
Intent intent = new Intent(getActivity(), (Class<?>) LoanDetailActivity.class);
List<C0385Fj> list = this.loanPresenter.e;
intent.putParcelableArrayListExtra("LOAN_DISPLAY_LIST", list != null ? (ArrayList) list : new ArrayList<>());
intent.putExtra("SELECTED_LOAN_POSITION", i);
startActivity(intent);
}
@Override // o.InterfaceC6627cYe.tOB
public final void a(String str) {
Intent intent = new Intent(CommonConstant.ACTION.HWID_SCHEME_URL);
C14831gS c14831gS = C14831gS.d;
intent.setData(Uri.parse(C14831gS.e(str)));
startActivity(intent);
}
@Override // o.InterfaceC12826fIa
public final void a(final int i) {
List<C0385Fj> list = this.loanPresenter.e;
final C0385Fj c0385Fj = (C0385Fj) (list != null ? (ArrayList) list : new ArrayList()).get(i);
if (!TextUtils.isEmpty(c0385Fj.y)) {
c("click_loancard", new pug("loanproduct", c0385Fj.y));
}
C2381adY c2381adY = this.loanPresenter;
if (c0385Fj.p) {
ZI.IeS ieS = new ZI.IeS(c0385Fj) { // from class: o.aed
private C0385Fj b;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6627cYe.tOB) obj).a(this.b.h);
}
{
this.b = c0385Fj;
}
};
if (c2381adY.f != 0) {
ieS.e(c2381adY.f);
return;
}
return;
}
ZI.IeS ieS2 = new ZI.IeS(c0385Fj, i) { // from class: o.adZ
private C0385Fj d;
private int e;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6627cYe.tOB) obj).c(this.e);
}
{
this.d = c0385Fj;
this.e = i;
}
};
if (c2381adY.f != 0) {
ieS2.e(c2381adY.f);
}
}
}