package com.google.android.material.datepicker; import android.os.Build; 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; /* loaded from: classes2.dex */ class h extends BaseAdapter { /* renamed from: d, reason: collision with root package name */ private static final int f4490d; /* renamed from: a, reason: collision with root package name */ private final Calendar f4491a; /* renamed from: b, reason: collision with root package name */ private final int f4492b; /* renamed from: c, reason: collision with root package name */ private final int f4493c; static { f4490d = Build.VERSION.SDK_INT >= 26 ? 4 : 1; } public h() { Calendar k10 = u.k(); this.f4491a = k10; this.f4492b = k10.getMaximum(7); this.f4493c = k10.getFirstDayOfWeek(); } private int b(int i10) { int i11 = i10 + this.f4493c; int i12 = this.f4492b; return i11 > i12 ? i11 - i12 : i11; } @Override // android.widget.Adapter /* renamed from: a, reason: merged with bridge method [inline-methods] */ public Integer getItem(int i10) { if (i10 >= this.f4492b) { return null; } return Integer.valueOf(b(i10)); } @Override // android.widget.Adapter public int getCount() { return this.f4492b; } @Override // android.widget.Adapter public long getItemId(int i10) { return 0L; } @Override // android.widget.Adapter public View getView(int i10, View view, ViewGroup viewGroup) { TextView textView = (TextView) view; if (view == null) { textView = (TextView) LayoutInflater.from(viewGroup.getContext()).inflate(c3.g.f3529e, viewGroup, false); } this.f4491a.set(7, b(i10)); textView.setText(this.f4491a.getDisplayName(7, f4490d, Locale.getDefault())); textView.setContentDescription(String.format(viewGroup.getContext().getString(c3.h.f3544i), this.f4491a.getDisplayName(7, 2, Locale.getDefault()))); return textView; } }