package o;

import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.widget.ListAdapter;
import androidx.appcompat.app.AlertController$RecycleListView;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.m8, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class DialogInterfaceOnClickListenerC1837m8 implements InterfaceC2406s8, DialogInterface.OnClickListener {
    public DialogInterfaceC1350h2 l;
    public C1932n8 m;
    public CharSequence n;

    /* renamed from: o, reason: collision with root package name */
    public final /* synthetic */ C2501t8 f631o;

    public DialogInterfaceOnClickListenerC1837m8(C2501t8 c2501t8) {
        this.f631o = c2501t8;
    }

    @Override // o.InterfaceC2406s8
    public final boolean b() {
        DialogInterfaceC1350h2 dialogInterfaceC1350h2 = this.l;
        if (dialogInterfaceC1350h2 != null) {
            return dialogInterfaceC1350h2.isShowing();
        }
        return false;
    }

    @Override // o.InterfaceC2406s8
    public final int c() {
        return 0;
    }

    @Override // o.InterfaceC2406s8
    public final void dismiss() {
        DialogInterfaceC1350h2 dialogInterfaceC1350h2 = this.l;
        if (dialogInterfaceC1350h2 != null) {
            dialogInterfaceC1350h2.dismiss();
            this.l = null;
        }
    }

    @Override // o.InterfaceC2406s8
    public final Drawable g() {
        return null;
    }

    @Override // o.InterfaceC2406s8
    public final void i(CharSequence charSequence) {
        this.n = charSequence;
    }

    @Override // o.InterfaceC2406s8
    public final void n(int i, int i2) {
        if (this.m == null) {
            return;
        }
        C2501t8 c2501t8 = this.f631o;
        C1254g2 c1254g2 = new C1254g2(c2501t8.getPopupContext());
        C0871c2 c0871c2 = (C0871c2) c1254g2.n;
        CharSequence charSequence = this.n;
        if (charSequence != null) {
            c0871c2.d = charSequence;
        }
        C1932n8 c1932n8 = this.m;
        int selectedItemPosition = c2501t8.getSelectedItemPosition();
        c0871c2.m = c1932n8;
        c0871c2.n = this;
        c0871c2.p = selectedItemPosition;
        c0871c2.f468o = true;
        DialogInterfaceC1350h2 dialogInterfaceC1350h2E = c1254g2.e();
        this.l = dialogInterfaceC1350h2E;
        AlertController$RecycleListView alertController$RecycleListView = dialogInterfaceC1350h2E.r.f;
        alertController$RecycleListView.setTextDirection(i);
        alertController$RecycleListView.setTextAlignment(i2);
        this.l.show();
    }

    @Override // o.InterfaceC2406s8
    public final int o() {
        return 0;
    }

    @Override // android.content.DialogInterface.OnClickListener
    public final void onClick(DialogInterface dialogInterface, int i) {
        C2501t8 c2501t8 = this.f631o;
        c2501t8.setSelection(i);
        if (c2501t8.getOnItemClickListener() != null) {
            c2501t8.performItemClick(null, i, this.m.getItemId(i));
        }
        dismiss();
    }

    @Override // o.InterfaceC2406s8
    public final CharSequence p() {
        return this.n;
    }

    @Override // o.InterfaceC2406s8
    public final void q(ListAdapter listAdapter) {
        this.m = (C1932n8) listAdapter;
    }

    @Override // o.InterfaceC2406s8
    public final void j(Drawable drawable) {
    }

    @Override // o.InterfaceC2406s8
    public final void k(int i) {
    }

    @Override // o.InterfaceC2406s8
    public final void l(int i) {
    }

    @Override // o.InterfaceC2406s8
    public final void m(int i) {
    }
}
