package X6FRs_4.KQgRr5e_0.Nm6q_10;

import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ListAdapter;
import androidx.appcompat.app.AlertController;
/* compiled from: AlertDialog.java */
/* loaded from: classes.dex */
public class QxJ9d_1 extends X6FRs_4 implements DialogInterface {
    public final AlertController KQgRr5e_0;

    /* compiled from: AlertDialog.java */
    /* loaded from: classes.dex */
    public static class KQgRr5e_0 {
        public final int KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final AlertController.IFxWkV_5 f818KQgRr5e_0;

        public KQgRr5e_0(Context context) {
            this(context, QxJ9d_1.KQgRr5e_0(context, 0));
        }

        /* renamed from: KQgRr5e_0  reason: collision with other method in class */
        public Context m456KQgRr5e_0() {
            return this.f818KQgRr5e_0.f1856KQgRr5e_0;
        }

        public KQgRr5e_0 QxJ9d_1(CharSequence charSequence) {
            this.f818KQgRr5e_0.f1869KQgRr5e_0 = charSequence;
            return this;
        }

        public KQgRr5e_0(Context context, int i) {
            this.f818KQgRr5e_0 = new AlertController.IFxWkV_5(new ContextThemeWrapper(context, QxJ9d_1.KQgRr5e_0(context, i)));
            this.KQgRr5e_0 = i;
        }

        public KQgRr5e_0 KQgRr5e_0(View view) {
            this.f818KQgRr5e_0.f1865KQgRr5e_0 = view;
            return this;
        }

        public KQgRr5e_0 QxJ9d_1(CharSequence charSequence, DialogInterface.OnClickListener onClickListener) {
            AlertController.IFxWkV_5 iFxWkV_5 = this.f818KQgRr5e_0;
            iFxWkV_5.f1880PGPF6hQ_2 = charSequence;
            iFxWkV_5.f1858KQgRr5e_0 = onClickListener;
            return this;
        }

        public KQgRr5e_0 KQgRr5e_0(CharSequence charSequence) {
            this.f818KQgRr5e_0.f1885QxJ9d_1 = charSequence;
            return this;
        }

        public KQgRr5e_0 KQgRr5e_0(int i) {
            this.f818KQgRr5e_0.KQgRr5e_0 = i;
            return this;
        }

        public QxJ9d_1 QxJ9d_1() {
            QxJ9d_1 KQgRr5e_0 = KQgRr5e_0();
            KQgRr5e_0.show();
            return KQgRr5e_0;
        }

        public KQgRr5e_0 KQgRr5e_0(Drawable drawable) {
            this.f818KQgRr5e_0.f1863KQgRr5e_0 = drawable;
            return this;
        }

        public KQgRr5e_0 KQgRr5e_0(CharSequence charSequence, DialogInterface.OnClickListener onClickListener) {
            AlertController.IFxWkV_5 iFxWkV_5 = this.f818KQgRr5e_0;
            iFxWkV_5.f1876Mqv2r_3 = charSequence;
            iFxWkV_5.f1882QxJ9d_1 = onClickListener;
            return this;
        }

        public KQgRr5e_0 KQgRr5e_0(boolean z) {
            this.f818KQgRr5e_0.f1871KQgRr5e_0 = z;
            return this;
        }

        public KQgRr5e_0 KQgRr5e_0(DialogInterface.OnDismissListener onDismissListener) {
            this.f818KQgRr5e_0.f1859KQgRr5e_0 = onDismissListener;
            return this;
        }

        public KQgRr5e_0 KQgRr5e_0(DialogInterface.OnKeyListener onKeyListener) {
            this.f818KQgRr5e_0.f1860KQgRr5e_0 = onKeyListener;
            return this;
        }

        public KQgRr5e_0 KQgRr5e_0(ListAdapter listAdapter, DialogInterface.OnClickListener onClickListener) {
            AlertController.IFxWkV_5 iFxWkV_5 = this.f818KQgRr5e_0;
            iFxWkV_5.f1867KQgRr5e_0 = listAdapter;
            iFxWkV_5.f1874Mqv2r_3 = onClickListener;
            return this;
        }

        public QxJ9d_1 KQgRr5e_0() {
            QxJ9d_1 qxJ9d_1 = new QxJ9d_1(this.f818KQgRr5e_0.f1856KQgRr5e_0, this.KQgRr5e_0);
            this.f818KQgRr5e_0.KQgRr5e_0(qxJ9d_1.KQgRr5e_0);
            qxJ9d_1.setCancelable(this.f818KQgRr5e_0.f1871KQgRr5e_0);
            if (this.f818KQgRr5e_0.f1871KQgRr5e_0) {
                qxJ9d_1.setCanceledOnTouchOutside(true);
            }
            qxJ9d_1.setOnCancelListener(this.f818KQgRr5e_0.f1857KQgRr5e_0);
            qxJ9d_1.setOnDismissListener(this.f818KQgRr5e_0.f1859KQgRr5e_0);
            DialogInterface.OnKeyListener onKeyListener = this.f818KQgRr5e_0.f1860KQgRr5e_0;
            if (onKeyListener != null) {
                qxJ9d_1.setOnKeyListener(onKeyListener);
            }
            return qxJ9d_1;
        }
    }

    public QxJ9d_1(Context context, int i) {
        super(context, KQgRr5e_0(context, i));
        this.KQgRr5e_0 = new AlertController(getContext(), this, getWindow());
    }

    public static int KQgRr5e_0(Context context, int i) {
        if (((i >>> 24) & 255) >= 1) {
            return i;
        }
        TypedValue typedValue = new TypedValue();
        context.getTheme().resolveAttribute(X6FRs_4.KQgRr5e_0.KQgRr5e_0.alertDialogTheme, typedValue, true);
        return typedValue.resourceId;
    }

    @Override // X6FRs_4.KQgRr5e_0.Nm6q_10.X6FRs_4, android.app.Dialog
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.KQgRr5e_0.m825KQgRr5e_0();
    }

    @Override // android.app.Dialog, android.view.KeyEvent.Callback
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (this.KQgRr5e_0.KQgRr5e_0(i, keyEvent)) {
            return true;
        }
        return super.onKeyDown(i, keyEvent);
    }

    @Override // android.app.Dialog, android.view.KeyEvent.Callback
    public boolean onKeyUp(int i, KeyEvent keyEvent) {
        if (this.KQgRr5e_0.QxJ9d_1(i, keyEvent)) {
            return true;
        }
        return super.onKeyUp(i, keyEvent);
    }

    @Override // X6FRs_4.KQgRr5e_0.Nm6q_10.X6FRs_4, android.app.Dialog
    public void setTitle(CharSequence charSequence) {
        super.setTitle(charSequence);
        this.KQgRr5e_0.QxJ9d_1(charSequence);
    }
}
