package androidx.appcompat.widget;

import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.widget.PopupWindow;

/* JADX INFO: compiled from: AppCompatPopupWindow.java */
/* JADX INFO: loaded from: classes.dex */
class t extends PopupWindow {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private static final boolean f1082b;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private boolean f1083a;

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

    public t(Context context, AttributeSet attributeSet, int i3, int i4) {
        super(context, attributeSet, i3, i4);
        a(context, attributeSet, i3, i4);
    }

    private void a(Context context, AttributeSet attributeSet, int i3, int i4) {
        a1 a1VarV = a1.v(context, attributeSet, c.j.T1, i3, i4);
        int i5 = c.j.V1;
        if (a1VarV.s(i5)) {
            b(a1VarV.a(i5, false));
        }
        setBackgroundDrawable(a1VarV.g(c.j.U1));
        a1VarV.w();
    }

    private void b(boolean z2) {
        if (f1082b) {
            this.f1083a = z2;
        } else {
            androidx.core.widget.i.a(this, z2);
        }
    }

    @Override // android.widget.PopupWindow
    public void showAsDropDown(View view, int i3, int i4) {
        if (f1082b && this.f1083a) {
            i4 -= view.getHeight();
        }
        super.showAsDropDown(view, i3, i4);
    }

    @Override // android.widget.PopupWindow
    public void update(View view, int i3, int i4, int i5, int i6) {
        if (f1082b && this.f1083a) {
            i4 -= view.getHeight();
        }
        super.update(view, i3, i4, i5, i6);
    }

    @Override // android.widget.PopupWindow
    public void showAsDropDown(View view, int i3, int i4, int i5) {
        if (f1082b && this.f1083a) {
            i4 -= view.getHeight();
        }
        super.showAsDropDown(view, i3, i4, i5);
    }
}
