package ῲ.ῲ.㴹;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.widget.PopupWindow;
import androidx.appcompat.R$styleable;
import ῲ.ῲ.ῲ.K.C1940;
import K.K.K.ʬ.C2369;

/* renamed from: ῲ.ῲ.㴹.㿎  reason: contains not printable characters */
/* compiled from: AppCompatPopupWindow */
public class C2050 extends PopupWindow {

    /* renamed from: ῲ  reason: contains not printable characters */
    public static final boolean f6966 = false;

    /* renamed from: K  reason: contains not printable characters */
    public boolean f6967;

    static {
        int i = Build.VERSION.SDK_INT;
    }

    public C2050(Context context, AttributeSet attributeSet, int i, int i2) {
        super(context, attributeSet, i, i2);
        Drawable drawable;
        int resourceId;
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.PopupWindow, i, i2);
        if (obtainStyledAttributes.hasValue(R$styleable.PopupWindow_overlapAnchor)) {
            boolean z = obtainStyledAttributes.getBoolean(R$styleable.PopupWindow_overlapAnchor, false);
            if (f6966) {
                this.f6967 = z;
            } else {
                C2369.m6333(this, z);
            }
        }
        int i3 = R$styleable.PopupWindow_android_popupBackground;
        if (!obtainStyledAttributes.hasValue(i3) || (resourceId = obtainStyledAttributes.getResourceId(i3, 0)) == 0) {
            drawable = obtainStyledAttributes.getDrawable(i3);
        } else {
            drawable = C1940.m5017(context, resourceId);
        }
        setBackgroundDrawable(drawable);
        obtainStyledAttributes.recycle();
    }

    public void showAsDropDown(View view, int i, int i2) {
        if (f6966 && this.f6967) {
            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 (f6966 && this.f6967) {
            i2 -= view.getHeight();
        }
        super.update(view, i, i2, i3, i4);
    }

    public void showAsDropDown(View view, int i, int i2, int i3) {
        if (f6966 && this.f6967) {
            i2 -= view.getHeight();
        }
        super.showAsDropDown(view, i, i2, i3);
    }
}
