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

152 lines
4.9 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.investment.schedule;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.NumberPicker;
import android.widget.TextView;
import androidx.fragment.app.DialogFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.fragment.investment.schedule.DayPickerDialog;
import java.lang.reflect.Field;
import o.OF;
import o.guQ;
/* loaded from: classes5.dex */
public class DayPickerDialog extends DialogFragment {
private RVV b;
private OF c;
@BindView
View clickableLeft;
@BindView
View clickableRight;
@BindView
NumberPicker numberPicker;
@BindView
TextView title;
/* loaded from: classes5.dex */
public interface RVV {
void a(int i);
}
public static DayPickerDialog e(OF of) {
Bundle bundle = new Bundle();
bundle.putParcelable("Display", of);
DayPickerDialog dayPickerDialog = new DayPickerDialog();
dayPickerDialog.setArguments(bundle);
return dayPickerDialog;
}
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setStyle(1, R.style.f53002132017553);
this.c = (OF) getArguments().getParcelable("Display");
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559410, viewGroup, false);
ButterKnife.c(this, inflate);
this.numberPicker.setMinValue(this.c.c);
this.numberPicker.setMaxValue(this.c.d);
if (this.c.b != null) {
this.numberPicker.setDisplayedValues(this.c.b);
}
if (!TextUtils.isEmpty(this.c.a)) {
this.title.setText(this.c.a);
}
this.numberPicker.setWrapSelectorWheel(true);
this.numberPicker.setDescendantFocusability(393216);
this.numberPicker.setOnClickListener(new View.OnClickListener(this) { // from class: o.fkv
private DayPickerDialog c;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
DayPickerDialog.e(this.c);
}
{
this.c = this;
}
});
for (Field field : NumberPicker.class.getDeclaredFields()) {
if (field.getName().equals("mSelectionDivider")) {
field.setAccessible(true);
try {
field.set(this.numberPicker, new ColorDrawable(-3355444));
} catch (Resources.NotFoundException | IllegalAccessException | IllegalArgumentException e) {
guQ.e(e);
}
}
}
this.clickableLeft.setOnClickListener(new View.OnClickListener(this) { // from class: o.fkr
private DayPickerDialog e;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
DayPickerDialog.b(this.e);
}
{
this.e = this;
}
});
this.clickableRight.setOnClickListener(new View.OnClickListener(this) { // from class: o.fku
private DayPickerDialog a;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
DayPickerDialog.c(this.a);
}
{
this.a = this;
}
});
return inflate;
}
/* JADX WARN: Multi-variable type inference failed */
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof RVV) {
this.b = (RVV) context;
} else {
if (getParentFragment() instanceof RVV) {
this.b = (RVV) getParentFragment();
return;
}
throw new ClassCastException();
}
}
public static /* synthetic */ void c(DayPickerDialog dayPickerDialog) {
dayPickerDialog.b.a(dayPickerDialog.numberPicker.getValue());
dayPickerDialog.dismiss();
}
public static /* synthetic */ void e(DayPickerDialog dayPickerDialog) {
dayPickerDialog.b.a(dayPickerDialog.numberPicker.getValue());
dayPickerDialog.dismiss();
}
public static /* synthetic */ void b(DayPickerDialog dayPickerDialog) {
dayPickerDialog.b.a(dayPickerDialog.numberPicker.getValue());
dayPickerDialog.dismiss();
}
}