package o;

import android.view.View;
import android.widget.AdapterView;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.o8, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2027o8 implements AdapterView.OnItemClickListener {
    public final /* synthetic */ int l;
    public final /* synthetic */ Object m;

    public /* synthetic */ C2027o8(int i, Object obj) {
        this.l = i;
        this.m = obj;
    }

    @Override // android.widget.AdapterView.OnItemClickListener
    public final void onItemClick(AdapterView adapterView, View view, int i, long j) {
        switch (this.l) {
            case 0:
                C2217q8 c2217q8 = (C2217q8) this.m;
                C2501t8 c2501t8 = c2217q8.R;
                c2501t8.setSelection(i);
                if (c2501t8.getOnItemClickListener() != null) {
                    c2501t8.performItemClick(view, i, c2217q8.O.getItemId(i));
                }
                c2217q8.dismiss();
                break;
            default:
                KN kn = (KN) this.m;
                UL ul = kn.p;
                KN.a(kn, i < 0 ? !ul.K.isShowing() ? null : ul.n.getSelectedItem() : kn.getAdapter().getItem(i));
                AdapterView.OnItemClickListener onItemClickListener = kn.getOnItemClickListener();
                if (onItemClickListener != null) {
                    if (view == null || i < 0) {
                        view = !ul.K.isShowing() ? null : ul.n.getSelectedView();
                        i = !ul.K.isShowing() ? -1 : ul.n.getSelectedItemPosition();
                        j = !ul.K.isShowing() ? Long.MIN_VALUE : ul.n.getSelectedItemId();
                    }
                    onItemClickListener.onItemClick(ul.n, view, i, j);
                }
                ul.dismiss();
                break;
        }
    }
}
