pull/1319/head
gedoor 3 years ago
parent 5b732a5242
commit 49484a1f4a
  1. 3
      app/build.gradle
  2. 4
      app/src/main/java/io/legado/app/App.kt
  3. 8
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  4. 7
      app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt
  5. 4
      app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt

@ -150,6 +150,9 @@ 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'

@ -84,8 +84,4 @@ class App : MultiDexApplication() {
}
}
companion object {
var navigationBarHeight = 0
}
}

@ -12,7 +12,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
@ -79,13 +78,6 @@ abstract class BaseActivity<VB : ViewBinding>(
observeLiveBus()
}
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) {
App.navigationBarHeight = navigationBarHeight
}
}
override fun onMultiWindowModeChanged(isInMultiWindowMode: Boolean, newConfig: Configuration?) {
super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig)
findViewById<TitleBar>(R.id.title_bar)

@ -11,6 +11,7 @@ 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
@ -246,8 +247,10 @@ class ReadMenu @JvmOverloads constructor(
override fun onAnimationEnd(animation: Animation) {
binding.vwMenuBg.setOnClickListener { runMenuOut() }
binding.vwNavigationBar.layoutParams = binding.vwNavigationBar.layoutParams.apply {
height = activity!!.navigationBarHeight
binding.vwNavigationBar.run {
layoutParams = layoutParams.apply {
height = navigationBarHeight
}
}
if (!LocalConfig.readMenuHelpVersionIsLast) {
callBack.showReadMenuHelp()

@ -7,7 +7,7 @@ import android.view.LayoutInflater
import android.widget.FrameLayout
import androidx.core.view.isGone
import androidx.core.view.isInvisible
import io.legado.app.App
import com.zackratos.ultimatebarx.ultimatebarx.navigationBarHeight
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 App.navigationBarHeight
else navigationBarHeight
}
}
contentTextView.upVisibleRect()

Loading…
Cancel
Save