what-the-bank/sources/com/scb/phone/view/fragment/sme/SMELandingFragment.java

289 lines
8.5 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.sme;
import android.content.Intent;
import android.content.IntentFilter;
import android.location.LocationManager;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.promptpay.PromptPayQRActivity;
import com.scb.phone.view.custom.CustomProfileImageView;
import com.scb.phone.view.fragment.sme.SMELandingFragment;
import java.util.ArrayList;
import java.util.List;
import o.C0391Fn;
import o.C0907Rf;
import o.C12374ewx;
import o.InterfaceC13391fZD;
import o.InterfaceC8930daD;
import o.ZI;
import o.cIT;
import o.cIU;
import o.fSJ;
import o.fSQ;
import o.glR;
import o.nMh;
/* loaded from: classes5.dex */
public class SMELandingFragment extends Hilt_SMELandingFragment implements InterfaceC8930daD.LWm {
@BindView
CustomProfileImageView cusIvProfile;
private fSJ d;
private fSJ i;
@InterfaceC13391fZD
public cIT landingPagePresenter;
@BindView
ViewGroup qrCodeBeltButton;
@BindView
ViewGroup scanBeltButton;
@BindView
TextView tvHomeCity;
@BindView
TextView tvHomeWelcomeHeadline;
@BindView
TextView tvHomeWelcomeUserName;
@Override // o.InterfaceC12854fJL
public final void G() {
}
@Override // o.InterfaceC12854fJL
public final void a(long j, long j2) {
}
@Override // o.InterfaceC6633cYk
public final void b(C0907Rf.Sts sts) {
}
@Override // o.InterfaceC12854fJL
public final void d_(boolean z) {
}
@Override // o.InterfaceC6633cYk
public final void j() {
}
@Override // o.InterfaceC6633cYk
public final void o() {
}
public static SMELandingFragment d(List<C0907Rf.Sts> list) {
Bundle bundle = new Bundle();
ArrayList arrayList = new ArrayList();
if (list != null) {
arrayList = new ArrayList(list);
}
bundle.putParcelableArrayList("com.scb.phone.EXTRA_LANDING_TILESS", new ArrayList<>(arrayList));
SMELandingFragment sMELandingFragment = new SMELandingFragment();
sMELandingFragment.setArguments(bundle);
return sMELandingFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559741, viewGroup, false);
ButterKnife.c(this, inflate);
super.aa();
Z();
Y();
if (this.mToolbar != null) {
this.mToolbar.setVisibility(0);
}
ab();
e(this.mRecyclerView, null, null);
this.landingPagePresenter.e((cIT) this);
if (getArguments() != null) {
final cIT cit = this.landingPagePresenter;
final ArrayList parcelableArrayList = getArguments().getParcelableArrayList("com.scb.phone.EXTRA_LANDING_TILESS");
ZI.IeS ieS = new ZI.IeS(cit, parcelableArrayList) { // from class: o.cIY
private List b;
private cIT c;
@Override // o.ZI.IeS
public final void e(Object obj) {
cIT.d(this.c, this.b, (InterfaceC8930daD.LWm) obj);
}
{
this.c = cit;
this.b = parcelableArrayList;
}
};
if (cit.f != 0) {
ieS.e(cit.f);
}
}
this.i = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_PROFILE_UPDATED")).subscribe(new fSQ(this) { // from class: o.fBl
private SMELandingFragment d;
@Override // o.fSQ
public final void c(Object obj) {
SMELandingFragment.c(this.d);
}
{
this.d = this;
}
}, new fSQ() { // from class: o.fBi
@Override // o.fSQ
public final void c(Object obj) {
guQ.a((Throwable) obj);
}
});
this.d = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_UPDATE_LOCATION")).subscribe(new fSQ(this) { // from class: o.fBg
private SMELandingFragment d;
@Override // o.fSQ
public final void c(Object obj) {
this.d.r();
}
{
this.d = this;
}
}, new fSQ() { // from class: o.fBi
@Override // o.fSQ
public final void c(Object obj) {
guQ.a((Throwable) obj);
}
});
return inflate;
}
@Override // androidx.fragment.app.Fragment
public void onResume() {
super.onResume();
r();
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
fSJ fsj = this.i;
if (fsj != null && !fsj.isDisposed()) {
this.i.dispose();
}
fSJ fsj2 = this.d;
if (fsj2 != null && !fsj2.isDisposed()) {
this.d.dispose();
}
this.landingPagePresenter.w_();
super.onDestroy();
}
@Override // com.scb.phone.view.fragment.BaseFragment
public final void aa() {
super.aa();
Z();
Y();
if (this.mToolbar != null) {
this.mToolbar.setVisibility(0);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void r() {
if (getActivity() != null) {
LocationManager locationManager = (LocationManager) getActivity().getSystemService("location");
if (getContext() != null && nMh.checkSelfPermission(getContext(), "android.permission.ACCESS_FINE_LOCATION") == 0 && locationManager.isProviderEnabled("gps")) {
cIT cit = this.landingPagePresenter;
cit.f8546o.e();
C12374ewx c12374ewx = cit.f8546o;
c12374ewx.d(c12374ewx.i, new cIT.RVV(cit, (byte) 0));
}
}
}
@Override // o.InterfaceC8930daD.LWm
public final void c(String str) {
this.tvHomeCity.setText(str);
this.tvHomeCity.setVisibility(str.isEmpty() ? 4 : 0);
}
@Override // o.InterfaceC12854fJL
public final void d(long j) {
this.landingPagePresenter.d(j);
}
@Override // o.InterfaceC6633cYk
public final void f() {
v("ssme_tile_createqr");
startActivity(new Intent(getActivity(), (Class<?>) PromptPayQRActivity.class));
}
@Override // com.scb.phone.view.fragment.landingpage.BaseDragAndDropFragment, o.InterfaceC6633cYk
public final void k() {
v("ssme_qr_belt_scan");
super.k();
}
@Override // o.InterfaceC8930daD.LWm
public final void l() {
v("ssme_qr_belt_create");
startActivity(new Intent(getActivity(), (Class<?>) PromptPayQRActivity.class));
}
public static /* synthetic */ void c(SMELandingFragment sMELandingFragment) {
cIT cit = sMELandingFragment.landingPagePresenter;
if (cit != null) {
cIU ciu = new cIU(cit.c.d(cit.f8546o.e.L()));
if (cit.f != 0) {
ciu.e(cit.f);
}
}
}
/* JADX INFO: Access modifiers changed from: protected */
@OnClick
public void onQRBeltCreateButtonClicked() {
cIT cit = this.landingPagePresenter;
ZI.IeS ieS = new ZI.IeS() { // from class: o.cJc
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC8930daD.LWm) obj).l();
}
};
if (cit.f != 0) {
ieS.e(cit.f);
}
}
/* JADX INFO: Access modifiers changed from: protected */
@OnClick
public void onQRBeltScanButtonClicked() {
cIT cit = this.landingPagePresenter;
ZI.IeS ieS = new ZI.IeS() { // from class: o.cIW
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC8930daD.LWm) obj).k();
}
};
if (cit.f != 0) {
ieS.e(cit.f);
}
}
@Override // o.InterfaceC8930daD.LWm
public final void b(C0391Fn c0391Fn) {
this.tvHomeWelcomeUserName.setVisibility(TextUtils.isEmpty(c0391Fn.h) ? 8 : 0);
this.tvHomeWelcomeUserName.setText(c0391Fn.h);
this.tvHomeWelcomeHeadline.setText(c0391Fn.c);
if (getContext() != null) {
this.cusIvProfile.setImageUrl(c0391Fn.b);
}
}
}