diff --git a/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java b/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java index ff15741..a388473 100644 --- a/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java +++ b/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java @@ -119,6 +119,11 @@ public SystemBarTintManager(Activity activity) { mNavBarAvailable = false; } + if (mConfig.isImmersiveMode(activity) || mConfig.isHoverMode(activity)) { + mStatusBarAvailable = false; + mNavBarAvailable = false; + } + if (mStatusBarAvailable) { setupStatusBarView(activity, decorViewGroup); } @@ -360,6 +365,7 @@ public static class SystemBarConfig { private static final String NAV_BAR_HEIGHT_LANDSCAPE_RES_NAME = "navigation_bar_height_landscape"; private static final String NAV_BAR_WIDTH_RES_NAME = "navigation_bar_width"; private static final String SHOW_NAV_BAR_RES_NAME = "config_showNavigationBar"; + private static final int HOVER_INTENT_FLAG = 0x00002000; private final boolean mTranslucentStatusBar; private final boolean mTranslucentNavBar; @@ -443,6 +449,26 @@ private boolean hasNavBar(Context context) { } } + private boolean isImmersiveMode(Activity activity) { + try { + int immersive = android.provider.Settings.System.getInt(activity.getContentResolver(), "immersive_mode"); + if (immersive == 1) { + return true; + } + } catch (Exception e) { + } + + return false; + } + + private boolean isHoverMode(Activity activity) { + if ((activity.getIntent().getFlags() & HOVER_INTENT_FLAG) != 0) { + return true; + } else { + return false; + } + } + private int getInternalDimensionSize(Resources res, String key) { int result = 0; int resourceId = res.getIdentifier(key, "dimen", "android");