pull/840/head
gedoor 4 years ago
parent 76d904046c
commit 39db2376bd
  1. 4
      app/src/main/java/io/legado/app/App.kt
  2. 3
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  3. 2
      app/src/main/java/io/legado/app/constant/AppConst.kt
  4. 4
      app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt

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

@ -11,6 +11,7 @@ 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
@ -81,7 +82,7 @@ abstract class BaseActivity<VB : ViewBinding>(
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) {
AppConst.navigationBarHeight = navigationBarHeight
App.navigationBarHeight = navigationBarHeight
}
}

@ -18,8 +18,6 @@ object AppConst {
const val UA_NAME = "User-Agent"
var navigationBarHeight = 0
val SCRIPT_ENGINE: ScriptEngine by lazy {
ScriptEngineManager().getEngineByName("rhino")
}

@ -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 AppConst.navigationBarHeight
height = if (it.hideNavigationBar) 0 else App.navigationBarHeight
}
}
contentTextView.upVisibleRect()

Loading…
Cancel
Save