package androidx.appcompat.widget;

import X6FRs_4.IMuAHx_6.WwEq_13.FSaI4_7;
import X6FRs_4.KQgRr5e_0.LGe8pk_15.NzhupJ_29;
import X6FRs_4.KQgRr5e_0.XnFJ5_9;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.widget.PopupWindow;
/* loaded from: classes.dex */
public class AppCompatPopupWindow extends PopupWindow {
    public static final boolean QxJ9d_1;
    public boolean KQgRr5e_0;

    static {
        QxJ9d_1 = Build.VERSION.SDK_INT < 21;
    }

    public AppCompatPopupWindow(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        KQgRr5e_0(context, attributeSet, i, 0);
    }

    public final void KQgRr5e_0(Context context, AttributeSet attributeSet, int i, int i2) {
        NzhupJ_29 KQgRr5e_0 = NzhupJ_29.KQgRr5e_0(context, attributeSet, XnFJ5_9.PopupWindow, i, i2);
        if (KQgRr5e_0.m419KQgRr5e_0(XnFJ5_9.PopupWindow_overlapAnchor)) {
            KQgRr5e_0(KQgRr5e_0.KQgRr5e_0(XnFJ5_9.PopupWindow_overlapAnchor, false));
        }
        setBackgroundDrawable(KQgRr5e_0.m416KQgRr5e_0(XnFJ5_9.PopupWindow_android_popupBackground));
        KQgRr5e_0.KQgRr5e_0();
    }

    @Override // android.widget.PopupWindow
    public void showAsDropDown(View view, int i, int i2) {
        if (QxJ9d_1 && this.KQgRr5e_0) {
            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 (QxJ9d_1 && this.KQgRr5e_0) {
            i2 -= view.getHeight();
        }
        super.update(view, i, i2, i3, i4);
    }

    public AppCompatPopupWindow(Context context, AttributeSet attributeSet, int i, int i2) {
        super(context, attributeSet, i, i2);
        KQgRr5e_0(context, attributeSet, i, i2);
    }

    @Override // android.widget.PopupWindow
    public void showAsDropDown(View view, int i, int i2, int i3) {
        if (QxJ9d_1 && this.KQgRr5e_0) {
            i2 -= view.getHeight();
        }
        super.showAsDropDown(view, i, i2, i3);
    }

    public final void KQgRr5e_0(boolean z) {
        if (QxJ9d_1) {
            this.KQgRr5e_0 = z;
        } else {
            FSaI4_7.KQgRr5e_0(this, z);
        }
    }
}
