696 lines
25 KiB
Java
696 lines
25 KiB
Java
package androidx.appcompat.widget;
|
|
|
|
import android.R;
|
|
import android.content.Context;
|
|
import android.content.res.ColorStateList;
|
|
import android.content.res.Resources;
|
|
import android.database.DataSetObserver;
|
|
import android.graphics.PorterDuff;
|
|
import android.graphics.Rect;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.os.Build;
|
|
import android.util.AttributeSet;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewTreeObserver;
|
|
import android.widget.AdapterView;
|
|
import android.widget.ListAdapter;
|
|
import android.widget.PopupWindow;
|
|
import android.widget.Spinner;
|
|
import android.widget.SpinnerAdapter;
|
|
import androidx.appcompat.R$attr;
|
|
import androidx.appcompat.content.res.AppCompatResources;
|
|
import androidx.core.view.TintableBackgroundView;
|
|
import androidx.core.view.ViewCompat;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class AppCompatSpinner extends Spinner implements TintableBackgroundView {
|
|
private static final int[] i = {R.attr.spinnerMode};
|
|
private final AppCompatBackgroundHelper a;
|
|
private final Context b;
|
|
private ForwardingListener c;
|
|
private SpinnerAdapter d;
|
|
private final boolean e;
|
|
DropdownPopup f;
|
|
int g;
|
|
final Rect h;
|
|
|
|
private static class DropDownAdapter implements ListAdapter, SpinnerAdapter {
|
|
private SpinnerAdapter a;
|
|
private ListAdapter b;
|
|
|
|
public DropDownAdapter(SpinnerAdapter spinnerAdapter, Resources.Theme theme) {
|
|
this.a = spinnerAdapter;
|
|
if (spinnerAdapter instanceof ListAdapter) {
|
|
this.b = (ListAdapter) spinnerAdapter;
|
|
}
|
|
if (theme != null) {
|
|
if (Build.VERSION.SDK_INT >= 23 && (spinnerAdapter instanceof android.widget.ThemedSpinnerAdapter)) {
|
|
android.widget.ThemedSpinnerAdapter themedSpinnerAdapter = (android.widget.ThemedSpinnerAdapter) spinnerAdapter;
|
|
if (themedSpinnerAdapter.getDropDownViewTheme() != theme) {
|
|
themedSpinnerAdapter.setDropDownViewTheme(theme);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (spinnerAdapter instanceof ThemedSpinnerAdapter) {
|
|
ThemedSpinnerAdapter themedSpinnerAdapter2 = (ThemedSpinnerAdapter) spinnerAdapter;
|
|
if (themedSpinnerAdapter2.getDropDownViewTheme() == null) {
|
|
themedSpinnerAdapter2.setDropDownViewTheme(theme);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.ListAdapter
|
|
public boolean areAllItemsEnabled() {
|
|
ListAdapter listAdapter = this.b;
|
|
if (listAdapter != null) {
|
|
return listAdapter.areAllItemsEnabled();
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public int getCount() {
|
|
SpinnerAdapter spinnerAdapter = this.a;
|
|
if (spinnerAdapter == null) {
|
|
return 0;
|
|
}
|
|
return spinnerAdapter.getCount();
|
|
}
|
|
|
|
@Override // android.widget.SpinnerAdapter
|
|
public View getDropDownView(int i, View view, ViewGroup viewGroup) {
|
|
SpinnerAdapter spinnerAdapter = this.a;
|
|
if (spinnerAdapter == null) {
|
|
return null;
|
|
}
|
|
return spinnerAdapter.getDropDownView(i, view, viewGroup);
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public Object getItem(int i) {
|
|
SpinnerAdapter spinnerAdapter = this.a;
|
|
if (spinnerAdapter == null) {
|
|
return null;
|
|
}
|
|
return spinnerAdapter.getItem(i);
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public long getItemId(int i) {
|
|
SpinnerAdapter spinnerAdapter = this.a;
|
|
if (spinnerAdapter == null) {
|
|
return -1L;
|
|
}
|
|
return spinnerAdapter.getItemId(i);
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public int getItemViewType(int i) {
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public View getView(int i, View view, ViewGroup viewGroup) {
|
|
return getDropDownView(i, view, viewGroup);
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public int getViewTypeCount() {
|
|
return 1;
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public boolean hasStableIds() {
|
|
SpinnerAdapter spinnerAdapter = this.a;
|
|
return spinnerAdapter != null && spinnerAdapter.hasStableIds();
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public boolean isEmpty() {
|
|
return getCount() == 0;
|
|
}
|
|
|
|
@Override // android.widget.ListAdapter
|
|
public boolean isEnabled(int i) {
|
|
ListAdapter listAdapter = this.b;
|
|
if (listAdapter != null) {
|
|
return listAdapter.isEnabled(i);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public void registerDataSetObserver(DataSetObserver dataSetObserver) {
|
|
SpinnerAdapter spinnerAdapter = this.a;
|
|
if (spinnerAdapter != null) {
|
|
spinnerAdapter.registerDataSetObserver(dataSetObserver);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public void unregisterDataSetObserver(DataSetObserver dataSetObserver) {
|
|
SpinnerAdapter spinnerAdapter = this.a;
|
|
if (spinnerAdapter != null) {
|
|
spinnerAdapter.unregisterDataSetObserver(dataSetObserver);
|
|
}
|
|
}
|
|
}
|
|
|
|
private class DropdownPopup extends ListPopupWindow {
|
|
private CharSequence J;
|
|
ListAdapter K;
|
|
private final Rect L;
|
|
|
|
public DropdownPopup(Context context, AttributeSet attributeSet, int i) {
|
|
super(context, attributeSet, i);
|
|
this.L = new Rect();
|
|
a(AppCompatSpinner.this);
|
|
a(true);
|
|
f(0);
|
|
a(new AdapterView.OnItemClickListener(AppCompatSpinner.this) { // from class: androidx.appcompat.widget.AppCompatSpinner.DropdownPopup.1
|
|
@Override // android.widget.AdapterView.OnItemClickListener
|
|
public void onItemClick(AdapterView<?> adapterView, View view, int i2, long j) {
|
|
AppCompatSpinner.this.setSelection(i2);
|
|
if (AppCompatSpinner.this.getOnItemClickListener() != null) {
|
|
DropdownPopup dropdownPopup = DropdownPopup.this;
|
|
AppCompatSpinner.this.performItemClick(view, i2, dropdownPopup.K.getItemId(i2));
|
|
}
|
|
DropdownPopup.this.dismiss();
|
|
}
|
|
});
|
|
}
|
|
|
|
boolean b(View view) {
|
|
return ViewCompat.w(view) && view.getGlobalVisibleRect(this.L);
|
|
}
|
|
|
|
void l() {
|
|
Drawable f = f();
|
|
int i = 0;
|
|
if (f != null) {
|
|
f.getPadding(AppCompatSpinner.this.h);
|
|
i = ViewUtils.a(AppCompatSpinner.this) ? AppCompatSpinner.this.h.right : -AppCompatSpinner.this.h.left;
|
|
} else {
|
|
Rect rect = AppCompatSpinner.this.h;
|
|
rect.right = 0;
|
|
rect.left = 0;
|
|
}
|
|
int paddingLeft = AppCompatSpinner.this.getPaddingLeft();
|
|
int paddingRight = AppCompatSpinner.this.getPaddingRight();
|
|
int width = AppCompatSpinner.this.getWidth();
|
|
AppCompatSpinner appCompatSpinner = AppCompatSpinner.this;
|
|
int i2 = appCompatSpinner.g;
|
|
if (i2 == -2) {
|
|
int a = appCompatSpinner.a((SpinnerAdapter) this.K, f());
|
|
int i3 = AppCompatSpinner.this.getContext().getResources().getDisplayMetrics().widthPixels;
|
|
Rect rect2 = AppCompatSpinner.this.h;
|
|
int i4 = (i3 - rect2.left) - rect2.right;
|
|
if (a > i4) {
|
|
a = i4;
|
|
}
|
|
b(Math.max(a, (width - paddingLeft) - paddingRight));
|
|
} else if (i2 == -1) {
|
|
b((width - paddingLeft) - paddingRight);
|
|
} else {
|
|
b(i2);
|
|
}
|
|
d(ViewUtils.a(AppCompatSpinner.this) ? i + ((width - paddingRight) - i()) : i + paddingLeft);
|
|
}
|
|
|
|
public CharSequence m() {
|
|
return this.J;
|
|
}
|
|
|
|
@Override // androidx.appcompat.widget.ListPopupWindow
|
|
public void a(ListAdapter listAdapter) {
|
|
super.a(listAdapter);
|
|
this.K = listAdapter;
|
|
}
|
|
|
|
public void a(CharSequence charSequence) {
|
|
this.J = charSequence;
|
|
}
|
|
|
|
@Override // androidx.appcompat.widget.ListPopupWindow, androidx.appcompat.view.menu.ShowableListMenu
|
|
public void a() {
|
|
ViewTreeObserver viewTreeObserver;
|
|
boolean c = c();
|
|
l();
|
|
e(2);
|
|
super.a();
|
|
d().setChoiceMode(1);
|
|
g(AppCompatSpinner.this.getSelectedItemPosition());
|
|
if (c || (viewTreeObserver = AppCompatSpinner.this.getViewTreeObserver()) == null) {
|
|
return;
|
|
}
|
|
final ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() { // from class: androidx.appcompat.widget.AppCompatSpinner.DropdownPopup.2
|
|
@Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
|
|
public void onGlobalLayout() {
|
|
DropdownPopup dropdownPopup = DropdownPopup.this;
|
|
if (!dropdownPopup.b(AppCompatSpinner.this)) {
|
|
DropdownPopup.this.dismiss();
|
|
} else {
|
|
DropdownPopup.this.l();
|
|
DropdownPopup.super.a();
|
|
}
|
|
}
|
|
};
|
|
viewTreeObserver.addOnGlobalLayoutListener(onGlobalLayoutListener);
|
|
a(new PopupWindow.OnDismissListener() { // from class: androidx.appcompat.widget.AppCompatSpinner.DropdownPopup.3
|
|
@Override // android.widget.PopupWindow.OnDismissListener
|
|
public void onDismiss() {
|
|
ViewTreeObserver viewTreeObserver2 = AppCompatSpinner.this.getViewTreeObserver();
|
|
if (viewTreeObserver2 != null) {
|
|
viewTreeObserver2.removeGlobalOnLayoutListener(onGlobalLayoutListener);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
public AppCompatSpinner(Context context, AttributeSet attributeSet) {
|
|
this(context, attributeSet, R$attr.spinnerStyle);
|
|
}
|
|
|
|
int a(SpinnerAdapter spinnerAdapter, Drawable drawable) {
|
|
int i2 = 0;
|
|
if (spinnerAdapter == null) {
|
|
return 0;
|
|
}
|
|
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), 0);
|
|
int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(getMeasuredHeight(), 0);
|
|
int max = Math.max(0, getSelectedItemPosition());
|
|
int min = Math.min(spinnerAdapter.getCount(), max + 15);
|
|
View view = null;
|
|
int i3 = 0;
|
|
for (int max2 = Math.max(0, max - (15 - (min - max))); max2 < min; max2++) {
|
|
int itemViewType = spinnerAdapter.getItemViewType(max2);
|
|
if (itemViewType != i2) {
|
|
view = null;
|
|
i2 = itemViewType;
|
|
}
|
|
view = spinnerAdapter.getView(max2, view, this);
|
|
if (view.getLayoutParams() == null) {
|
|
view.setLayoutParams(new ViewGroup.LayoutParams(-2, -2));
|
|
}
|
|
view.measure(makeMeasureSpec, makeMeasureSpec2);
|
|
i3 = Math.max(i3, view.getMeasuredWidth());
|
|
}
|
|
if (drawable == null) {
|
|
return i3;
|
|
}
|
|
drawable.getPadding(this.h);
|
|
Rect rect = this.h;
|
|
return i3 + rect.left + rect.right;
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
protected void drawableStateChanged() {
|
|
super.drawableStateChanged();
|
|
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
|
if (appCompatBackgroundHelper != null) {
|
|
appCompatBackgroundHelper.a();
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public int getDropDownHorizontalOffset() {
|
|
DropdownPopup dropdownPopup = this.f;
|
|
if (dropdownPopup != null) {
|
|
return dropdownPopup.g();
|
|
}
|
|
if (Build.VERSION.SDK_INT >= 16) {
|
|
return super.getDropDownHorizontalOffset();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public int getDropDownVerticalOffset() {
|
|
DropdownPopup dropdownPopup = this.f;
|
|
if (dropdownPopup != null) {
|
|
return dropdownPopup.h();
|
|
}
|
|
if (Build.VERSION.SDK_INT >= 16) {
|
|
return super.getDropDownVerticalOffset();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public int getDropDownWidth() {
|
|
if (this.f != null) {
|
|
return this.g;
|
|
}
|
|
if (Build.VERSION.SDK_INT >= 16) {
|
|
return super.getDropDownWidth();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public Drawable getPopupBackground() {
|
|
DropdownPopup dropdownPopup = this.f;
|
|
if (dropdownPopup != null) {
|
|
return dropdownPopup.f();
|
|
}
|
|
if (Build.VERSION.SDK_INT >= 16) {
|
|
return super.getPopupBackground();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public Context getPopupContext() {
|
|
if (this.f != null) {
|
|
return this.b;
|
|
}
|
|
if (Build.VERSION.SDK_INT >= 23) {
|
|
return super.getPopupContext();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public CharSequence getPrompt() {
|
|
DropdownPopup dropdownPopup = this.f;
|
|
return dropdownPopup != null ? dropdownPopup.m() : super.getPrompt();
|
|
}
|
|
|
|
@Override // androidx.core.view.TintableBackgroundView
|
|
public ColorStateList getSupportBackgroundTintList() {
|
|
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
|
if (appCompatBackgroundHelper != null) {
|
|
return appCompatBackgroundHelper.b();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // androidx.core.view.TintableBackgroundView
|
|
public PorterDuff.Mode getSupportBackgroundTintMode() {
|
|
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
|
if (appCompatBackgroundHelper != null) {
|
|
return appCompatBackgroundHelper.c();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // android.widget.Spinner, android.widget.AdapterView, android.view.ViewGroup, android.view.View
|
|
protected void onDetachedFromWindow() {
|
|
super.onDetachedFromWindow();
|
|
DropdownPopup dropdownPopup = this.f;
|
|
if (dropdownPopup == null || !dropdownPopup.c()) {
|
|
return;
|
|
}
|
|
this.f.dismiss();
|
|
}
|
|
|
|
@Override // android.widget.Spinner, android.widget.AbsSpinner, android.view.View
|
|
protected void onMeasure(int i2, int i3) {
|
|
super.onMeasure(i2, i3);
|
|
if (this.f == null || View.MeasureSpec.getMode(i2) != Integer.MIN_VALUE) {
|
|
return;
|
|
}
|
|
setMeasuredDimension(Math.min(Math.max(getMeasuredWidth(), a(getAdapter(), getBackground())), View.MeasureSpec.getSize(i2)), getMeasuredHeight());
|
|
}
|
|
|
|
@Override // android.widget.Spinner, android.view.View
|
|
public boolean onTouchEvent(MotionEvent motionEvent) {
|
|
ForwardingListener forwardingListener = this.c;
|
|
if (forwardingListener == null || !forwardingListener.onTouch(this, motionEvent)) {
|
|
return super.onTouchEvent(motionEvent);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // android.widget.Spinner, android.view.View
|
|
public boolean performClick() {
|
|
DropdownPopup dropdownPopup = this.f;
|
|
if (dropdownPopup == null) {
|
|
return super.performClick();
|
|
}
|
|
if (dropdownPopup.c()) {
|
|
return true;
|
|
}
|
|
this.f.a();
|
|
return true;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setBackgroundDrawable(Drawable drawable) {
|
|
super.setBackgroundDrawable(drawable);
|
|
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
|
if (appCompatBackgroundHelper != null) {
|
|
appCompatBackgroundHelper.a(drawable);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setBackgroundResource(int i2) {
|
|
super.setBackgroundResource(i2);
|
|
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
|
if (appCompatBackgroundHelper != null) {
|
|
appCompatBackgroundHelper.a(i2);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public void setDropDownHorizontalOffset(int i2) {
|
|
DropdownPopup dropdownPopup = this.f;
|
|
if (dropdownPopup != null) {
|
|
dropdownPopup.d(i2);
|
|
} else if (Build.VERSION.SDK_INT >= 16) {
|
|
super.setDropDownHorizontalOffset(i2);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public void setDropDownVerticalOffset(int i2) {
|
|
DropdownPopup dropdownPopup = this.f;
|
|
if (dropdownPopup != null) {
|
|
dropdownPopup.h(i2);
|
|
} else if (Build.VERSION.SDK_INT >= 16) {
|
|
super.setDropDownVerticalOffset(i2);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public void setDropDownWidth(int i2) {
|
|
if (this.f != null) {
|
|
this.g = i2;
|
|
} else if (Build.VERSION.SDK_INT >= 16) {
|
|
super.setDropDownWidth(i2);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public void setPopupBackgroundDrawable(Drawable drawable) {
|
|
DropdownPopup dropdownPopup = this.f;
|
|
if (dropdownPopup != null) {
|
|
dropdownPopup.a(drawable);
|
|
} else if (Build.VERSION.SDK_INT >= 16) {
|
|
super.setPopupBackgroundDrawable(drawable);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public void setPopupBackgroundResource(int i2) {
|
|
setPopupBackgroundDrawable(AppCompatResources.c(getPopupContext(), i2));
|
|
}
|
|
|
|
@Override // android.widget.Spinner
|
|
public void setPrompt(CharSequence charSequence) {
|
|
DropdownPopup dropdownPopup = this.f;
|
|
if (dropdownPopup != null) {
|
|
dropdownPopup.a(charSequence);
|
|
} else {
|
|
super.setPrompt(charSequence);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.core.view.TintableBackgroundView
|
|
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
|
|
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
|
if (appCompatBackgroundHelper != null) {
|
|
appCompatBackgroundHelper.b(colorStateList);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.core.view.TintableBackgroundView
|
|
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
|
|
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
|
|
if (appCompatBackgroundHelper != null) {
|
|
appCompatBackgroundHelper.a(mode);
|
|
}
|
|
}
|
|
|
|
public AppCompatSpinner(Context context, AttributeSet attributeSet, int i2) {
|
|
this(context, attributeSet, i2, -1);
|
|
}
|
|
|
|
@Override // android.widget.AdapterView
|
|
public void setAdapter(SpinnerAdapter spinnerAdapter) {
|
|
if (!this.e) {
|
|
this.d = spinnerAdapter;
|
|
return;
|
|
}
|
|
super.setAdapter(spinnerAdapter);
|
|
if (this.f != null) {
|
|
Context context = this.b;
|
|
if (context == null) {
|
|
context = getContext();
|
|
}
|
|
this.f.a(new DropDownAdapter(spinnerAdapter, context.getTheme()));
|
|
}
|
|
}
|
|
|
|
public AppCompatSpinner(Context context, AttributeSet attributeSet, int i2, int i3) {
|
|
this(context, attributeSet, i2, i3, null);
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:17:0x0056, code lost:
|
|
|
|
if (r12 != null) goto L22;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:18:0x0058, code lost:
|
|
|
|
r12.recycle();
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:21:0x006a, code lost:
|
|
|
|
if (r12 == null) goto L36;
|
|
*/
|
|
/* JADX WARN: Removed duplicated region for block: B:25:0x0070 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
public AppCompatSpinner(android.content.Context r8, android.util.AttributeSet r9, int r10, int r11, android.content.res.Resources.Theme r12) {
|
|
/*
|
|
r7 = this;
|
|
r7.<init>(r8, r9, r10)
|
|
android.graphics.Rect r0 = new android.graphics.Rect
|
|
r0.<init>()
|
|
r7.h = r0
|
|
int[] r0 = androidx.appcompat.R$styleable.Spinner
|
|
r1 = 0
|
|
androidx.appcompat.widget.TintTypedArray r0 = androidx.appcompat.widget.TintTypedArray.a(r8, r9, r0, r10, r1)
|
|
androidx.appcompat.widget.AppCompatBackgroundHelper r2 = new androidx.appcompat.widget.AppCompatBackgroundHelper
|
|
r2.<init>(r7)
|
|
r7.a = r2
|
|
r2 = 0
|
|
if (r12 == 0) goto L23
|
|
androidx.appcompat.view.ContextThemeWrapper r3 = new androidx.appcompat.view.ContextThemeWrapper
|
|
r3.<init>(r8, r12)
|
|
r7.b = r3
|
|
goto L3e
|
|
L23:
|
|
int r12 = androidx.appcompat.R$styleable.Spinner_popupTheme
|
|
int r12 = r0.g(r12, r1)
|
|
if (r12 == 0) goto L33
|
|
androidx.appcompat.view.ContextThemeWrapper r3 = new androidx.appcompat.view.ContextThemeWrapper
|
|
r3.<init>(r8, r12)
|
|
r7.b = r3
|
|
goto L3e
|
|
L33:
|
|
int r12 = android.os.Build.VERSION.SDK_INT
|
|
r3 = 23
|
|
if (r12 >= r3) goto L3b
|
|
r12 = r8
|
|
goto L3c
|
|
L3b:
|
|
r12 = r2
|
|
L3c:
|
|
r7.b = r12
|
|
L3e:
|
|
android.content.Context r12 = r7.b
|
|
r3 = 1
|
|
if (r12 == 0) goto Lac
|
|
r12 = -1
|
|
if (r11 != r12) goto L74
|
|
int[] r12 = androidx.appcompat.widget.AppCompatSpinner.i // Catch: java.lang.Throwable -> L5e java.lang.Exception -> L61
|
|
android.content.res.TypedArray r12 = r8.obtainStyledAttributes(r9, r12, r10, r1) // Catch: java.lang.Throwable -> L5e java.lang.Exception -> L61
|
|
boolean r4 = r12.hasValue(r1) // Catch: java.lang.Exception -> L5c java.lang.Throwable -> L6d
|
|
if (r4 == 0) goto L56
|
|
int r11 = r12.getInt(r1, r1) // Catch: java.lang.Exception -> L5c java.lang.Throwable -> L6d
|
|
L56:
|
|
if (r12 == 0) goto L74
|
|
L58:
|
|
r12.recycle()
|
|
goto L74
|
|
L5c:
|
|
r4 = move-exception
|
|
goto L63
|
|
L5e:
|
|
r8 = move-exception
|
|
r12 = r2
|
|
goto L6e
|
|
L61:
|
|
r4 = move-exception
|
|
r12 = r2
|
|
L63:
|
|
java.lang.String r5 = "AppCompatSpinner"
|
|
java.lang.String r6 = "Could not read android:spinnerMode"
|
|
android.util.Log.i(r5, r6, r4) // Catch: java.lang.Throwable -> L6d
|
|
if (r12 == 0) goto L74
|
|
goto L58
|
|
L6d:
|
|
r8 = move-exception
|
|
L6e:
|
|
if (r12 == 0) goto L73
|
|
r12.recycle()
|
|
L73:
|
|
throw r8
|
|
L74:
|
|
if (r11 != r3) goto Lac
|
|
androidx.appcompat.widget.AppCompatSpinner$DropdownPopup r11 = new androidx.appcompat.widget.AppCompatSpinner$DropdownPopup
|
|
android.content.Context r12 = r7.b
|
|
r11.<init>(r12, r9, r10)
|
|
android.content.Context r12 = r7.b
|
|
int[] r4 = androidx.appcompat.R$styleable.Spinner
|
|
androidx.appcompat.widget.TintTypedArray r12 = androidx.appcompat.widget.TintTypedArray.a(r12, r9, r4, r10, r1)
|
|
int r1 = androidx.appcompat.R$styleable.Spinner_android_dropDownWidth
|
|
r4 = -2
|
|
int r1 = r12.f(r1, r4)
|
|
r7.g = r1
|
|
int r1 = androidx.appcompat.R$styleable.Spinner_android_popupBackground
|
|
android.graphics.drawable.Drawable r1 = r12.b(r1)
|
|
r11.a(r1)
|
|
int r1 = androidx.appcompat.R$styleable.Spinner_android_prompt
|
|
java.lang.String r1 = r0.d(r1)
|
|
r11.a(r1)
|
|
r12.a()
|
|
r7.f = r11
|
|
androidx.appcompat.widget.AppCompatSpinner$1 r12 = new androidx.appcompat.widget.AppCompatSpinner$1
|
|
r12.<init>(r7)
|
|
r7.c = r12
|
|
Lac:
|
|
int r11 = androidx.appcompat.R$styleable.Spinner_android_entries
|
|
java.lang.CharSequence[] r11 = r0.f(r11)
|
|
if (r11 == 0) goto Lc4
|
|
android.widget.ArrayAdapter r12 = new android.widget.ArrayAdapter
|
|
r1 = 17367048(0x1090008, float:2.5162948E-38)
|
|
r12.<init>(r8, r1, r11)
|
|
int r8 = androidx.appcompat.R$layout.support_simple_spinner_dropdown_item
|
|
r12.setDropDownViewResource(r8)
|
|
r7.setAdapter(r12)
|
|
Lc4:
|
|
r0.a()
|
|
r7.e = r3
|
|
android.widget.SpinnerAdapter r8 = r7.d
|
|
if (r8 == 0) goto Ld2
|
|
r7.setAdapter(r8)
|
|
r7.d = r2
|
|
Ld2:
|
|
androidx.appcompat.widget.AppCompatBackgroundHelper r8 = r7.a
|
|
r8.a(r9, r10)
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.AppCompatSpinner.<init>(android.content.Context, android.util.AttributeSet, int, int, android.content.res.Resources$Theme):void");
|
|
}
|
|
}
|