what-the-bank/sources/com/scb/phone/view/fragment/notification/NotificationFragment.java

313 lines
11 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.notification;
import android.content.Intent;
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.LinearLayout;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.huawei.hms.support.api.entity.common.CommonConstant;
import com.scb.phone.R;
import com.scb.phone.view.activity.HomeActivity;
import com.scb.phone.view.activity.requesttopay.PayerReviewActivity;
import com.scb.phone.view.activity.sme.gifting.GiftingActivity;
import java.util.List;
import o.C10461eEv;
import o.C10864eR;
import o.C11604eiV;
import o.C1189Xo;
import o.C12425exv;
import o.C13396fZU;
import o.C14221fpC;
import o.C15716hvG;
import o.C17201uku;
import o.C5113bms;
import o.C6825cci;
import o.InterfaceC13391fZD;
import o.InterfaceC8959dag;
import o.LJe;
import o.SM;
import o.SN;
import o.YQb;
import o.ZI;
import o.qeC;
import o.qwQ;
import o.xNu;
/* loaded from: classes5.dex */
public class NotificationFragment extends Hilt_NotificationFragment implements InterfaceC8959dag {
public C12425exv c;
private C5113bms d;
@InterfaceC13391fZD
public C6825cci notificationPresenter;
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroyView() {
this.notificationPresenter.w_();
this.d.b.setItemAnimator(null);
this.d.b.setAdapter(null);
this.d = null;
super.onDestroyView();
}
@Override // androidx.fragment.app.Fragment
public void onHiddenChanged(boolean z) {
super.onHiddenChanged(z);
if (z || this.notificationPresenter == null) {
return;
}
C12425exv c12425exv = this.c;
if (c12425exv != null) {
int size = c12425exv.b.size();
c12425exv.b.clear();
c12425exv.notifyItemRangeRemoved(0, size);
}
c((SN) null);
}
@Override // com.scb.phone.view.fragment.BaseFragment
public final void aa() {
super.aa();
Z();
u(getString(R.string.notifications));
}
@Override // com.scb.phone.view.fragment.BaseFragment
public final void aJ_() {
SN sn;
super.aJ_();
C12425exv c12425exv = this.c;
if (c12425exv.b.isEmpty()) {
sn = null;
} else {
sn = c12425exv.b.get(r0.size() - 1);
}
c(sn);
}
@Override // o.InterfaceC8959dag
public final void c(List<SN> list) {
LinearLayout linearLayout = this.d.a.e;
if (list.isEmpty()) {
linearLayout.setVisibility(0);
} else {
linearLayout.setVisibility(8);
C12425exv c12425exv = this.c;
int size = list.size();
c12425exv.b.addAll(list);
c12425exv.notifyItemRangeInserted(size + 1, list.size());
}
C12425exv c12425exv2 = this.c;
if (c12425exv2.a) {
c12425exv2.a = false;
}
}
@Override // o.InterfaceC8959dag
public final void b() {
C12425exv c12425exv = this.c;
if (c12425exv.a) {
c12425exv.a = false;
}
}
@Override // o.InterfaceC8959dag
public final void c() {
C12425exv c12425exv = this.c;
if (c12425exv.a) {
c12425exv.a = false;
}
}
@Override // o.InterfaceC8959dag
public final void e(C1189Xo c1189Xo) {
Intent intent = new Intent(getContext(), (Class<?>) PayerReviewActivity.class);
c1189Xo.e("rtp.payer.notification");
intent.putExtra("com.scb.phone.EXTRA_REVIEW", c1189Xo);
startActivity(intent);
}
@Override // o.InterfaceC8959dag
public final boolean e(String str) {
xNu xnu = this.notificationPresenter.a;
return xNu.j(str);
}
@Override // o.InterfaceC8959dag
public final void e(C13396fZU<String, C15716hvG> c13396fZU) {
g(c13396fZU);
}
private void c(SN sn) {
C12425exv c12425exv = this.c;
C14221fpC c14221fpC = new C14221fpC(this, sn);
if (!c12425exv.a) {
c12425exv.a = true;
c14221fpC.b(true);
}
}
public static /* synthetic */ void a(NotificationFragment notificationFragment, SN sn, boolean z) {
if (z) {
byte b = 0;
if (sn == null) {
C6825cci c6825cci = notificationFragment.notificationPresenter;
c6825cci.c = false;
if (c6825cci.f != 0) {
c6825cci.f.v();
}
c6825cci.b.b();
LJe lJe = c6825cci.b;
lJe.d(lJe.i, new C6825cci.RVV(c6825cci, b));
return;
}
C6825cci c6825cci2 = notificationFragment.notificationPresenter;
String str = sn.i;
if (!c6825cci2.c) {
if (c6825cci2.f != 0) {
c6825cci2.f.v();
}
c6825cci2.b.d(str);
LJe lJe2 = c6825cci2.b;
lJe2.d(lJe2.i, new C6825cci.RVV(c6825cci2, b));
return;
}
if (c6825cci2.f != 0) {
ZI.IeS ieS = new ZI.IeS() { // from class: o.ccf
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC8959dag) obj).b();
}
};
if (c6825cci2.f != 0) {
ieS.e(c6825cci2.f);
}
}
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559789, viewGroup, false);
int i = R.id.custom_progress;
View e = qeC.e(inflate, R.id.custom_progress);
if (e != null) {
if (e == null) {
throw new NullPointerException("rootView");
}
LinearLayout linearLayout = (LinearLayout) e;
C17201uku c17201uku = new C17201uku(linearLayout, linearLayout);
int i2 = R.id.custom_toolbar;
View e2 = qeC.e(inflate, R.id.custom_toolbar);
if (e2 != null) {
C11604eiV c = C11604eiV.c(e2);
i2 = R.id.no_message_layout;
View e3 = qeC.e(inflate, R.id.no_message_layout);
if (e3 != null) {
if (e3 == null) {
throw new NullPointerException("rootView");
}
YQb yQb = new YQb((LinearLayout) e3);
i = R.id.notification_recycler_view;
RecyclerView recyclerView = (RecyclerView) qeC.e(inflate, R.id.notification_recycler_view);
if (recyclerView != null) {
i = R.id.scroll_view;
NestedScrollView nestedScrollView = (NestedScrollView) qeC.e(inflate, R.id.scroll_view);
if (nestedScrollView != null) {
C5113bms c5113bms = new C5113bms((LinearLayout) inflate, c17201uku, c, yQb, recyclerView, nestedScrollView);
this.d = c5113bms;
this.mToolbar = c5113bms.d.c;
this.mActionBarTitle = this.d.d.d;
this.mProgress = this.d.c.d;
((HomeActivity) requireActivity()).k = true;
this.c = new C12425exv();
super.aa();
Z();
u(getString(R.string.notifications));
NestedScrollView nestedScrollView2 = this.d.h;
if (nestedScrollView2 != null) {
nestedScrollView2.setOnScrollChangeListener(new C10461eEv(this));
}
this.notificationPresenter.e((C6825cci) this);
c((SN) null);
getContext();
this.d.b.setLayoutManager(new LinearLayoutManager(1, false));
this.d.b.setNestedScrollingEnabled(false);
this.d.b.setAdapter(this.c);
this.c.d = this;
return this.d.e;
}
}
}
}
i = i2;
}
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
}
@Override // o.InterfaceC8959dag
public final void e(SN sn) {
String str;
if (sn.h.isEmpty() || sn.h.get(0).c == null) {
str = "";
} else {
str = sn.h.get(0).c;
}
if (str == null || str.isEmpty()) {
return;
}
C6825cci c6825cci = this.notificationPresenter;
str.hashCode();
if (str.equals("scbeasy://mutualfunds")) {
ZI.IeS ieS = new ZI.IeS() { // from class: o.ccl
@Override // o.ZI.IeS
public final void e(Object obj) {
C6825cci.e((InterfaceC8959dag) obj);
}
};
if (c6825cci.f != 0) {
ieS.e(c6825cci.f);
}
} else if (str.equals("scbeasy://lifestylelanding/tiles/202")) {
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.ccm
@Override // o.ZI.IeS
public final void e(Object obj) {
C6825cci.a((InterfaceC8959dag) obj);
}
};
if (c6825cci.f != 0) {
ieS2.e(c6825cci.f);
}
}
Intent intent = new Intent(CommonConstant.ACTION.HWID_SCHEME_URL, Uri.parse(str));
intent.putExtra("NOTIFICATION_INBOX_TAG", true);
startActivity(intent);
}
@Override // o.InterfaceC8959dag
public final void b(SN sn) {
if (sn.d != SM.RTP_ACTION_ID || sn.f == null || TextUtils.isEmpty(sn.f.b)) {
if (SM.GIFT_ACTION_ID.equals(sn.d)) {
startActivity(new Intent(getContext(), (Class<?>) GiftingActivity.class));
return;
}
return;
}
C6825cci c6825cci = this.notificationPresenter;
String str = sn.f.b;
if (c6825cci.f != 0) {
c6825cci.f.y();
}
c6825cci.e = str;
c6825cci.d.d(new C10864eR(str, c6825cci.h));
qwQ qwq = c6825cci.d;
qwq.d(qwq.i, new C6825cci.LWm(c6825cci, (byte) 0));
}
}