what-the-bank/sources/com/scb/phone/view/fragment/profilemanagement/ManageNotificationsFragment...

146 lines
5.0 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.profilemanagement;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.huawei.hms.support.api.entity.common.CommonConstant;
import com.scb.phone.R;
import com.scb.phone.view.custom.CustomCheckboxGroupView;
import com.scb.phone.view.fragment.profilemanagement.ManageNotificationsFragment;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import o.C16867ruj;
import o.C7744cuB;
import o.IQ;
import o.InterfaceC13391fZD;
import o.InterfaceC9527dlS;
import o.XNX;
import o.YKU;
import o.ZQZ;
import o.guQ;
import o.ioC;
import o.qsu;
import o.xNF;
/* loaded from: classes5.dex */
public class ManageNotificationsFragment extends Hilt_ManageNotificationsFragment implements InterfaceC9527dlS {
private Map<String, CustomCheckboxGroupView> c;
@BindView
LinearLayout checkboxContainer;
@InterfaceC13391fZD
public C7744cuB manageNotificationsPresenter;
public static ManageNotificationsFragment d() {
return new ManageNotificationsFragment();
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559750, viewGroup, false);
ButterKnife.c(this, inflate);
this.manageNotificationsPresenter.e((C7744cuB) this);
C7744cuB c7744cuB = this.manageNotificationsPresenter;
if (c7744cuB.f != 0) {
c7744cuB.f.y();
}
c7744cuB.a.c();
xNF xnf = c7744cuB.a;
xnf.d(xnf.i, new C7744cuB.AnonymousClass4(c7744cuB));
this.c = new HashMap();
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.manageNotificationsPresenter.w_();
this.c.clear();
super.onDestroy();
}
@Override // o.InterfaceC9527dlS
public final void d(boolean z) {
j(getString(z ? R.string.manage_notifications_success_enabled : R.string.manage_notifications_success_disabled));
}
@Override // o.InterfaceC9527dlS
public final void a(String str, String str2, boolean z) {
if (this.c.get(str) == null) {
guQ.d("Trying to set selected a non-existent notification channel.", new Object[0]);
} else {
this.c.get(str).setChecked(str2, z);
}
}
public static /* synthetic */ void d(C7744cuB c7744cuB, String str, String str2, boolean z) {
List emptyList;
if (c7744cuB.f != 0) {
c7744cuB.f.y();
}
if (CommonConstant.RETKEY.EMAIL.equals(str)) {
boolean z2 = str2 != null;
if (z2) {
emptyList = Collections.singletonList(new ZQZ(str2, z));
} else {
emptyList = Collections.emptyList();
}
c7744cuB.d.d(new XNX(str, z2 || z, emptyList));
C16867ruj c16867ruj = c7744cuB.d;
c16867ruj.d(c16867ruj.i, new C7744cuB.Sts(c7744cuB, z, str, str2));
return;
}
if ("PUSH".equals(str)) {
c7744cuB.e.e(c7744cuB.b.getString("FCM_TOKEN", ""), z);
ioC ioc = c7744cuB.e;
ioc.d(ioc.i, new C7744cuB.Sts(c7744cuB, z, str, str2));
}
}
public static /* synthetic */ void a(ManageNotificationsFragment manageNotificationsFragment, IQ iq) {
CustomCheckboxGroupView customCheckboxGroupView = new CustomCheckboxGroupView(manageNotificationsFragment.getContext());
customCheckboxGroupView.setContentDescription(iq.b);
customCheckboxGroupView.setHideChildrenWhenUnchecked(true);
customCheckboxGroupView.setData(iq);
final C7744cuB c7744cuB = manageNotificationsFragment.manageNotificationsPresenter;
Objects.requireNonNull(c7744cuB);
customCheckboxGroupView.setListener(new CustomCheckboxGroupView.IeS(c7744cuB) { // from class: o.fuD
private C7744cuB a;
@Override // com.scb.phone.view.custom.CustomCheckboxGroupView.IeS
public final void c(String str, String str2, boolean z) {
ManageNotificationsFragment.d(this.a, str, str2, z);
}
{
this.a = c7744cuB;
}
});
manageNotificationsFragment.c.put(iq.c.b, customCheckboxGroupView);
manageNotificationsFragment.checkboxContainer.addView(customCheckboxGroupView);
}
@Override // o.InterfaceC9527dlS
public final void e(List<IQ> list) {
new YKU(list).d(new qsu(this) { // from class: o.fuA
private ManageNotificationsFragment c;
@Override // o.qsu
public final void d(Object obj) {
ManageNotificationsFragment.a(this.c, (IQ) obj);
}
{
this.c = this;
}
});
}
}