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

180 lines
6.3 KiB
Java

package com.scb.phone.view.fragment.investment.schedule;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.activity.scheduledtransaction.CalendarDialogActivity;
import com.scb.phone.view.custom.common.ScheduleDate;
import com.scb.phone.view.fragment.investment.schedule.SetupScheduleOnceFragment;
import o.C3893bKA;
import o.C3927bKy;
import o.EnumC15203gjx;
import o.EnumC15515gsk;
import o.InterfaceC12869fJm;
import o.InterfaceC13391fZD;
import o.InterfaceC8942daP;
import o.OU;
import o.ZI;
import o.cXG;
import org.threeten.bp.OffsetDateTime;
/* loaded from: classes5.dex */
public class SetupScheduleOnceFragment extends Hilt_SetupScheduleOnceFragment implements InterfaceC8942daP.LWm.RVV {
@BindView
ScheduleDate paymentDate;
@InterfaceC13391fZD
public C3927bKy presenter;
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559917, viewGroup, false);
ButterKnife.c(this, inflate);
this.presenter.e((C3927bKy) this);
C3927bKy c3927bKy = this.presenter;
final OU e = ((BaseSetupScheduleFragment) this).c.e();
c3927bKy.a = e;
c3927bKy.d = null;
c3927bKy.b = true;
ZI.IeS ieS = new ZI.IeS(e) { // from class: o.bKG
private OU a;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3927bKy.c(this.a, (InterfaceC8942daP.LWm.RVV) obj);
}
{
this.a = e;
}
};
if (c3927bKy.f != 0) {
ieS.e(c3927bKy.f);
}
OffsetDateTime offsetDateTime = e.d.d;
while (true) {
offsetDateTime = offsetDateTime.plusDays(1L);
EnumC15515gsk dayOfWeek = offsetDateTime.getDayOfWeek();
if (!dayOfWeek.equals(EnumC15515gsk.SATURDAY) && !dayOfWeek.equals(EnumC15515gsk.SUNDAY)) {
break;
}
}
c3927bKy.d(offsetDateTime);
c3927bKy.e(e.a.c);
C3893bKA c3893bKA = new C3893bKA(c3927bKy);
if (c3927bKy.f != 0) {
c3893bKA.e(c3927bKy.f);
}
return inflate;
}
@Override // o.InterfaceC8942daP.LWm
public final void b() {
this.paymentDate.setOnSelectDateListener(new InterfaceC12869fJm(this) { // from class: o.fkD
private SetupScheduleOnceFragment b;
@Override // o.InterfaceC12869fJm
public final void b() {
C3927bKy c3927bKy = this.b.presenter;
if (c3927bKy.b) {
c3927bKy.b = false;
ZI.IeS ieS = new ZI.IeS(c3927bKy.a.d.d, c3927bKy.a.d.i.minusDays(1L), c3927bKy.a.d.a) { // from class: o.bKF
private OffsetDateTime b;
private OffsetDateTime d;
private OffsetDateTime e;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC8942daP.LWm.RVV) obj).b(this.e, this.b, this.d);
}
{
this.e = r1;
this.b = r2;
this.d = r3;
}
};
if (c3927bKy.f != 0) {
ieS.e(c3927bKy.f);
}
}
}
{
this.b = this;
}
});
this.paymentDate.setDateHint(getString(R.string.schedule_setup_once_select_date));
}
@Override // o.InterfaceC8942daP.LWm.RVV
public final void b(OffsetDateTime offsetDateTime, OffsetDateTime offsetDateTime2, OffsetDateTime offsetDateTime3) {
startActivityForResult(CalendarDialogActivity.alJ_(getContext(), 0, null, null, offsetDateTime2, offsetDateTime3, true, offsetDateTime, true), 0);
}
@Override // o.InterfaceC8942daP.LWm.RVV
public final void c(OffsetDateTime offsetDateTime) {
this.paymentDate.setDateField(cXG.VL_(getContext().getResources(), "dd MMM yyyy", offsetDateTime));
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
super.onDestroy();
this.presenter.w_();
}
/* renamed from: com.scb.phone.view.fragment.investment.schedule.SetupScheduleOnceFragment$3, reason: invalid class name */
/* loaded from: classes5.dex */
static /* synthetic */ class AnonymousClass3 {
static final int[] e;
static {
int[] iArr = new int[EnumC15203gjx.values().length];
e = iArr;
try {
iArr[EnumC15203gjx.REDEEM.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
e[EnumC15203gjx.PURCHASE.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
e[EnumC15203gjx.SWITCH.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
}
}
@Override // o.InterfaceC8942daP.LWm.RVV
public final void b(EnumC15203gjx enumC15203gjx) {
int i = AnonymousClass3.e[enumC15203gjx.ordinal()];
if (i == 1) {
this.paymentDate.setLabel(getString(R.string.payment_date_label));
} else if (i == 2) {
this.paymentDate.setLabel(getString(R.string.payment_date_label_purchase));
} else if (i == 3) {
this.paymentDate.setLabel(getString(R.string.payment_date_label_switch));
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
this.presenter.b = true;
if (i == 0 && i2 == -1) {
this.presenter.d((OffsetDateTime) intent.getSerializableExtra("com.scb.phone.EXTRA_DATE"));
}
}
@Override // com.scb.phone.view.fragment.investment.schedule.BaseSetupScheduleFragment
final String d() {
return "O";
}
}