From 76d904046cc206cd12342aec51fbcf9e9e6a850e Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 4 Feb 2021 22:12:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/base/BaseActivity.kt | 3 +-- app/src/main/java/io/legado/app/constant/AppConst.kt | 2 ++ app/src/main/java/io/legado/app/constant/Const.kt | 4 +--- app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/base/BaseActivity.kt b/app/src/main/java/io/legado/app/base/BaseActivity.kt index 31deca8e4..36965e86b 100644 --- a/app/src/main/java/io/legado/app/base/BaseActivity.kt +++ b/app/src/main/java/io/legado/app/base/BaseActivity.kt @@ -11,7 +11,6 @@ import android.view.View import android.widget.FrameLayout import androidx.appcompat.app.AppCompatActivity import androidx.viewbinding.ViewBinding -import io.legado.app.App import io.legado.app.R import io.legado.app.constant.AppConst import io.legado.app.constant.Theme @@ -82,7 +81,7 @@ abstract class BaseActivity( override fun onWindowFocusChanged(hasFocus: Boolean) { super.onWindowFocusChanged(hasFocus) if (hasFocus) { - App.navigationBarHeight = navigationBarHeight + AppConst.navigationBarHeight = navigationBarHeight } } diff --git a/app/src/main/java/io/legado/app/constant/AppConst.kt b/app/src/main/java/io/legado/app/constant/AppConst.kt index 0e1634219..d01e18807 100644 --- a/app/src/main/java/io/legado/app/constant/AppConst.kt +++ b/app/src/main/java/io/legado/app/constant/AppConst.kt @@ -18,6 +18,8 @@ object AppConst { const val UA_NAME = "User-Agent" + var navigationBarHeight = 0 + val SCRIPT_ENGINE: ScriptEngine by lazy { ScriptEngineManager().getEngineByName("rhino") } diff --git a/app/src/main/java/io/legado/app/constant/Const.kt b/app/src/main/java/io/legado/app/constant/Const.kt index 77d5be271..97e267f85 100644 --- a/app/src/main/java/io/legado/app/constant/Const.kt +++ b/app/src/main/java/io/legado/app/constant/Const.kt @@ -24,6 +24,4 @@ val appInfo: AppInfo by lazy { data class AppInfo( var versionCode: Long = 0L, var versionName: String = "" -) - -var navigationBarHeight = 0 \ No newline at end of file +) \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt index 7b621735f..753bb01a9 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt @@ -7,9 +7,9 @@ import android.view.LayoutInflater import android.widget.FrameLayout import androidx.core.view.isGone import androidx.core.view.isInvisible -import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseActivity +import io.legado.app.constant.AppConst import io.legado.app.constant.AppConst.timeFormat import io.legado.app.data.entities.Bookmark import io.legado.app.databinding.ViewBookPageBinding @@ -85,7 +85,7 @@ class PageView(context: Context) : FrameLayout(context) { vwTopDivider.visible(it.showHeaderLine) vwBottomDivider.visible(it.showFooterLine) pageNvBar.layoutParams = pageNvBar.layoutParams.apply { - height = if (it.hideNavigationBar) 0 else App.navigationBarHeight + height = if (it.hideNavigationBar) 0 else AppConst.navigationBarHeight } } contentTextView.upVisibleRect()