From 2f3c3fbb12897e7d96cbce728cacd6c09c1d48ed Mon Sep 17 00:00:00 2001 From: seven332 Date: Sun, 13 Mar 2016 00:46:34 +0800 Subject: [PATCH] Use low profile for pre-KK in GalleryActivity --- .../main/java/com/hippo/ehviewer/ui/GalleryActivity.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java b/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java index a831226a0..3c070f16c 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java +++ b/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java @@ -22,6 +22,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.res.Resources; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -229,7 +230,13 @@ public class GalleryActivity extends TrackedActivity glRootView.setContentPane(mGalleryView); // System UI helper - mSystemUiHelper = new SystemUiHelper(this, SystemUiHelper.LEVEL_IMMERSIVE, + int systemUiLevel; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + systemUiLevel = SystemUiHelper.LEVEL_IMMERSIVE; + } else { + systemUiLevel = SystemUiHelper.LEVEL_LOW_PROFILE; + } + mSystemUiHelper = new SystemUiHelper(this, systemUiLevel, SystemUiHelper.FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES | SystemUiHelper.FLAG_IMMERSIVE_STICKY); if (savedInstanceState == null || !savedInstanceState.getBoolean(KEY_SHOWING, false)) { mSystemUiHelper.hide();