From c22ef0a842fcdfbcaf1c79b73ed59af900248fcf Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 11 Sep 2021 21:28:56 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E4=BC=98=E5=8C=96"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 49484a1f --- app/build.gradle | 3 --- app/src/main/java/io/legado/app/App.kt | 4 ++++ app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt | 7 ++----- .../main/java/io/legado/app/ui/book/read/page/PageView.kt | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3c8db5eb8..562bf79c8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -150,9 +150,6 @@ dependencies { implementation('com.google.code.gson:gson:2.8.8') implementation('androidx.webkit:webkit:1.4.0') - //状态栏和导航栏 - implementation('com.gitee.zackratos:UltimateBarX:0.7.1') - //media implementation("androidx.media:media:1.4.1") def exoplayer_version = '2.15.0' diff --git a/app/src/main/java/io/legado/app/App.kt b/app/src/main/java/io/legado/app/App.kt index 5ecda4c4a..991097d3c 100644 --- a/app/src/main/java/io/legado/app/App.kt +++ b/app/src/main/java/io/legado/app/App.kt @@ -84,4 +84,8 @@ class App : MultiDexApplication() { } } + companion object { + var navigationBarHeight = 0 + } + } diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt index b797dd036..51e6df405 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt @@ -11,7 +11,6 @@ import android.widget.FrameLayout import android.widget.SeekBar import androidx.core.view.isGone import androidx.core.view.isVisible -import com.zackratos.ultimatebarx.ultimatebarx.navigationBarHeight import io.legado.app.R import io.legado.app.constant.PreferKey import io.legado.app.databinding.ViewReadMenuBinding @@ -247,10 +246,8 @@ class ReadMenu @JvmOverloads constructor( override fun onAnimationEnd(animation: Animation) { binding.vwMenuBg.setOnClickListener { runMenuOut() } - binding.vwNavigationBar.run { - layoutParams = layoutParams.apply { - height = navigationBarHeight - } + binding.vwNavigationBar.layoutParams = binding.vwNavigationBar.layoutParams.apply { + height = activity!!.navigationBarHeight } if (!LocalConfig.readMenuHelpVersionIsLast) { callBack.showReadMenuHelp() 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 696129147..ea34c2a74 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,7 +7,7 @@ import android.view.LayoutInflater import android.widget.FrameLayout import androidx.core.view.isGone import androidx.core.view.isInvisible -import com.zackratos.ultimatebarx.ultimatebarx.navigationBarHeight +import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseActivity import io.legado.app.constant.AppConst.timeFormat @@ -87,7 +87,7 @@ class PageView(context: Context) : FrameLayout(context) { pageNvBar.layoutParams = pageNvBar.layoutParams.apply { height = if (it.hideNavigationBar) 0 - else navigationBarHeight + else App.navigationBarHeight } } contentTextView.upVisibleRect()