From 84155570df6aea93e6f883bab96b901805ae2b05 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 14 Feb 2020 17:31:56 +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 --- .../main/java/io/legado/app/lib/theme/ATHUtils.kt | 4 ---- .../app/ui/book/read/page/delegate/PageDelegate.kt | 14 +++++++------- app/src/main/res/values/strings.xml | 1 + app/src/main/res/xml/pref_config_read.xml | 6 ++++++ 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/io/legado/app/lib/theme/ATHUtils.kt b/app/src/main/java/io/legado/app/lib/theme/ATHUtils.kt index 24d0a923a..73e342713 100644 --- a/app/src/main/java/io/legado/app/lib/theme/ATHUtils.kt +++ b/app/src/main/java/io/legado/app/lib/theme/ATHUtils.kt @@ -8,10 +8,6 @@ import androidx.annotation.AttrRes */ object ATHUtils { - fun isWindowBackgroundDark(context: Context): Boolean { - return !ColorUtils.isColorLight(resolveColor(context, android.R.attr.windowBackground)) - } - @JvmOverloads fun resolveColor(context: Context, @AttrRes attr: Int, fallback: Int = 0): Int { val a = context.theme.obtainStyledAttributes(intArrayOf(attr)) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt index e4cbf9560..9b0ad7c5e 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt @@ -45,7 +45,7 @@ abstract class PageDelegate(protected val pageView: PageView) { protected var atTop: Boolean = false protected var atBottom: Boolean = false - private var snackbar: Snackbar? = null + private var snackBar: Snackbar? = null private val scroller: Scroller by lazy { Scroller( @@ -291,10 +291,10 @@ abstract class PageDelegate(protected val pageView: PageView) { direction = Direction.PREV val hasPrev = pageView.pageFactory?.hasPrev() == true if (!hasPrev) { - snackbar ?: let { - snackbar = pageView.snackbar("没有上一页") + snackBar ?: let { + snackBar = pageView.snackbar("没有上一页") } - snackbar?.let { + snackBar?.let { if (!it.isShown) { it.setText("没有上一页") it.show() @@ -309,10 +309,10 @@ abstract class PageDelegate(protected val pageView: PageView) { direction = Direction.NEXT val hasNext = pageView.pageFactory?.hasNext() == true if (!hasNext) { - snackbar ?: let { - snackbar = pageView.snackbar("没有下一页") + snackBar ?: let { + snackBar = pageView.snackbar("没有下一页") } - snackbar?.let { + snackBar?.let { if (!it.isShown) { it.setText("没有下一页") it.show() diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c71703292..2bfe28e42 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -609,4 +609,5 @@ 图标为矢量图标,Android8.0以前不支持 朗读设置 主界面 + 选择文本 diff --git a/app/src/main/res/xml/pref_config_read.xml b/app/src/main/res/xml/pref_config_read.xml index 5aae899c8..7b86b5efa 100644 --- a/app/src/main/res/xml/pref_config_read.xml +++ b/app/src/main/res/xml/pref_config_read.xml @@ -40,6 +40,12 @@ android:key="volumeKeyPageOnPlay" app:iconSpaceReserved="false" /> + +