package o; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.datepicker.MaterialCalendar; import java.util.Calendar; import java.util.Iterator; import java.util.Locale; import o.C17052tZT; /* loaded from: classes2.dex */ public final class onm extends RecyclerView.Sts { public final MaterialCalendar b; @Override // androidx.recyclerview.widget.RecyclerView.Sts public final /* synthetic */ void onBindViewHolder(RVV rvv, int i) { RVV rvv2 = rvv; int i2 = this.b.d.b.g + i; rvv2.d.setText(String.format(Locale.getDefault(), "%d", Integer.valueOf(i2))); rvv2.d.setContentDescription(C17195uiA.b(rvv2.d.getContext(), i2)); ERL erl = this.b.b; Calendar e = OnG.e(); C14391fsN c14391fsN = e.get(1) == i2 ? erl.h : erl.j; Iterator it = this.b.c.b().iterator(); while (it.hasNext()) { e.setTimeInMillis(it.next().longValue()); if (e.get(1) == i2) { c14391fsN = erl.e; } } c14391fsN.IQ_(rvv2.d); rvv2.d.setOnClickListener(new View.OnClickListener(this, i2) { // from class: o.onm.1 private int a; private onm d; { this.d = this; this.a = i2; } @Override // android.view.View.OnClickListener public final void onClick(View view) { UJG d = UJG.d(this.a, this.d.b.a.d); FOT fot = this.d.b.d; if (d.c.compareTo(fot.b.c) < 0) { d = fot.b; } else { if (d.c.compareTo(fot.a.c) > 0) { d = fot.a; } } this.d.b.e(d); this.d.b.d(MaterialCalendar.RVV.DAY); } }); } /* loaded from: classes2.dex */ public static class RVV extends RecyclerView.zJl { final TextView d; RVV(TextView textView) { super(textView); this.d = textView; } } public onm(MaterialCalendar materialCalendar) { this.b = materialCalendar; } @Override // androidx.recyclerview.widget.RecyclerView.Sts public final int getItemCount() { return this.b.d.h; } @Override // androidx.recyclerview.widget.RecyclerView.Sts public final /* synthetic */ RVV onCreateViewHolder(ViewGroup viewGroup, int i) { return new RVV((TextView) LayoutInflater.from(viewGroup.getContext()).inflate(C17052tZT.tOB.mtrl_calendar_year, viewGroup, false)); } }