what-the-bank/sources/o/ZBO.java

77 lines
2.2 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.Calendar;
import java.util.Locale;
import java.util.TimeZone;
import o.C17052tZT;
/* loaded from: classes2.dex */
public final class ZBO extends BaseAdapter {
private static final int e = 4;
private final Calendar a;
private final int b;
private final int c;
@Override // android.widget.Adapter
public final long getItemId(int i) {
return 0L;
}
@Override // android.widget.Adapter
public final /* synthetic */ Object getItem(int i) {
int i2 = this.c;
if (i >= i2) {
return null;
}
int i3 = i + this.b;
if (i3 > i2) {
i3 -= i2;
}
return Integer.valueOf(i3);
}
public ZBO() {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
calendar.clear();
this.a = calendar;
this.c = calendar.getMaximum(7);
this.b = calendar.getFirstDayOfWeek();
}
public ZBO(int i) {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
calendar.clear();
this.a = calendar;
this.c = calendar.getMaximum(7);
this.b = i;
}
@Override // android.widget.Adapter
public final View getView(int i, View view, ViewGroup viewGroup) {
TextView textView = (TextView) view;
if (view == null) {
textView = (TextView) LayoutInflater.from(viewGroup.getContext()).inflate(C17052tZT.tOB.mtrl_calendar_day_of_week, viewGroup, false);
}
Calendar calendar = this.a;
int i2 = i + this.b;
int i3 = this.c;
if (i2 > i3) {
i2 -= i3;
}
calendar.set(7, i2);
textView.setText(this.a.getDisplayName(7, e, textView.getResources().getConfiguration().locale));
textView.setContentDescription(String.format(viewGroup.getContext().getString(C17052tZT.ojQ.mtrl_picker_day_of_week_column_header), this.a.getDisplayName(7, 2, Locale.getDefault())));
return textView;
}
@Override // android.widget.Adapter
public final int getCount() {
return this.c;
}
}