alexandroid/decompiled/jadx/sources/androidx/appcompat/widget/AppCompatPopupWindow.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

70 lines
2.7 KiB
Java

package androidx.appcompat.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.PopupWindow;
import androidx.annotation.AttrRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StyleRes;
import androidx.appcompat.R;
import androidx.core.widget.PopupWindowCompat;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes.dex */
class AppCompatPopupWindow extends PopupWindow {
private static final boolean COMPAT_OVERLAP_ANCHOR = false;
private boolean mOverlapAnchor;
public AppCompatPopupWindow(@NonNull Context context, @Nullable AttributeSet attributeSet, @AttrRes int i) {
super(context, attributeSet, i);
init(context, attributeSet, i, 0);
}
private void init(Context context, AttributeSet attributeSet, int i, int i2) {
TintTypedArray obtainStyledAttributes = TintTypedArray.obtainStyledAttributes(context, attributeSet, R.styleable.PopupWindow, i, i2);
if (obtainStyledAttributes.hasValue(R.styleable.PopupWindow_overlapAnchor)) {
setSupportOverlapAnchor(obtainStyledAttributes.getBoolean(R.styleable.PopupWindow_overlapAnchor, false));
}
setBackgroundDrawable(obtainStyledAttributes.getDrawable(R.styleable.PopupWindow_android_popupBackground));
obtainStyledAttributes.recycle();
}
private void setSupportOverlapAnchor(boolean z) {
if (COMPAT_OVERLAP_ANCHOR) {
this.mOverlapAnchor = z;
} else {
PopupWindowCompat.setOverlapAnchor(this, z);
}
}
@Override // android.widget.PopupWindow
public void showAsDropDown(View view, int i, int i2) {
if (COMPAT_OVERLAP_ANCHOR && this.mOverlapAnchor) {
i2 -= view.getHeight();
}
super.showAsDropDown(view, i, i2);
}
@Override // android.widget.PopupWindow
public void update(View view, int i, int i2, int i3, int i4) {
if (COMPAT_OVERLAP_ANCHOR && this.mOverlapAnchor) {
i2 -= view.getHeight();
}
super.update(view, i, i2, i3, i4);
}
public AppCompatPopupWindow(@NonNull Context context, @Nullable AttributeSet attributeSet, @AttrRes int i, @StyleRes int i2) {
super(context, attributeSet, i, i2);
init(context, attributeSet, i, i2);
}
@Override // android.widget.PopupWindow
public void showAsDropDown(View view, int i, int i2, int i3) {
if (COMPAT_OVERLAP_ANCHOR && this.mOverlapAnchor) {
i2 -= view.getHeight();
}
super.showAsDropDown(view, i, i2, i3);
}
}