package com.scb.phone.view.fragment.scheduledtransaction; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.NumberPicker; import android.widget.TextView; 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.scheduledtransaction.ScheduleMonthlyFragment; import java.lang.reflect.Field; import o.DialogInterfaceC17187ufv; import o.InterfaceC12869fJm; import o.InterfaceC8931daE; import o.VN; import o.cXG; import o.fIV; import o.guQ; import org.threeten.bp.OffsetDateTime; /* loaded from: classes5.dex */ public class ScheduleMonthlyFragment extends Hilt_ScheduleMonthlyFragment { private boolean c = false; private DialogInterfaceC17187ufv d; @BindView ScheduleDate endDate; @BindView ScheduleDate everyDate; private OffsetDateTime g; private InterfaceC8931daE h; private NumberPicker i; private OffsetDateTime j; @BindView ScheduleDate startDate; @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559901, viewGroup, false); ButterKnife.c(this, inflate); this.j = this.h.e().d.plusDays(1L); this.startDate.setLabel(getString(R.string.schedule_setup_007)); this.startDate.setDateField(this.h.e().b); this.startDate.setOnSelectDateListener(new InterfaceC12869fJm(this) { // from class: o.fzY private ScheduleMonthlyFragment e; @Override // o.InterfaceC12869fJm public final void b() { this.e.a(1); } { this.e = this; } }); this.endDate.setLabel(getString(R.string.schedule_setup_008)); this.endDate.setOnSelectDateListener(new InterfaceC12869fJm(this) { // from class: o.fzX private ScheduleMonthlyFragment e; @Override // o.InterfaceC12869fJm public final void b() { this.e.a(2); } { this.e = this; } }); this.everyDate.setLabel(getString(R.string.schedule_setup_010)); this.everyDate.setOnMakePaymentEveryListener(new fIV(this) { // from class: o.fzV private ScheduleMonthlyFragment a; @Override // o.fIV public final void c() { ScheduleMonthlyFragment.a(this.a); } { this.a = this; } }); this.everyDate.setCalendarButtonVisible(8); this.everyDate.setDateFieldVisible(8); this.everyDate.setArrowIconVisible(0); this.everyDate.setPaymentFieldVisible(0); return inflate; } /* JADX INFO: Access modifiers changed from: private */ public void a(int i) { if (this.c) { return; } this.c = true; OffsetDateTime offsetDateTime = this.h.e().i; OffsetDateTime offsetDateTime2 = this.h.e().a; OffsetDateTime offsetDateTime3 = this.h.e().d; if (i == 1) { startActivityForResult(CalendarDialogActivity.alH_(getContext(), 1, this.j, null, offsetDateTime, offsetDateTime2, offsetDateTime3), 1); } else if (i == 2) { startActivityForResult(CalendarDialogActivity.alH_(getContext(), 2, this.j, this.g, offsetDateTime, offsetDateTime2, offsetDateTime3), 2); } } /* JADX INFO: Access modifiers changed from: private */ public void d() { if (this.i != null) { if (!this.endDate.dateField.getText().toString().isEmpty()) { this.h.b(true); this.h.d(new VN("M", this.j.toString(), this.g.toString(), String.valueOf(this.i.getValue())), "M"); } this.everyDate.setPaymentField(String.valueOf(this.i.getValue())); DialogInterfaceC17187ufv dialogInterfaceC17187ufv = this.d; if (dialogInterfaceC17187ufv != null) { dialogInterfaceC17187ufv.dismiss(); } } } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onActivityResult(int i, int i2, Intent intent) { this.c = false; if (i2 == -1) { if (i != 1) { if (i == 2) { this.g = (OffsetDateTime) intent.getSerializableExtra("com.scb.phone.EXTRA_DATE"); ScheduleDate scheduleDate = this.endDate; Context requireContext = requireContext(); scheduleDate.setDateField(cXG.VL_(requireContext.getResources(), "dd MMM yyyy", this.g)); this.everyDate.setPaymentField(""); this.h.b(false); return; } return; } this.j = (OffsetDateTime) intent.getSerializableExtra("com.scb.phone.EXTRA_DATE"); ScheduleDate scheduleDate2 = this.startDate; Context requireContext2 = requireContext(); scheduleDate2.setDateField(cXG.VL_(requireContext2.getResources(), "dd MMM yyyy", this.j)); this.endDate.setDateField(""); this.g = null; this.everyDate.setPaymentField(""); this.h.b(false); } } /* JADX WARN: Multi-variable type inference failed */ @Override // com.scb.phone.view.fragment.scheduledtransaction.Hilt_ScheduleMonthlyFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment public void onAttach(Context context) { super.onAttach(context); if (this.h == null) { if (context instanceof InterfaceC8931daE) { this.h = (InterfaceC8931daE) context; } else { if (getParentFragment() instanceof InterfaceC8931daE) { this.h = (InterfaceC8931daE) getParentFragment(); return; } throw new ClassCastException(); } } } @Override // androidx.fragment.app.Fragment public void onDetach() { super.onDetach(); this.h = null; } public static /* synthetic */ void a(final ScheduleMonthlyFragment scheduleMonthlyFragment) { DialogInterfaceC17187ufv.HBt hBt = new DialogInterfaceC17187ufv.HBt(scheduleMonthlyFragment.requireContext()); View inflate = LayoutInflater.from(scheduleMonthlyFragment.getContext()).inflate(R.layout.2131560021, (ViewGroup) null); View findViewById = inflate.findViewById(R.id.view_clickable_left); View findViewById2 = inflate.findViewById(R.id.view_clickable_right); scheduleMonthlyFragment.i = (NumberPicker) inflate.findViewById(R.id.number_picker); TextView textView = new TextView(scheduleMonthlyFragment.getContext()); textView.setText(scheduleMonthlyFragment.getString(R.string.schedule_setup_011)); textView.setPadding(0, 40, 0, 16); textView.setGravity(17); textView.setTextColor(-16777216); hBt.b.f = textView; NumberPicker numberPicker = scheduleMonthlyFragment.i; numberPicker.setMinValue(1); numberPicker.setMaxValue(31); numberPicker.setWrapSelectorWheel(true); numberPicker.setDescendantFocusability(393216); numberPicker.setOnClickListener(new View.OnClickListener(scheduleMonthlyFragment) { // from class: o.fzT private ScheduleMonthlyFragment e; @Override // android.view.View.OnClickListener public final void onClick(View view) { this.e.d(); } { this.e = scheduleMonthlyFragment; } }); for (Field field : NumberPicker.class.getDeclaredFields()) { if (field.getName().equals("mSelectionDivider")) { field.setAccessible(true); try { field.set(numberPicker, new ColorDrawable(-3355444)); } catch (Resources.NotFoundException | IllegalAccessException | IllegalArgumentException e) { guQ.e(e); } } } hBt.b.B = inflate; hBt.b.A = 0; hBt.b.G = false; scheduleMonthlyFragment.d = hBt.b(); findViewById.setOnClickListener(new View.OnClickListener(scheduleMonthlyFragment) { // from class: o.fzO private ScheduleMonthlyFragment b; @Override // android.view.View.OnClickListener public final void onClick(View view) { this.b.d(); } { this.b = scheduleMonthlyFragment; } }); findViewById2.setOnClickListener(new View.OnClickListener(scheduleMonthlyFragment) { // from class: o.fzU private ScheduleMonthlyFragment a; @Override // android.view.View.OnClickListener public final void onClick(View view) { this.a.d(); } { this.a = scheduleMonthlyFragment; } }); scheduleMonthlyFragment.d.show(); } }