package ඓ.㸾.K;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.os.Build;
import android.provider.Settings;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.Display;
import android.view.View;
import com.gyf.immersionbar.R$id;
import ῲ.ᨨ.㳳.C1841;

/* renamed from: ඓ.㸾.K.K  reason: contains not printable characters */
/* compiled from: BarConfig */
public class C1380 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final boolean f5281;

    /* renamed from: ඓ  reason: contains not printable characters */
    public final int f5282;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final int f5283;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public final float f5284;

    /* renamed from: K  reason: contains not printable characters */
    public final int f5285;

    /* renamed from: 㴹  reason: contains not printable characters */
    public final boolean f5286;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final int f5287;

    public C1380(Activity activity) {
        int i;
        boolean z = true;
        this.f5286 = activity.getResources().getConfiguration().orientation == 1;
        DisplayMetrics displayMetrics = new DisplayMetrics();
        int i2 = Build.VERSION.SDK_INT;
        activity.getWindowManager().getDefaultDisplay().getRealMetrics(displayMetrics);
        float f = displayMetrics.density;
        this.f5284 = Math.min(((float) displayMetrics.widthPixels) / f, ((float) displayMetrics.heightPixels) / f);
        this.f5285 = m3571(activity, "status_bar_height");
        int i3 = Build.VERSION.SDK_INT;
        View findViewById = activity.getWindow().findViewById(R$id.action_bar_container);
        int measuredHeight = findViewById != null ? findViewById.getMeasuredHeight() : 0;
        if (measuredHeight == 0) {
            TypedValue typedValue = new TypedValue();
            activity.getTheme().resolveAttribute(16843499, typedValue, true);
            measuredHeight = TypedValue.complexToDimensionPixelSize(typedValue.data, activity.getResources().getDisplayMetrics());
        }
        this.f5283 = measuredHeight;
        int i4 = Build.VERSION.SDK_INT;
        if (m3573(activity)) {
            i = m3571(activity, this.f5286 ? "navigation_bar_height" : "navigation_bar_height_landscape");
        } else {
            i = 0;
        }
        this.f5287 = i;
        int i5 = Build.VERSION.SDK_INT;
        this.f5282 = m3573(activity) ? m3571(activity, "navigation_bar_width") : 0;
        this.f5281 = this.f5287 <= 0 ? false : z;
    }

    @TargetApi(14)
    /* renamed from: K  reason: contains not printable characters */
    public final boolean m3573(Activity activity) {
        int i = Build.VERSION.SDK_INT;
        if (Settings.Global.getInt(activity.getContentResolver(), "force_fsg_nav_bar", 0) != 0) {
            return false;
        }
        if (C1841.m4750()) {
            if (!C1841.m4805()) {
                int i2 = Build.VERSION.SDK_INT;
                if (Settings.Global.getInt(activity.getContentResolver(), "navigationbar_is_min", 0) != 0) {
                    return false;
                }
            } else if (Settings.System.getInt(activity.getContentResolver(), "navigationbar_is_min", 0) != 0) {
                return false;
            }
        }
        Display defaultDisplay = activity.getWindowManager().getDefaultDisplay();
        DisplayMetrics displayMetrics = new DisplayMetrics();
        int i3 = Build.VERSION.SDK_INT;
        defaultDisplay.getRealMetrics(displayMetrics);
        int i4 = displayMetrics.heightPixels;
        int i5 = displayMetrics.widthPixels;
        DisplayMetrics displayMetrics2 = new DisplayMetrics();
        defaultDisplay.getMetrics(displayMetrics2);
        int i6 = displayMetrics2.heightPixels;
        if (i5 - displayMetrics2.widthPixels > 0 || i4 - i6 > 0) {
            return true;
        }
        return false;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final int m3571(Context context, String str) {
        try {
            int identifier = Resources.getSystem().getIdentifier(str, "dimen", "android");
            if (identifier > 0) {
                int dimensionPixelSize = context.getResources().getDimensionPixelSize(identifier);
                int dimensionPixelSize2 = Resources.getSystem().getDimensionPixelSize(identifier);
                if (dimensionPixelSize2 >= dimensionPixelSize) {
                    return dimensionPixelSize2;
                }
                float f = (((float) dimensionPixelSize) * Resources.getSystem().getDisplayMetrics().density) / context.getResources().getDisplayMetrics().density;
                return (int) (f >= 0.0f ? f + 0.5f : f - 0.5f);
            }
        } catch (Resources.NotFoundException unused) {
        }
        return 0;
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m3572() {
        return this.f5284 >= 600.0f || this.f5286;
    }
}
