package o;

import android.content.Context;
import android.view.View;
import android.view.Window;
import androidx.recyclerview.widget.LinearLayoutManager;
import java.util.Calendar;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class QN implements View.OnClickListener {
    public final /* synthetic */ int l;
    public final Object m;
    public final /* synthetic */ Object n;

    public /* synthetic */ QN(VN vn, com.google.android.material.datepicker.c cVar, int i) {
        this.l = i;
        this.n = vn;
        this.m = cVar;
    }

    @Override // android.view.View.OnClickListener
    public final void onClick(View view) {
        switch (this.l) {
            case 0:
                VN vn = (VN) this.n;
                int iK0 = ((LinearLayoutManager) vn.s.getLayoutManager()).K0() - 1;
                if (iK0 >= 0) {
                    Calendar calendarA = AbstractC1789li0.a(((com.google.android.material.datepicker.c) this.m).c.l.l);
                    calendarA.add(2, iK0);
                    vn.f(new TP(calendarA));
                    break;
                }
                break;
            case 1:
                VN vn2 = (VN) this.n;
                LinearLayoutManager linearLayoutManager = (LinearLayoutManager) vn2.s.getLayoutManager();
                View viewM0 = linearLayoutManager.M0(0, false, linearLayoutManager.v());
                int iH = (viewM0 == null ? -1 : AbstractC1157f10.H(viewM0)) + 1;
                if (iH < vn2.s.getAdapter().a()) {
                    Calendar calendarA2 = AbstractC1789li0.a(((com.google.android.material.datepicker.c) this.m).c.l.l);
                    calendarA2.add(2, iH);
                    vn2.f(new TP(calendarA2));
                    break;
                }
                break;
            default:
                Vf0 vf0 = (Vf0) this.n;
                Window.Callback callback = vf0.k;
                if (callback != null && vf0.l) {
                    callback.onMenuItemSelected(0, (C0869c1) this.m);
                    break;
                }
                break;
        }
    }

    public QN(Vf0 vf0) {
        this.l = 2;
        this.n = vf0;
        Context context = vf0.a.getContext();
        CharSequence charSequence = vf0.h;
        C0869c1 c0869c1 = new C0869c1();
        c0869c1.e = 4096;
        c0869c1.g = 4096;
        c0869c1.l = null;
        c0869c1.m = null;
        c0869c1.n = false;
        c0869c1.f467o = false;
        c0869c1.p = 16;
        c0869c1.i = context;
        c0869c1.a = charSequence;
        this.m = c0869c1;
    }
}
