pull/840/head
gedoor 4 years ago
parent aa88cbc6b1
commit 76d904046c
  1. 3
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  2. 2
      app/src/main/java/io/legado/app/constant/AppConst.kt
  3. 4
      app/src/main/java/io/legado/app/constant/Const.kt
  4. 4
      app/src/main/java/io/legado/app/ui/book/read/page/PageView.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<VB : ViewBinding>(
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) {
App.navigationBarHeight = navigationBarHeight
AppConst.navigationBarHeight = navigationBarHeight
}
}

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

@ -24,6 +24,4 @@ val appInfo: AppInfo by lazy {
data class AppInfo(
var versionCode: Long = 0L,
var versionName: String = ""
)
var navigationBarHeight = 0
)

@ -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()

Loading…
Cancel
Save