what-the-bank/sources/com/scb/phone/view/fragment/investment/schedule/SetupScheduleMonthlyFragmen...

214 lines
7.3 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.investment.schedule;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import androidx.fragment.app.Fragment;
import androidx.gridlayout.widget.GridLayout;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.custom.common.BubbleSelector;
import com.scb.phone.view.custom.common.ScheduleDate;
import com.scb.phone.view.fragment.investment.schedule.DayPickerDialog;
import com.scb.phone.view.fragment.investment.schedule.SetupScheduleMonthlyFragment;
import java.util.Iterator;
import java.util.TreeMap;
import o.AbstractC13482fbE;
import o.C3916bKn;
import o.InterfaceC13391fZD;
import o.InterfaceC8942daP;
import o.OF;
import o.OU;
import o.ZI;
import o.fIV;
/* loaded from: classes5.dex */
public class SetupScheduleMonthlyFragment extends Hilt_SetupScheduleMonthlyFragment implements InterfaceC8942daP.LWm.InterfaceC0108LWm, DayPickerDialog.RVV {
private CompoundButton.OnCheckedChangeListener d = new CompoundButton.OnCheckedChangeListener(this) { // from class: o.fkC
private SetupScheduleMonthlyFragment e;
@Override // android.widget.CompoundButton.OnCheckedChangeListener
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
SetupScheduleMonthlyFragment.d(this.e, z);
}
{
this.e = this;
}
};
@BindView
ScheduleDate dateSelector;
@BindView
GridLayout grid;
@InterfaceC13391fZD
public C3916bKn presenter;
@BindView
CheckBox selectAllCheckBox;
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559916, viewGroup, false);
ButterKnife.c(this, inflate);
this.presenter.e((C3916bKn) this);
C3916bKn c3916bKn = this.presenter;
OU e = ((BaseSetupScheduleFragment) this).c.e();
c3916bKn.c = new TreeMap();
ZI.IeS ieS = new ZI.IeS() { // from class: o.bKv
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC8942daP.LWm.InterfaceC0108LWm) obj).b();
}
};
if (c3916bKn.f != 0) {
ieS.e(c3916bKn.f);
}
c3916bKn.e(e.a.e);
return inflate;
}
@Override // o.InterfaceC8942daP.LWm
public final void b() {
this.dateSelector.setLabel(getString(R.string.setup_schedule_monthly_purchase_every_label));
this.dateSelector.setOnMakePaymentEveryListener(new fIV(this) { // from class: o.fky
private SetupScheduleMonthlyFragment a;
@Override // o.fIV
public final void c() {
SetupScheduleMonthlyFragment.a(this.a);
}
{
this.a = this;
}
});
this.dateSelector.setCalendarButtonVisible(8);
this.dateSelector.setDateFieldVisible(8);
this.dateSelector.setArrowIconVisible(0);
this.dateSelector.setPaymentFieldVisible(0);
for (int i = 0; i < this.grid.getChildCount(); i++) {
if (this.grid.getChildAt(i) instanceof BubbleSelector) {
BubbleSelector bubbleSelector = (BubbleSelector) this.grid.getChildAt(i);
this.presenter.e(bubbleSelector.a, false);
bubbleSelector.d = new BubbleSelector.RVV(this) { // from class: o.fkB
private SetupScheduleMonthlyFragment c;
@Override // com.scb.phone.view.custom.common.BubbleSelector.RVV
public final void c(String str, boolean z) {
this.c.presenter.e(str, z);
}
{
this.c = this;
}
};
}
}
this.selectAllCheckBox.setOnCheckedChangeListener(this.d);
}
@Override // o.InterfaceC8942daP.LWm.InterfaceC0108LWm
public final void a(boolean z) {
this.selectAllCheckBox.setOnCheckedChangeListener(null);
this.selectAllCheckBox.setChecked(z);
this.selectAllCheckBox.setOnCheckedChangeListener(this.d);
}
@Override // o.InterfaceC8942daP.LWm.InterfaceC0108LWm
public final void b(boolean z) {
for (int i = 0; i < this.grid.getChildCount(); i++) {
if (this.grid.getChildAt(i) instanceof BubbleSelector) {
((BubbleSelector) this.grid.getChildAt(i)).setSelected(z);
}
}
}
@Override // o.InterfaceC8942daP.LWm.InterfaceC0108LWm
public final void a(String str) {
this.dateSelector.setPaymentField(str);
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
super.onDestroy();
this.presenter.w_();
}
public static /* synthetic */ void a(SetupScheduleMonthlyFragment setupScheduleMonthlyFragment) {
AbstractC13482fbE a = setupScheduleMonthlyFragment.getChildFragmentManager().a();
Fragment findFragmentByTag = setupScheduleMonthlyFragment.getFragmentManager().findFragmentByTag("dialog");
if (findFragmentByTag != null) {
a.e(findFragmentByTag);
}
if (a.d) {
a.a = true;
a.m = null;
OF.IeS e = OF.e();
e.a = 1;
e.b = 26;
DayPickerDialog.e(new OF(e, (byte) 0)).show(a, "dialog");
return;
}
throw new IllegalStateException("This FragmentTransaction is not allowed to be added to the back stack.");
}
public static /* synthetic */ void d(SetupScheduleMonthlyFragment setupScheduleMonthlyFragment, final boolean z) {
C3916bKn c3916bKn = setupScheduleMonthlyFragment.presenter;
ZI.IeS ieS = new ZI.IeS(z) { // from class: o.bKx
private boolean d;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC8942daP.LWm.InterfaceC0108LWm) obj).b(this.d);
}
{
this.d = z;
}
};
if (c3916bKn.f != 0) {
ieS.e(c3916bKn.f);
}
Iterator<Integer> it = c3916bKn.c.keySet().iterator();
while (it.hasNext()) {
c3916bKn.c.put(it.next(), Boolean.valueOf(z));
}
c3916bKn.c();
}
@Override // com.scb.phone.view.fragment.investment.schedule.DayPickerDialog.RVV
public final void a(int i) {
C3916bKn c3916bKn = this.presenter;
final String valueOf = String.valueOf(i);
c3916bKn.a = valueOf;
ZI.IeS ieS = new ZI.IeS(valueOf) { // from class: o.bKu
private String d;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC8942daP.LWm.InterfaceC0108LWm) obj).a(this.d);
}
{
this.d = valueOf;
}
};
if (c3916bKn.f != 0) {
ieS.e(c3916bKn.f);
}
c3916bKn.c();
}
@Override // com.scb.phone.view.fragment.investment.schedule.BaseSetupScheduleFragment
final String d() {
return "M";
}
}