package o;

import android.icu.text.DateFormat;
import android.icu.text.DisplayContext;
import android.icu.util.TimeZone;
import android.view.View;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.button.MaterialButton;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicReference;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class UN extends AbstractC1445i10 {
    public final /* synthetic */ com.google.android.material.datepicker.c a;
    public final /* synthetic */ MaterialButton b;
    public final /* synthetic */ VN c;

    public UN(VN vn, com.google.android.material.datepicker.c cVar, MaterialButton materialButton) {
        this.c = vn;
        this.a = cVar;
        this.b = materialButton;
    }

    @Override // o.AbstractC1445i10
    public final void a(RecyclerView recyclerView, int i) {
        if (i == 0) {
            recyclerView.announceForAccessibility(this.b.getText());
        }
    }

    @Override // o.AbstractC1445i10
    public final void b(RecyclerView recyclerView, int i, int i2) {
        int iK0;
        C0576Wf c0576Wf = this.a.c;
        VN vn = this.c;
        if (i < 0) {
            LinearLayoutManager linearLayoutManager = (LinearLayoutManager) vn.s.getLayoutManager();
            View viewM0 = linearLayoutManager.M0(0, false, linearLayoutManager.v());
            iK0 = viewM0 == null ? -1 : AbstractC1157f10.H(viewM0);
        } else {
            iK0 = ((LinearLayoutManager) vn.s.getLayoutManager()).K0();
        }
        Calendar calendarA = AbstractC1789li0.a(c0576Wf.l.l);
        calendarA.add(2, iK0);
        vn.f374o = new TP(calendarA);
        Calendar calendarA2 = AbstractC1789li0.a(c0576Wf.l.l);
        calendarA2.add(2, iK0);
        calendarA2.set(5, 1);
        Calendar calendarA3 = AbstractC1789li0.a(calendarA2);
        calendarA3.get(2);
        calendarA3.get(1);
        calendarA3.getMaximum(7);
        calendarA3.getActualMaximum(5);
        calendarA3.getTimeInMillis();
        long timeInMillis = calendarA3.getTimeInMillis();
        Locale locale = Locale.getDefault();
        AtomicReference atomicReference = AbstractC1789li0.a;
        DateFormat instanceForSkeleton = DateFormat.getInstanceForSkeleton("yMMMM", locale);
        instanceForSkeleton.setTimeZone(TimeZone.getTimeZone("UTC"));
        instanceForSkeleton.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
        this.b.setText(instanceForSkeleton.format(new Date(timeInMillis)));
    }
}
