what-the-bank/sources/com/scb/phone/view/fragment/devicesettings/DeviceSettingsFragment.java

156 lines
6.2 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.devicesettings;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.activity.PreLoadCheckActivity;
import com.scb.phone.view.adapter.devicesettings.DeviceSettingsAdapter;
import com.scb.phone.view.custom.common.CustomDialog;
import com.scb.phone.view.fragment.devicesettings.DeviceSettingsFragment;
import java.util.List;
import o.C16148leh;
import o.InterfaceC12790fHY;
import o.InterfaceC13391fZD;
import o.JC;
import o.aOE;
import o.cYN;
import o.gjJ;
/* loaded from: classes5.dex */
public class DeviceSettingsFragment extends Hilt_DeviceSettingsFragment implements cYN, InterfaceC12790fHY.HBt {
private InterfaceC12790fHY.RVV c;
private boolean d = false;
@InterfaceC13391fZD
public aOE devicePresenter;
@BindView
RecyclerView mRecyclerView;
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.devicesettings.Hilt_DeviceSettingsFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof InterfaceC12790fHY.RVV) {
this.c = (InterfaceC12790fHY.RVV) context;
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559563, viewGroup, false);
ButterKnife.c(this, inflate);
this.devicePresenter.e((aOE) this);
this.d = true;
if (getActivity().getIntent() != null) {
this.d = getActivity().getIntent().getBooleanExtra("EXTRA_ALLOW_DELETE_THIS_DEVICE", true);
}
this.devicePresenter.b(this.d);
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.devicePresenter.w_();
super.onDestroy();
}
@Override // o.cYN
public final void c(List<JC> list) {
getContext();
this.mRecyclerView.setLayoutManager(new LinearLayoutManager(1, false));
this.mRecyclerView.setNestedScrollingEnabled(false);
C16148leh c16148leh = new C16148leh(null);
this.mRecyclerView.setAdapter(c16148leh.d(new DeviceSettingsAdapter(this, list, this.d)));
c16148leh.b(this.mRecyclerView);
InterfaceC12790fHY.RVV rvv = this.c;
if (rvv != null) {
rvv.a(list.size());
}
}
@Override // o.cYN
public final void e() {
if (getActivity() instanceof PreLoadCheckActivity) {
PreLoadCheckActivity preLoadCheckActivity = (PreLoadCheckActivity) getActivity();
PreLoadCheckActivity.f(new Object[]{preLoadCheckActivity}, -1419637711, 1419637739, System.identityHashCode(preLoadCheckActivity));
}
}
@Override // o.InterfaceC12790fHY.HBt
public final void b(final String str, String str2, boolean z) {
Integer valueOf = Integer.valueOf(R.string.delete_not_now);
int i = R.string.delete_dialog_title;
if (!z) {
boolean z2 = this.d;
if (!z2) {
i = R.string.review_device_delete_title;
}
String string = z2 ? getString(R.string.delete_message, str2) : getString(R.string.review_device_delete_confirm, str2);
CustomDialog c = CustomDialog.b(getContext()).c(i);
if (gjJ.a(string)) {
c.mTextTextView.setVisibility(0);
c.mTextTextView.setText(string);
}
((CustomDialog) CustomDialog.e(new Object[]{c.aoT_(R.string.delete, new DialogInterface.OnClickListener(this, str) { // from class: o.eRI
private DeviceSettingsFragment a;
private String e;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i2) {
this.a.devicePresenter.e(this.e, false);
}
{
this.a = this;
this.e = str;
}
}), valueOf, new DialogInterface.OnClickListener() { // from class: o.eRJ
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i2) {
dialogInterface.dismiss();
}
}})).show();
return;
}
CustomDialog c2 = CustomDialog.b(getContext()).c(R.string.delete_dialog_title);
String string2 = getString(R.string.delete_message_own_device, str2);
if (gjJ.a(string2)) {
c2.mTextTextView.setVisibility(0);
c2.mTextTextView.setText(string2);
}
((CustomDialog) CustomDialog.e(new Object[]{c2.aoT_(R.string.delete_logout, new DialogInterface.OnClickListener(this, str) { // from class: o.eRN
private String c;
private DeviceSettingsFragment e;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i2) {
DeviceSettingsFragment.e(this.e, this.c);
}
{
this.e = this;
this.c = str;
}
}), valueOf, new DialogInterface.OnClickListener() { // from class: o.eRR
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i2) {
dialogInterface.dismiss();
}
}})).show();
}
public static /* synthetic */ void e(DeviceSettingsFragment deviceSettingsFragment, String str) {
deviceSettingsFragment.devicePresenter.e(str, true);
deviceSettingsFragment.getContext().getSharedPreferences("FlutterSharedPreferences", 0).edit().clear().apply();
}
}