From 25d16ffa0db68ca95de90801083644035f318eeb Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 8 Mar 2020 18:02:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/page/ContentView.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt index 3f4472f31..534ee75d2 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt @@ -18,6 +18,8 @@ import java.util.* class ContentView(context: Context) : FrameLayout(context) { + private var battery = 100 + init { //设置背景防止切换背景时文字重叠 setBackgroundColor(context.getCompatColor(R.color.background)) @@ -67,6 +69,10 @@ class ContentView(context: Context) : FrameLayout(context) { tv_bottom_left.setTextColor(it) tv_bottom_right.setTextColor(it) } + if (hideStatusBar) { + tv_bottom_left.text = timeFormat.format(Date(System.currentTimeMillis())) + tv_bottom_right.text = context.getString(R.string.battery_show, battery) + } } } @@ -90,6 +96,7 @@ class ContentView(context: Context) : FrameLayout(context) { } fun upBattery(battery: Int) { + this.battery = battery if (ReadBookConfig.hideStatusBar) { tv_bottom_right.text = context.getString(R.string.battery_show, battery) }