From 4876eaafcc8d9ff5156959c1671f14caf244f17a Mon Sep 17 00:00:00 2001 From: inorichi Date: Mon, 22 Feb 2016 16:53:33 +0100 Subject: [PATCH] Fix #168 and fix #81. --- .../tachiyomi/ui/reader/ReaderActivity.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.java b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.java index 25d5de797e..7c217e8f87 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.java @@ -154,6 +154,14 @@ public class ReaderActivity extends BaseRxActivity { } } + @Override + public void onWindowFocusChanged(boolean hasFocus) { + super.onWindowFocusChanged(hasFocus); + if (hasFocus) { + setSystemUiVisibility(); + } + } + @Override public boolean dispatchKeyEvent(KeyEvent event) { int action = event.getAction(); @@ -360,11 +368,14 @@ public class ReaderActivity extends BaseRxActivity { uiFlags = 0; uiFlags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; if (statusBarHidden) { - uiFlags |= View.SYSTEM_UI_FLAG_FULLSCREEN; - uiFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + uiFlags |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_FULLSCREEN; } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { uiFlags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + } } public void setSystemUiVisibility() {