From b4939e64c52b1dab60d1481812437941b8af00e5 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 24 Jan 2020 19:56:06 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/ui/book/read/Help.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/read/Help.kt b/app/src/main/java/io/legado/app/ui/book/read/Help.kt index 33294b7e4..247349a60 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/Help.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/Help.kt @@ -70,6 +70,14 @@ object Help { return false } + fun keepScreenOn(window: Window, on: Boolean) { + if (on) { + window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) + } else { + window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) + } + } + /** * 适配刘海 */ @@ -81,4 +89,5 @@ object Help { } } } + } \ No newline at end of file