240 lines
7.6 KiB
Java
240 lines
7.6 KiB
Java
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 androidx.viewpager.widget.ViewPager;
|
|
import butterknife.BindView;
|
|
import butterknife.ButterKnife;
|
|
import com.google.android.material.tabs.TabLayout;
|
|
import com.scb.phone.R;
|
|
import com.scb.phone.view.custom.common.DefaultButton;
|
|
import com.scb.phone.view.fragment.investment.schedule.SetupScheduleFragment;
|
|
import java.util.ArrayList;
|
|
import java.util.Map;
|
|
import o.C12296evY;
|
|
import o.C3895bKH;
|
|
import o.EnumC15203gjx;
|
|
import o.InterfaceC13391fZD;
|
|
import o.InterfaceC8942daP;
|
|
import o.InterfaceC8945daS;
|
|
import o.OU;
|
|
import o.VV;
|
|
import o.ZI;
|
|
import o.bKE;
|
|
import o.fHS;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public class SetupScheduleFragment extends Hilt_SetupScheduleFragment implements InterfaceC8942daP, InterfaceC8945daS {
|
|
|
|
@BindView
|
|
DefaultButton okButton;
|
|
|
|
@InterfaceC13391fZD
|
|
public bKE presenter;
|
|
|
|
@BindView
|
|
TabLayout tabLayout;
|
|
|
|
@BindView
|
|
ViewPager tabPager;
|
|
|
|
@BindView
|
|
DefaultButton unscheduledButton;
|
|
|
|
public static SetupScheduleFragment e(OU ou) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putParcelable("DISPLAY_KEY", ou);
|
|
SetupScheduleFragment setupScheduleFragment = new SetupScheduleFragment();
|
|
setupScheduleFragment.setArguments(bundle);
|
|
return setupScheduleFragment;
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
|
View inflate = layoutInflater.inflate(R.layout.2131559915, viewGroup, false);
|
|
ButterKnife.c(this, inflate);
|
|
final OU ou = (OU) getArguments().getParcelable("DISPLAY_KEY");
|
|
this.presenter.e((bKE) this);
|
|
bKE bke = this.presenter;
|
|
bke.d = ou;
|
|
Map<String, Boolean> map = bke.c;
|
|
Boolean bool = Boolean.FALSE;
|
|
map.put("O", bool);
|
|
bke.c.put("W", bool);
|
|
bke.c.put("M", bool);
|
|
ZI.IeS ieS = new ZI.IeS(ou) { // from class: o.bKI
|
|
private OU c;
|
|
|
|
@Override // o.ZI.IeS
|
|
public final void e(Object obj) {
|
|
bKE.c(this.c, (InterfaceC8942daP) obj);
|
|
}
|
|
|
|
{
|
|
this.c = ou;
|
|
}
|
|
};
|
|
if (bke.f != 0) {
|
|
ieS.e(bke.f);
|
|
}
|
|
return inflate;
|
|
}
|
|
|
|
@Override // o.InterfaceC8942daP
|
|
public final void e(boolean z) {
|
|
this.tabPager.setOffscreenPageLimit(z ? 3 : 1);
|
|
this.tabLayout.setVisibility(z ? 0 : 8);
|
|
}
|
|
|
|
@Override // o.InterfaceC8942daP
|
|
public final void a() {
|
|
ArrayList arrayList = new ArrayList();
|
|
arrayList.add(getString(R.string.schedule_type_once));
|
|
arrayList.add(getString(R.string.schedule_type_weekly));
|
|
arrayList.add(getString(R.string.schedule_type_monthly));
|
|
this.tabPager.setAdapter(new C12296evY(getChildFragmentManager(), arrayList, !this.presenter.d.c.equals(EnumC15203gjx.PURCHASE)));
|
|
this.tabLayout.setupWithViewPager(this.tabPager);
|
|
this.okButton.setButtonEnabled(false);
|
|
this.tabPager.addOnPageChangeListener(new ViewPager.ojQ(this) { // from class: com.scb.phone.view.fragment.investment.schedule.SetupScheduleFragment.1
|
|
private SetupScheduleFragment c;
|
|
|
|
@Override // androidx.viewpager.widget.ViewPager.ojQ
|
|
public final void onPageScrollStateChanged(int i) {
|
|
}
|
|
|
|
@Override // androidx.viewpager.widget.ViewPager.ojQ
|
|
public final void onPageScrolled(int i, float f, int i2) {
|
|
}
|
|
|
|
{
|
|
this.c = this;
|
|
}
|
|
|
|
@Override // androidx.viewpager.widget.ViewPager.ojQ
|
|
public final void onPageSelected(int i) {
|
|
if (i == 0) {
|
|
bKE bke = this.c.presenter;
|
|
bke.a = "O";
|
|
C3895bKH c3895bKH = new C3895bKH(bke, "O");
|
|
if (bke.f != 0) {
|
|
c3895bKH.e(bke.f);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (i == 1) {
|
|
bKE bke2 = this.c.presenter;
|
|
bke2.a = "W";
|
|
C3895bKH c3895bKH2 = new C3895bKH(bke2, "W");
|
|
if (bke2.f != 0) {
|
|
c3895bKH2.e(bke2.f);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (i == 2) {
|
|
bKE bke3 = this.c.presenter;
|
|
bke3.a = "M";
|
|
C3895bKH c3895bKH3 = new C3895bKH(bke3, "M");
|
|
if (bke3.f != 0) {
|
|
c3895bKH3.e(bke3.f);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
bKE bke = this.presenter;
|
|
bke.a = "O";
|
|
C3895bKH c3895bKH = new C3895bKH(bke, "O");
|
|
if (bke.f != 0) {
|
|
c3895bKH.e(bke.f);
|
|
}
|
|
this.okButton.setOnClickListener(new View.OnClickListener(this) { // from class: o.fkw
|
|
private SetupScheduleFragment a;
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
SetupScheduleFragment.d(this.a);
|
|
}
|
|
|
|
{
|
|
this.a = this;
|
|
}
|
|
});
|
|
this.unscheduledButton.setOnClickListener(new View.OnClickListener(this) { // from class: o.fkA
|
|
private SetupScheduleFragment e;
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
SetupScheduleFragment.b(this.e);
|
|
}
|
|
|
|
{
|
|
this.e = this;
|
|
}
|
|
});
|
|
}
|
|
|
|
@Override // o.InterfaceC8945daS
|
|
public final void c(String str, boolean z) {
|
|
final bKE bke = this.presenter;
|
|
bke.c.put(str, Boolean.valueOf(z));
|
|
ZI.IeS ieS = new ZI.IeS(bke) { // from class: o.bKC
|
|
private bKE a;
|
|
|
|
@Override // o.ZI.IeS
|
|
public final void e(Object obj) {
|
|
((InterfaceC8942daP) obj).c(r0.c.get(this.a.a).booleanValue());
|
|
}
|
|
|
|
{
|
|
this.a = bke;
|
|
}
|
|
};
|
|
if (bke.f != 0) {
|
|
ieS.e(bke.f);
|
|
}
|
|
}
|
|
|
|
@Override // o.InterfaceC8942daP
|
|
public final void c(boolean z) {
|
|
this.okButton.setButtonEnabled(z);
|
|
}
|
|
|
|
@Override // o.InterfaceC8945daS
|
|
public final void e(String str, VV vv) {
|
|
this.presenter.e.put(str, vv);
|
|
}
|
|
|
|
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
|
public void onDestroy() {
|
|
super.onDestroy();
|
|
this.presenter.w_();
|
|
}
|
|
|
|
public static /* synthetic */ void d(SetupScheduleFragment setupScheduleFragment) {
|
|
Bundle bundle = new Bundle();
|
|
bKE bke = setupScheduleFragment.presenter;
|
|
bundle.putParcelable("RESULT_KEY", bke.e.get(bke.a));
|
|
if (setupScheduleFragment.getActivity() instanceof fHS) {
|
|
((fHS) setupScheduleFragment.getActivity()).ayB_(bundle);
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ void b(SetupScheduleFragment setupScheduleFragment) {
|
|
Bundle bundle = new Bundle();
|
|
VV.HBt e = VV.e();
|
|
e.i = true;
|
|
bundle.putParcelable("RESULT_KEY", new VV(e, (byte) 0));
|
|
if (setupScheduleFragment.getActivity() instanceof fHS) {
|
|
((fHS) setupScheduleFragment.getActivity()).ayB_(bundle);
|
|
}
|
|
}
|
|
|
|
@Override // o.InterfaceC8945daS
|
|
public final OU e() {
|
|
return this.presenter.d;
|
|
}
|
|
}
|