package androidx.appcompat.app; import android.R; import android.content.Context; import android.content.DialogInterface; import android.content.res.TypedArray; import android.database.Cursor; import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Message; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import android.view.ViewStub; import android.view.Window; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ImageView; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.TextView; import androidx.core.widget.NestedScrollView; import java.lang.ref.WeakReference; import o.JRt; import o.SYO; /* loaded from: classes.dex */ public final class AlertController { public CharSequence A; public ImageView B; public int C; public int D; public NestedScrollView E; public int F; public CharSequence G; public TextView H; public boolean I; public int J; public TextView K; public final Window L; public View N; private int P; final int b; public ListAdapter c; public Button d; public int e; public Drawable f; public CharSequence g; public Drawable h; public Button i; Message j; public Button k; Message l; public CharSequence m; /* renamed from: o, reason: collision with root package name */ public int f6365o; public Drawable p; public final Context r; Message s; public CharSequence t; Handler v; public Drawable w; public final JRt x; public View y; public ListView z; public boolean M = false; public int u = 0; public int q = -1; public int n = 0; public final View.OnClickListener a = new View.OnClickListener(this) { // from class: androidx.appcompat.app.AlertController.2 final AlertController c; { this.c = this; } @Override // android.view.View.OnClickListener public final void onClick(View view) { if (view == this.c.k) { Message message = this.c.s; } if (view == this.c.d) { Message message2 = this.c.j; } if (view == this.c.i) { Message message3 = this.c.l; } this.c.v.obtainMessage(1, this.c.x).sendToTarget(); } }; /* loaded from: classes.dex */ static final class RVV extends Handler { private WeakReference c; public RVV(DialogInterface dialogInterface) { this.c = new WeakReference<>(dialogInterface); } @Override // android.os.Handler public final void handleMessage(Message message) { int i = message.what; if (i == -3 || i == -2 || i == -1) { ((DialogInterface.OnClickListener) message.obj).onClick(this.c.get(), message.what); } else if (i == 1) { ((DialogInterface) message.obj).dismiss(); } } } public AlertController(Context context, JRt jRt, Window window) { this.r = context; this.x = jRt; this.L = window; this.v = new RVV(jRt); TypedArray obtainStyledAttributes = context.obtainStyledAttributes(null, SYO.ZqN.AlertDialog, SYO.IeS.alertDialogStyle, 0); this.e = obtainStyledAttributes.getResourceId(SYO.ZqN.AlertDialog_android_layout, 0); this.f6365o = obtainStyledAttributes.getResourceId(SYO.ZqN.AlertDialog_buttonPanelSideLayout, 0); this.D = obtainStyledAttributes.getResourceId(SYO.ZqN.AlertDialog_listLayout, 0); this.P = obtainStyledAttributes.getResourceId(SYO.ZqN.AlertDialog_multiChoiceItemLayout, 0); this.F = obtainStyledAttributes.getResourceId(SYO.ZqN.AlertDialog_singleChoiceItemLayout, 0); this.C = obtainStyledAttributes.getResourceId(SYO.ZqN.AlertDialog_listItemLayout, 0); this.I = obtainStyledAttributes.getBoolean(SYO.ZqN.AlertDialog_showTitle, true); this.b = obtainStyledAttributes.getDimensionPixelSize(SYO.ZqN.AlertDialog_buttonIconDimen, 0); obtainStyledAttributes.recycle(); jRt.b(1); } public static boolean a(View view) { if (view.onCheckIsTextEditor()) { return true; } if (!(view instanceof ViewGroup)) { return false; } ViewGroup viewGroup = (ViewGroup) view; int childCount = viewGroup.getChildCount(); while (childCount > 0) { childCount--; if (a(viewGroup.getChildAt(childCount))) { return true; } } return false; } public static ViewGroup bS_(View view, View view2) { if (view == null) { if (view2 instanceof ViewStub) { view2 = ((ViewStub) view2).inflate(); } return (ViewGroup) view2; } if (view2 != null) { ViewParent parent = view2.getParent(); if (parent instanceof ViewGroup) { ((ViewGroup) parent).removeView(view2); } } if (view instanceof ViewStub) { view = ((ViewStub) view).inflate(); } return (ViewGroup) view; } /* loaded from: classes.dex */ public static class RecycleListView extends ListView { private final int d; private final int e; public RecycleListView(Context context) { this(context, null); } public RecycleListView(Context context, AttributeSet attributeSet) { super(context, attributeSet); TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, SYO.ZqN.RecycleListView); this.e = obtainStyledAttributes.getDimensionPixelOffset(SYO.ZqN.RecycleListView_paddingBottomNoButtons, -1); this.d = obtainStyledAttributes.getDimensionPixelOffset(SYO.ZqN.RecycleListView_paddingTopNoTitle, -1); } public void setHasDecor(boolean z, boolean z2) { if (z2 && z) { return; } setPadding(getPaddingLeft(), z ? getPaddingTop() : this.d, getPaddingRight(), z2 ? getPaddingBottom() : this.e); } } /* loaded from: classes.dex */ public static class LWm { public int A; public View B; public CharSequence C; public Drawable D; public ListAdapter a; public Cursor d; public final Context e; public View f; public Drawable h; public final LayoutInflater j; public CharSequence[] k; public boolean l; public CharSequence m; public Drawable n; /* renamed from: o, reason: collision with root package name */ public boolean f6366o; public CharSequence p; public DialogInterface.OnMultiChoiceClickListener q; public Drawable r; public DialogInterface.OnCancelListener s; public CharSequence t; public DialogInterface.OnKeyListener u; public Sts v; public DialogInterface.OnDismissListener w; public DialogInterface.OnClickListener x; public AdapterView.OnItemSelectedListener y; public CharSequence z; public int i = 0; public int g = 0; public boolean G = false; public int b = -1; private boolean H = true; public boolean c = true; /* loaded from: classes.dex */ public interface Sts { } public LWm(Context context) { this.e = context; this.j = (LayoutInflater) context.getSystemService("layout_inflater"); } } /* loaded from: classes.dex */ public static class IeS extends ArrayAdapter { @Override // android.widget.ArrayAdapter, android.widget.Adapter public final long getItemId(int i) { return i; } @Override // android.widget.BaseAdapter, android.widget.Adapter public final boolean hasStableIds() { return true; } public IeS(Context context, int i, CharSequence[] charSequenceArr) { super(context, i, R.id.text1, charSequenceArr); } } }