CrackMe.apk
Download file
package androidx.appcompat.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.database.DataSetObserver;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Handler;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.PopupWindow;
import androidx.appcompat.R;
import androidx.appcompat.view.menu.ShowableListMenu;
import androidx.core.view.ViewCompat;
import androidx.core.widget.PopupWindowCompat;
import java.lang.reflect.Method;
public class ListPopupWindow implements ShowableListMenu {
private static final boolean DEBUG = false;
static final int EXPAND_LIST_TIMEOUT = 250;
public static final int INPUT_METHOD_FROM_FOCUSABLE = 0;
public static final int INPUT_METHOD_NEEDED = 1;
public static final int INPUT_METHOD_NOT_NEEDED = 2;
public static final int MATCH_PARENT = -1;
public static final int POSITION_PROMPT_ABOVE = 0;
public static final int POSITION_PROMPT_BELOW = 1;
private static final String TAG = "ListPopupWindow";
public static final int WRAP_CONTENT = -2;
private static Method sGetMaxAvailableHeightMethod;
private static Method sSetClipToWindowEnabledMethod;
private static Method sSetEpicenterBoundsMethod;
private ListAdapter mAdapter;
private Context mContext;
private boolean mDropDownAlwaysVisible;
private View mDropDownAnchorView;
private int mDropDownGravity;
private int mDropDownHeight;
private int mDropDownHorizontalOffset;
DropDownListView mDropDownList;
private Drawable mDropDownListHighlight;
private int mDropDownVerticalOffset;
private boolean mDropDownVerticalOffsetSet;
private int mDropDownWidth;
private int mDropDownWindowLayoutType;
private Rect mEpicenterBounds;
private boolean mForceIgnoreOutsideTouch;
final Handler mHandler;
private final ListSelectorHider mHideSelector;
private AdapterView.OnItemClickListener mItemClickListener;
private AdapterView.OnItemSelectedListener mItemSelectedListener;
int mListItemExpandMaximum;
private boolean mModal;
private DataSetObserver mObserver;
private boolean mOverlapAnchor;
private boolean mOverlapAnchorSet;
PopupWindow mPopup;
private int mPromptPosition;
private View mPromptView;
final ResizePopupRunnable mResizePopupRunnable;
private final PopupScrollListener mScrollListener;
private Runnable mShowDropDownRunnable;
private final Rect mTempRect;
private final PopupTouchInterceptor mTouchInterceptor;
private static boolean isConfirmKey(int i) {
return i == 66 || i == 23;
}
static {
if (Build.VERSION.SDK_INT <= 28) {
Class<PopupWindow> cls = PopupWindow.class;
try {
sSetClipToWindowEnabledMethod = cls.getDeclaredMethod("setClipToScreenEnabled", new Class[]{Boolean.TYPE});
} catch (NoSuchMethodException unused) {
Log.i(TAG, "Could not find method setClipToScreenEnabled() on PopupWindow. Oh well.");
}
try {
sSetEpicenterBoundsMethod = PopupWindow.class.getDeclaredMethod("setEpicenterBounds", new Class[]{Rect.class});
} catch (NoSuchMethodException unused2) {
Log.i(TAG, "Could not find method setEpicenterBounds(Rect) on PopupWindow. Oh well.");
}
}
if (Build.VERSION.SDK_INT <= 23) {
Class<PopupWindow> cls2 = PopupWindow.class;
try {
sGetMaxAvailableHeightMethod = cls2.getDeclaredMethod("getMaxAvailableHeight", new Class[]{View.class, Integer.TYPE, Boolean.TYPE});
} catch (NoSuchMethodException unused3) {
Log.i(TAG, "Could not find method getMaxAvailableHeight(View, int, boolean) on PopupWindow. Oh well.");
}
}
}
public ListPopupWindow(Context context) {
this(context, (AttributeSet) null, R.attr.listPopupWindowStyle);
}
public ListPopupWindow(Context context, AttributeSet attributeSet) {
this(context, attributeSet, R.attr.listPopupWindowStyle);
}
public ListPopupWindow(Context context, AttributeSet attributeSet, int i) {
this(context, attributeSet, i, 0);
}
public ListPopupWindow(Context context, AttributeSet attributeSet, int i, int i2) {
this.mDropDownHeight = -2;
this.mDropDownWidth = -2;
this.mDropDownWindowLayoutType = 1002;
this.mDropDownGravity = 0;
this.mDropDownAlwaysVisible = false;
this.mForceIgnoreOutsideTouch = false;
this.mListItemExpandMaximum = Integer.MAX_VALUE;
this.mPromptPosition = 0;
this.mResizePopupRunnable = new ResizePopupRunnable();
this.mTouchInterceptor = new PopupTouchInterceptor();
this.mScrollListener = new PopupScrollListener();
this.mHideSelector = new ListSelectorHider();
this.mTempRect = new Rect();
this.mContext = context;
this.mHandler = new Handler(context.getMainLooper());
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R.styleable.ListPopupWindow, i, i2);
this.mDropDownHorizontalOffset = obtainStyledAttributes.getDimensionPixelOffset(R.styleable.ListPopupWindow_android_dropDownHorizontalOffset, 0);
int dimensionPixelOffset = obtainStyledAttributes.getDimensionPixelOffset(R.styleable.ListPopupWindow_android_dropDownVerticalOffset, 0);
this.mDropDownVerticalOffset = dimensionPixelOffset;
if (dimensionPixelOffset != 0) {
this.mDropDownVerticalOffsetSet = true;
}
obtainStyledAttributes.recycle();
AppCompatPopupWindow appCompatPopupWindow = new AppCompatPopupWindow(context, attributeSet, i, i2);
this.mPopup = appCompatPopupWindow;
appCompatPopupWindow.setInputMethodMode(1);
}
public void setAdapter(ListAdapter listAdapter) {
DataSetObserver dataSetObserver = this.mObserver;
if (dataSetObserver == null) {
this.mObserver = new PopupDataSetObserver();
} else {
ListAdapter listAdapter2 = this.mAdapter;
if (listAdapter2 != null) {
listAdapter2.unregisterDataSetObserver(dataSetObserver);
}
}
this.mAdapter = listAdapter;
if (listAdapter != null) {
listAdapter.registerDataSetObserver(this.mObserver);
}
DropDownListView dropDownListView = this.mDropDownList;
if (dropDownListView != null) {
dropDownListView.setAdapter(this.mAdapter);
}
}
public void setPromptPosition(int i) {
this.mPromptPosition = i;
}
public int getPromptPosition() {
return this.mPromptPosition;
}
public void setModal(boolean z) {
this.mModal = z;
this.mPopup.setFocusable(z);
}
public boolean isModal() {
return this.mModal;
}
public void setForceIgnoreOutsideTouch(boolean z) {
this.mForceIgnoreOutsideTouch = z;
}
public void setDropDownAlwaysVisible(boolean z) {
this.mDropDownAlwaysVisible = z;
}
public boolean isDropDownAlwaysVisible() {
return this.mDropDownAlwaysVisible;
}
public void setSoftInputMode(int i) {
this.mPopup.setSoftInputMode(i);
}
public int getSoftInputMode() {
return this.mPopup.getSoftInputMode();
}
public void setListSelector(Drawable drawable) {
this.mDropDownListHighlight = drawable;
}
public Drawable getBackground() {
return this.mPopup.getBackground();
}
public void setBackgroundDrawable(Drawable drawable) {
this.mPopup.setBackgroundDrawable(drawable);
}
public void setAnimationStyle(int i) {
this.mPopup.setAnimationStyle(i);
}
public int getAnimationStyle() {
return this.mPopup.getAnimationStyle();
}
public View getAnchorView() {
return this.mDropDownAnchorView;
}
public void setAnchorView(View view) {
this.mDropDownAnchorView = view;
}
public int getHorizontalOffset() {
return this.mDropDownHorizontalOffset;
}
public void setHorizontalOffset(int i) {
this.mDropDownHorizontalOffset = i;
}
public int getVerticalOffset() {
if (!this.mDropDownVerticalOffsetSet) {
return 0;
}
return this.mDropDownVerticalOffset;
}
public void setVerticalOffset(int i) {
this.mDropDownVerticalOffset = i;
this.mDropDownVerticalOffsetSet = true;
}
public void setEpicenterBounds(Rect rect) {
this.mEpicenterBounds = rect != null ? new Rect(rect) : null;
}
public Rect getEpicenterBounds() {
if (this.mEpicenterBounds != null) {
return new Rect(this.mEpicenterBounds);
}
return null;
}
public void setDropDownGravity(int i) {
this.mDropDownGravity = i;
}
public int getWidth() {
return this.mDropDownWidth;
}
public void setWidth(int i) {
this.mDropDownWidth = i;
}
public void setContentWidth(int i) {
Drawable background = this.mPopup.getBackground();
if (background != null) {
background.getPadding(this.mTempRect);
this.mDropDownWidth = this.mTempRect.left + this.mTempRect.right + i;
return;
}
setWidth(i);
}
public int getHeight() {
return this.mDropDownHeight;
}
public void setHeight(int i) {
if (i >= 0 || -2 == i || -1 == i) {
this.mDropDownHeight = i;
return;
}
throw new IllegalArgumentException("Invalid height. Must be a positive value, MATCH_PARENT, or WRAP_CONTENT.");
}
public void setWindowLayoutType(int i) {
this.mDropDownWindowLayoutType = i;
}
public void setOnItemClickListener(AdapterView.OnItemClickListener onItemClickListener) {
this.mItemClickListener = onItemClickListener;
}
public void setOnItemSelectedListener(AdapterView.OnItemSelectedListener onItemSelectedListener) {
this.mItemSelectedListener = onItemSelectedListener;
}
public void setPromptView(View view) {
boolean isShowing = isShowing();
if (isShowing) {
removePromptView();
}
this.mPromptView = view;
if (isShowing) {
show();
}
}
public void postShow() {
this.mHandler.post(this.mShowDropDownRunnable);
}
public void show() {
int buildDropDown = buildDropDown();
boolean isInputMethodNotNeeded = isInputMethodNotNeeded();
PopupWindowCompat.setWindowLayoutType(this.mPopup, this.mDropDownWindowLayoutType);
boolean z = true;
if (!this.mPopup.isShowing()) {
int i = this.mDropDownWidth;
if (i == -1) {
i = -1;
} else if (i == -2) {
i = getAnchorView().getWidth();
}
int i2 = this.mDropDownHeight;
if (i2 == -1) {
buildDropDown = -1;
} else if (i2 != -2) {
buildDropDown = i2;
}
this.mPopup.setWidth(i);
this.mPopup.setHeight(buildDropDown);
setPopupClipToScreenEnabled(true);
this.mPopup.setOutsideTouchable(!this.mForceIgnoreOutsideTouch && !this.mDropDownAlwaysVisible);
this.mPopup.setTouchInterceptor(this.mTouchInterceptor);
if (this.mOverlapAnchorSet) {
PopupWindowCompat.setOverlapAnchor(this.mPopup, this.mOverlapAnchor);
}
if (Build.VERSION.SDK_INT <= 28) {
Method method = sSetEpicenterBoundsMethod;
if (method != null) {
try {
method.invoke(this.mPopup, new Object[]{this.mEpicenterBounds});
} catch (Exception e) {
Log.e(TAG, "Could not invoke setEpicenterBounds on PopupWindow", e);
}
}
} else {
this.mPopup.setEpicenterBounds(this.mEpicenterBounds);
}
PopupWindowCompat.showAsDropDown(this.mPopup, getAnchorView(), this.mDropDownHorizontalOffset, this.mDropDownVerticalOffset, this.mDropDownGravity);
this.mDropDownList.setSelection(-1);
if (!this.mModal || this.mDropDownList.isInTouchMode()) {
clearListSelection();
}
if (!this.mModal) {
this.mHandler.post(this.mHideSelector);
}
} else if (ViewCompat.isAttachedToWindow(getAnchorView())) {
int i3 = this.mDropDownWidth;
if (i3 == -1) {
i3 = -1;
} else if (i3 == -2) {
i3 = getAnchorView().getWidth();
}
int i4 = this.mDropDownHeight;
if (i4 == -1) {
if (!isInputMethodNotNeeded) {
buildDropDown = -1;
}
if (isInputMethodNotNeeded) {
this.mPopup.setWidth(this.mDropDownWidth == -1 ? -1 : 0);
this.mPopup.setHeight(0);
} else {
this.mPopup.setWidth(this.mDropDownWidth == -1 ? -1 : 0);
this.mPopup.setHeight(-1);
}
} else if (i4 != -2) {
buildDropDown = i4;
}
PopupWindow popupWindow = this.mPopup;
if (this.mForceIgnoreOutsideTouch || this.mDropDownAlwaysVisible) {
z = false;
}
popupWindow.setOutsideTouchable(z);
this.mPopup.update(getAnchorView(), this.mDropDownHorizontalOffset, this.mDropDownVerticalOffset, i3 < 0 ? -1 : i3, buildDropDown < 0 ? -1 : buildDropDown);
}
}
public void dismiss() {
this.mPopup.dismiss();
removePromptView();
this.mPopup.setContentView((View) null);
this.mDropDownList = null;
this.mHandler.removeCallbacks(this.mResizePopupRunnable);
}
public void setOnDismissListener(PopupWindow.OnDismissListener onDismissListener) {
this.mPopup.setOnDismissListener(onDismissListener);
}
private void removePromptView() {
View view = this.mPromptView;
if (view != null) {
ViewParent parent = view.getParent();
if (parent instanceof ViewGroup) {
((ViewGroup) parent).removeView(this.mPromptView);
}
}
}
public void setInputMethodMode(int i) {
this.mPopup.setInputMethodMode(i);
}
public int getInputMethodMode() {
return this.mPopup.getInputMethodMode();
}
public void setSelection(int i) {
DropDownListView dropDownListView = this.mDropDownList;
if (isShowing() && dropDownListView != null) {
dropDownListView.setListSelectionHidden(false);
dropDownListView.setSelection(i);
if (dropDownListView.getChoiceMode() != 0) {
dropDownListView.setItemChecked(i, true);
}
}
}
public void clearListSelection() {
DropDownListView dropDownListView = this.mDropDownList;
if (dropDownListView != null) {
dropDownListView.setListSelectionHidden(true);
dropDownListView.requestLayout();
}
}
public boolean isShowing() {
return this.mPopup.isShowing();
}
public boolean isInputMethodNotNeeded() {
return this.mPopup.getInputMethodMode() == 2;
}
public boolean performItemClick(int i) {
if (!isShowing()) {
return false;
}
if (this.mItemClickListener == null) {
return true;
}
DropDownListView dropDownListView = this.mDropDownList;
int i2 = i;
this.mItemClickListener.onItemClick(dropDownListView, dropDownListView.getChildAt(i - dropDownListView.getFirstVisiblePosition()), i2, dropDownListView.getAdapter().getItemId(i));
return true;
}
public Object getSelectedItem() {
if (!isShowing()) {
return null;
}
return this.mDropDownList.getSelectedItem();
}
public int getSelectedItemPosition() {
if (!isShowing()) {
return -1;
}
return this.mDropDownList.getSelectedItemPosition();
}
public long getSelectedItemId() {
if (!isShowing()) {
return Long.MIN_VALUE;
}
return this.mDropDownList.getSelectedItemId();
}
public View getSelectedView() {
if (!isShowing()) {
return null;
}
return this.mDropDownList.getSelectedView();
}
public ListView getListView() {
return this.mDropDownList;
}
/* access modifiers changed from: package-private */
public DropDownListView createDropDownListView(Context context, boolean z) {
return new DropDownListView(context, z);
}
/* access modifiers changed from: package-private */
public void setListItemExpandMax(int i) {
this.mListItemExpandMaximum = i;
}
public boolean onKeyDown(int i, KeyEvent keyEvent) {
int i2;
int i3;
if (isShowing() && i != 62 && (this.mDropDownList.getSelectedItemPosition() >= 0 || !isConfirmKey(i))) {
int selectedItemPosition = this.mDropDownList.getSelectedItemPosition();
boolean z = !this.mPopup.isAboveAnchor();
ListAdapter listAdapter = this.mAdapter;
int i4 = Integer.MAX_VALUE;
int i5 = Integer.MIN_VALUE;
if (listAdapter != null) {
boolean areAllItemsEnabled = listAdapter.areAllItemsEnabled();
if (areAllItemsEnabled) {
i2 = 0;
} else {
i2 = this.mDropDownList.lookForSelectablePosition(0, true);
}
if (areAllItemsEnabled) {
i3 = listAdapter.getCount() - 1;
} else {
i3 = this.mDropDownList.lookForSelectablePosition(listAdapter.getCount() - 1, false);
}
i4 = i2;
i5 = i3;
}
if ((!z || i != 19 || selectedItemPosition > i4) && (z || i != 20 || selectedItemPosition < i5)) {
this.mDropDownList.setListSelectionHidden(false);
if (this.mDropDownList.onKeyDown(i, keyEvent)) {
this.mPopup.setInputMethodMode(2);
this.mDropDownList.requestFocusFromTouch();
show();
if (i == 19 || i == 20 || i == 23 || i == 66) {
return true;
}
} else if (!z || i != 20) {
if (!z && i == 19 && selectedItemPosition == i4) {
return true;
}
return false;
} else if (selectedItemPosition == i5) {
return true;
}
} else {
clearListSelection();
this.mPopup.setInputMethodMode(1);
show();
return true;
}
}
return false;
}
public boolean onKeyUp(int i, KeyEvent keyEvent) {
if (!isShowing() || this.mDropDownList.getSelectedItemPosition() < 0) {
return false;
}
boolean onKeyUp = this.mDropDownList.onKeyUp(i, keyEvent);
if (onKeyUp && isConfirmKey(i)) {
dismiss();
}
return onKeyUp;
}
public boolean onKeyPreIme(int i, KeyEvent keyEvent) {
if (i != 4 || !isShowing()) {
return false;
}
View view = this.mDropDownAnchorView;
if (keyEvent.getAction() == 0 && keyEvent.getRepeatCount() == 0) {
KeyEvent.DispatcherState keyDispatcherState = view.getKeyDispatcherState();
if (keyDispatcherState != null) {
keyDispatcherState.startTracking(keyEvent, this);
}
return true;
} else if (keyEvent.getAction() != 1) {
return false;
} else {
KeyEvent.DispatcherState keyDispatcherState2 = view.getKeyDispatcherState();
if (keyDispatcherState2 != null) {
keyDispatcherState2.handleUpEvent(keyEvent);
}
if (!keyEvent.isTracking() || keyEvent.isCanceled()) {
return false;
}
dismiss();
return true;
}
}
public View.OnTouchListener createDragToOpenListener(View view) {
return new ForwardingListener(view) {
public ListPopupWindow getPopup() {
return ListPopupWindow.this;
}
};
}
/* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r5v23, resolved type: androidx.appcompat.widget.DropDownListView} */
/* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r5v24, resolved type: androidx.appcompat.widget.DropDownListView} */
/* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r7v2, resolved type: android.widget.LinearLayout} */
/* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r5v29, resolved type: androidx.appcompat.widget.DropDownListView} */
/* JADX WARNING: Multi-variable type inference failed */
/* Code decompiled incorrectly, please refer to instructions dump. */
private int buildDropDown() {
/*
r12 = this;
androidx.appcompat.widget.DropDownListView r0 = r12.mDropDownList
r1 = -2147483648(0xffffffff80000000, float:-0.0)
r2 = -1
r3 = 1
r4 = 0
if (r0 != 0) goto L_0x00bf
android.content.Context r0 = r12.mContext
androidx.appcompat.widget.ListPopupWindow$2 r5 = new androidx.appcompat.widget.ListPopupWindow$2
r5.<init>()
r12.mShowDropDownRunnable = r5
boolean r5 = r12.mModal
r5 = r5 ^ r3
androidx.appcompat.widget.DropDownListView r5 = r12.createDropDownListView(r0, r5)
r12.mDropDownList = r5
android.graphics.drawable.Drawable r6 = r12.mDropDownListHighlight
if (r6 == 0) goto L_0x0022
r5.setSelector(r6)
L_0x0022:
androidx.appcompat.widget.DropDownListView r5 = r12.mDropDownList
android.widget.ListAdapter r6 = r12.mAdapter
r5.setAdapter(r6)
androidx.appcompat.widget.DropDownListView r5 = r12.mDropDownList
android.widget.AdapterView$OnItemClickListener r6 = r12.mItemClickListener
r5.setOnItemClickListener(r6)
androidx.appcompat.widget.DropDownListView r5 = r12.mDropDownList
r5.setFocusable(r3)
androidx.appcompat.widget.DropDownListView r5 = r12.mDropDownList
r5.setFocusableInTouchMode(r3)
androidx.appcompat.widget.DropDownListView r5 = r12.mDropDownList
androidx.appcompat.widget.ListPopupWindow$3 r6 = new androidx.appcompat.widget.ListPopupWindow$3
r6.<init>()
r5.setOnItemSelectedListener(r6)
androidx.appcompat.widget.DropDownListView r5 = r12.mDropDownList
androidx.appcompat.widget.ListPopupWindow$PopupScrollListener r6 = r12.mScrollListener
r5.setOnScrollListener(r6)
android.widget.AdapterView$OnItemSelectedListener r5 = r12.mItemSelectedListener
if (r5 == 0) goto L_0x0054
androidx.appcompat.widget.DropDownListView r6 = r12.mDropDownList
r6.setOnItemSelectedListener(r5)
L_0x0054:
androidx.appcompat.widget.DropDownListView r5 = r12.mDropDownList
android.view.View r6 = r12.mPromptView
if (r6 == 0) goto L_0x00b8
android.widget.LinearLayout r7 = new android.widget.LinearLayout
r7.<init>(r0)
r7.setOrientation(r3)
android.widget.LinearLayout$LayoutParams r0 = new android.widget.LinearLayout$LayoutParams
r8 = 1065353216(0x3f800000, float:1.0)
r0.<init>(r2, r4, r8)
int r8 = r12.mPromptPosition
if (r8 == 0) goto L_0x008f
if (r8 == r3) goto L_0x0088
java.lang.StringBuilder r0 = new java.lang.StringBuilder
r0.<init>()
java.lang.String r5 = "Invalid hint position "
r0.append(r5)
int r5 = r12.mPromptPosition
r0.append(r5)
java.lang.String r0 = r0.toString()
java.lang.String r5 = "ListPopupWindow"
android.util.Log.e(r5, r0)
goto L_0x0095
L_0x0088:
r7.addView(r5, r0)
r7.addView(r6)
goto L_0x0095
L_0x008f:
r7.addView(r6)
r7.addView(r5, r0)
L_0x0095:
int r0 = r12.mDropDownWidth
if (r0 < 0) goto L_0x009c
r5 = -2147483648(0xffffffff80000000, float:-0.0)
goto L_0x009e
L_0x009c:
r0 = 0
r5 = 0
L_0x009e:
int r0 = android.view.View.MeasureSpec.makeMeasureSpec(r0, r5)
r6.measure(r0, r4)
android.view.ViewGroup$LayoutParams r0 = r6.getLayoutParams()
android.widget.LinearLayout$LayoutParams r0 = (android.widget.LinearLayout.LayoutParams) r0
int r5 = r6.getMeasuredHeight()
int r6 = r0.topMargin
int r5 = r5 + r6
int r0 = r0.bottomMargin
int r5 = r5 + r0
r0 = r5
r5 = r7
goto L_0x00b9
L_0x00b8:
r0 = 0
L_0x00b9:
android.widget.PopupWindow r6 = r12.mPopup
r6.setContentView(r5)
goto L_0x00dd
L_0x00bf:
android.widget.PopupWindow r0 = r12.mPopup
android.view.View r0 = r0.getContentView()
android.view.ViewGroup r0 = (android.view.ViewGroup) r0
android.view.View r0 = r12.mPromptView
if (r0 == 0) goto L_0x00dc
android.view.ViewGroup$LayoutParams r5 = r0.getLayoutParams()
android.widget.LinearLayout$LayoutParams r5 = (android.widget.LinearLayout.LayoutParams) r5
int r0 = r0.getMeasuredHeight()
int r6 = r5.topMargin
int r0 = r0 + r6
int r5 = r5.bottomMargin
int r0 = r0 + r5
goto L_0x00dd
L_0x00dc:
r0 = 0
L_0x00dd:
android.widget.PopupWindow r5 = r12.mPopup
android.graphics.drawable.Drawable r5 = r5.getBackground()
if (r5 == 0) goto L_0x00ff
android.graphics.Rect r6 = r12.mTempRect
r5.getPadding(r6)
android.graphics.Rect r5 = r12.mTempRect
int r5 = r5.top
android.graphics.Rect r6 = r12.mTempRect
int r6 = r6.bottom
int r5 = r5 + r6
boolean r6 = r12.mDropDownVerticalOffsetSet
if (r6 != 0) goto L_0x0105
android.graphics.Rect r6 = r12.mTempRect
int r6 = r6.top
int r6 = -r6
r12.mDropDownVerticalOffset = r6
goto L_0x0105
L_0x00ff:
android.graphics.Rect r5 = r12.mTempRect
r5.setEmpty()
r5 = 0
L_0x0105:
android.widget.PopupWindow r6 = r12.mPopup
int r6 = r6.getInputMethodMode()
r7 = 2
if (r6 != r7) goto L_0x010f
goto L_0x0110
L_0x010f:
r3 = 0
L_0x0110:
android.view.View r4 = r12.getAnchorView()
int r6 = r12.mDropDownVerticalOffset
int r3 = r12.getMaxAvailableHeight(r4, r6, r3)
boolean r4 = r12.mDropDownAlwaysVisible
if (r4 != 0) goto L_0x0185
int r4 = r12.mDropDownHeight
if (r4 != r2) goto L_0x0123
goto L_0x0185
L_0x0123:
int r4 = r12.mDropDownWidth
r6 = -2
if (r4 == r6) goto L_0x014c
r1 = 1073741824(0x40000000, float:2.0)
if (r4 == r2) goto L_0x0131
int r1 = android.view.View.MeasureSpec.makeMeasureSpec(r4, r1)
goto L_0x0166
L_0x0131:
android.content.Context r2 = r12.mContext
android.content.res.Resources r2 = r2.getResources()
android.util.DisplayMetrics r2 = r2.getDisplayMetrics()
int r2 = r2.widthPixels
android.graphics.Rect r4 = r12.mTempRect
int r4 = r4.left
android.graphics.Rect r6 = r12.mTempRect
int r6 = r6.right
int r4 = r4 + r6
int r2 = r2 - r4
int r1 = android.view.View.MeasureSpec.makeMeasureSpec(r2, r1)
goto L_0x0166
L_0x014c:
android.content.Context r2 = r12.mContext
android.content.res.Resources r2 = r2.getResources()
android.util.DisplayMetrics r2 = r2.getDisplayMetrics()
int r2 = r2.widthPixels
android.graphics.Rect r4 = r12.mTempRect
int r4 = r4.left
android.graphics.Rect r6 = r12.mTempRect
int r6 = r6.right
int r4 = r4 + r6
int r2 = r2 - r4
int r1 = android.view.View.MeasureSpec.makeMeasureSpec(r2, r1)
L_0x0166:
r7 = r1
androidx.appcompat.widget.DropDownListView r6 = r12.mDropDownList
r8 = 0
r9 = -1
int r10 = r3 - r0
r11 = -1
int r1 = r6.measureHeightOfChildrenCompat(r7, r8, r9, r10, r11)
if (r1 <= 0) goto L_0x0183
androidx.appcompat.widget.DropDownListView r2 = r12.mDropDownList
int r2 = r2.getPaddingTop()
androidx.appcompat.widget.DropDownListView r3 = r12.mDropDownList
int r3 = r3.getPaddingBottom()
int r2 = r2 + r3
int r5 = r5 + r2
int r0 = r0 + r5
L_0x0183:
int r1 = r1 + r0
return r1
L_0x0185:
int r3 = r3 + r5
return r3
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.ListPopupWindow.buildDropDown():int");
}
public void setOverlapAnchor(boolean z) {
this.mOverlapAnchorSet = true;
this.mOverlapAnchor = z;
}
private class PopupDataSetObserver extends DataSetObserver {
PopupDataSetObserver() {
}
public void onChanged() {
if (ListPopupWindow.this.isShowing()) {
ListPopupWindow.this.show();
}
}
public void onInvalidated() {
ListPopupWindow.this.dismiss();
}
}
private class ListSelectorHider implements Runnable {
ListSelectorHider() {
}
public void run() {
ListPopupWindow.this.clearListSelection();
}
}
private class ResizePopupRunnable implements Runnable {
ResizePopupRunnable() {
}
public void run() {
if (ListPopupWindow.this.mDropDownList != null && ViewCompat.isAttachedToWindow(ListPopupWindow.this.mDropDownList) && ListPopupWindow.this.mDropDownList.getCount() > ListPopupWindow.this.mDropDownList.getChildCount() && ListPopupWindow.this.mDropDownList.getChildCount() <= ListPopupWindow.this.mListItemExpandMaximum) {
ListPopupWindow.this.mPopup.setInputMethodMode(2);
ListPopupWindow.this.show();
}
}
}
private class PopupTouchInterceptor implements View.OnTouchListener {
PopupTouchInterceptor() {
}
public boolean onTouch(View view, MotionEvent motionEvent) {
int action = motionEvent.getAction();
int x = (int) motionEvent.getX();
int y = (int) motionEvent.getY();
if (action == 0 && ListPopupWindow.this.mPopup != null && ListPopupWindow.this.mPopup.isShowing() && x >= 0 && x < ListPopupWindow.this.mPopup.getWidth() && y >= 0 && y < ListPopupWindow.this.mPopup.getHeight()) {
ListPopupWindow.this.mHandler.postDelayed(ListPopupWindow.this.mResizePopupRunnable, 250);
return false;
} else if (action != 1) {
return false;
} else {
ListPopupWindow.this.mHandler.removeCallbacks(ListPopupWindow.this.mResizePopupRunnable);
return false;
}
}
}
private class PopupScrollListener implements AbsListView.OnScrollListener {
public void onScroll(AbsListView absListView, int i, int i2, int i3) {
}
PopupScrollListener() {
}
public void onScrollStateChanged(AbsListView absListView, int i) {
if (i == 1 && !ListPopupWindow.this.isInputMethodNotNeeded() && ListPopupWindow.this.mPopup.getContentView() != null) {
ListPopupWindow.this.mHandler.removeCallbacks(ListPopupWindow.this.mResizePopupRunnable);
ListPopupWindow.this.mResizePopupRunnable.run();
}
}
}
private void setPopupClipToScreenEnabled(boolean z) {
if (Build.VERSION.SDK_INT <= 28) {
Method method = sSetClipToWindowEnabledMethod;
if (method != null) {
try {
method.invoke(this.mPopup, new Object[]{Boolean.valueOf(z)});
} catch (Exception unused) {
Log.i(TAG, "Could not call setClipToScreenEnabled() on PopupWindow. Oh well.");
}
}
} else {
this.mPopup.setIsClippedToScreen(z);
}
}
private int getMaxAvailableHeight(View view, int i, boolean z) {
if (Build.VERSION.SDK_INT > 23) {
return this.mPopup.getMaxAvailableHeight(view, i, z);
}
Method method = sGetMaxAvailableHeightMethod;
if (method != null) {
try {
return ((Integer) method.invoke(this.mPopup, new Object[]{view, Integer.valueOf(i), Boolean.valueOf(z)})).intValue();
} catch (Exception unused) {
Log.i(TAG, "Could not call getMaxAvailableHeightMethod(View, int, boolean) on PopupWindow. Using the public version.");
}
}
return this.mPopup.getMaxAvailableHeight(view, i);
}
}
Download file