package defpackage;

import android.R;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.view.ContextThemeWrapper;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.TextView;
import androidx.appcompat.app.AlertController$RecycleListView;

/* JADX INFO: renamed from: ˏᵖ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public class C1868 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final int f7402;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final C3223 f7403;

    public C1868(Context context) {
        this(context, DialogInterfaceC3504.m8004(context, 0));
    }

    public C1868(Context context, int i) {
        this.f7403 = new C3223(new ContextThemeWrapper(context, DialogInterfaceC3504.m8004(context, i)));
        this.f7402 = i;
    }

    public DialogInterfaceC3504 create() {
        ListAdapter c1477;
        C3223 c3223 = this.f7403;
        ContextThemeWrapper contextThemeWrapper = c3223.f12276;
        ContextThemeWrapper contextThemeWrapper2 = c3223.f12276;
        DialogInterfaceC3504 dialogInterfaceC3504 = new DialogInterfaceC3504(contextThemeWrapper, this.f7402);
        View view = c3223.f12271;
        C3208 c3208 = dialogInterfaceC3504.f13463;
        if (view != null) {
            c3208.f12210 = view;
        } else {
            CharSequence charSequence = c3223.f12279;
            if (charSequence != null) {
                c3208.f12225 = charSequence;
                TextView textView = c3208.f12201;
                if (textView != null) {
                    textView.setText(charSequence);
                }
                c3208.f12207.setTitle(charSequence);
            }
            Drawable drawable = c3223.f12268;
            if (drawable != null) {
                c3208.f12199 = drawable;
                ImageView imageView = c3208.f12206;
                if (imageView != null) {
                    imageView.setVisibility(0);
                    c3208.f12206.setImageDrawable(drawable);
                }
            }
        }
        CharSequence charSequence2 = c3223.f12281;
        if (charSequence2 != null) {
            c3208.f12214 = charSequence2;
            TextView textView2 = c3208.f12204;
            if (textView2 != null) {
                textView2.setText(charSequence2);
            }
        }
        CharSequence charSequence3 = c3223.f12277;
        if (charSequence3 != null) {
            c3208.m7343(-1, charSequence3, c3223.f12265);
        }
        CharSequence charSequence4 = c3223.f12280;
        if (charSequence4 != null) {
            c3208.m7343(-2, charSequence4, c3223.f12275);
        }
        if (c3223.f12273 != null || c3223.f12269 != null) {
            AlertController$RecycleListView alertController$RecycleListView = (AlertController$RecycleListView) c3223.f12262.inflate(c3208.f12223, (ViewGroup) null);
            if (c3223.f12274) {
                c1477 = new C1350(c3223, contextThemeWrapper2, c3208.f12198, c3223.f12273, alertController$RecycleListView);
            } else {
                int i = c3223.f12264 ? c3208.f12205 : c3208.f12226;
                c1477 = c3223.f12269;
                if (c1477 == null) {
                    c1477 = new C1477(contextThemeWrapper2, i, R.id.text1, c3223.f12273);
                }
            }
            c3208.f12209 = c1477;
            c3208.f12215 = c3223.f12263;
            if (c3223.f12266 != null) {
                alertController$RecycleListView.setOnItemClickListener(new C1335(c3223, c3208));
            } else if (c3223.f12267 != null) {
                alertController$RecycleListView.setOnItemClickListener(new C2970(c3223, alertController$RecycleListView, c3208));
            }
            if (c3223.f12264) {
                alertController$RecycleListView.setChoiceMode(1);
            } else if (c3223.f12274) {
                alertController$RecycleListView.setChoiceMode(2);
            }
            c3208.f12228 = alertController$RecycleListView;
        }
        View view2 = c3223.f12272;
        if (view2 != null) {
            c3208.f12222 = view2;
            c3208.f12202 = false;
        }
        dialogInterfaceC3504.setCancelable(true);
        dialogInterfaceC3504.setCanceledOnTouchOutside(true);
        dialogInterfaceC3504.setOnCancelListener(null);
        dialogInterfaceC3504.setOnDismissListener(null);
        DialogInterfaceOnKeyListenerC4936 dialogInterfaceOnKeyListenerC4936 = c3223.f12278;
        if (dialogInterfaceOnKeyListenerC4936 != null) {
            dialogInterfaceC3504.setOnKeyListener(dialogInterfaceOnKeyListenerC4936);
        }
        return dialogInterfaceC3504;
    }

    public Context getContext() {
        return this.f7403.f12276;
    }

    public C1868 setNegativeButton(int i, DialogInterface.OnClickListener onClickListener) {
        C3223 c3223 = this.f7403;
        c3223.f12280 = c3223.f12276.getText(i);
        c3223.f12275 = onClickListener;
        return this;
    }

    public C1868 setPositiveButton(int i, DialogInterface.OnClickListener onClickListener) {
        C3223 c3223 = this.f7403;
        c3223.f12277 = c3223.f12276.getText(i);
        c3223.f12265 = onClickListener;
        return this;
    }

    public C1868 setTitle(CharSequence charSequence) {
        this.f7403.f12279 = charSequence;
        return this;
    }

    public C1868 setView(View view) {
        this.f7403.f12272 = view;
        return this;
    }
}
