pull/43/head
kunfei 5 years ago
parent fac568bdba
commit 8028bc227d
  1. 4
      app/src/main/java/io/legado/app/constant/PreferKey.kt
  2. 5
      app/src/main/java/io/legado/app/ui/book/read/Help.kt
  3. 3
      app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt
  4. 5
      app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt
  5. 3
      app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt

@ -3,6 +3,6 @@ package io.legado.app.constant
object PreferKey { object PreferKey {
const val downloadPath = "downloadPath" const val downloadPath = "downloadPath"
const val hideStatusBar = "hideStatusBar"
const val hideNavigationBar = "hideNavigationBar"
} }

@ -5,6 +5,7 @@ import android.view.View
import android.view.View.NO_ID import android.view.View.NO_ID
import android.view.ViewGroup import android.view.ViewGroup
import io.legado.app.App import io.legado.app.App
import io.legado.app.constant.PreferKey
import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadBookConfig
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
@ -21,12 +22,12 @@ object Help {
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
or View.SYSTEM_UI_FLAG_IMMERSIVE or View.SYSTEM_UI_FLAG_IMMERSIVE
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
val hideNavigationBar = App.INSTANCE.getPrefBoolean("hideNavigationBar") val hideNavigationBar = App.INSTANCE.getPrefBoolean(PreferKey.hideNavigationBar)
if (hideNavigationBar) { if (hideNavigationBar) {
flag = flag or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION flag = flag or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
} }
if (toolBarHide) { if (toolBarHide) {
if (App.INSTANCE.getPrefBoolean("hideStatusBar")) { if (App.INSTANCE.getPrefBoolean(PreferKey.hideStatusBar)) {
flag = flag or View.SYSTEM_UI_FLAG_FULLSCREEN flag = flag or View.SYSTEM_UI_FLAG_FULLSCREEN
} }
if (hideNavigationBar) { if (hideNavigationBar) {

@ -11,6 +11,7 @@ import androidx.core.view.isVisible
import io.legado.app.App import io.legado.app.App
import io.legado.app.R import io.legado.app.R
import io.legado.app.constant.Bus import io.legado.app.constant.Bus
import io.legado.app.constant.PreferKey
import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.accentColor
import io.legado.app.lib.theme.buttonDisabledColor import io.legado.app.lib.theme.buttonDisabledColor
import io.legado.app.utils.* import io.legado.app.utils.*
@ -197,7 +198,7 @@ class ReadMenu : FrameLayout {
vw_menu_bg.onClick { runMenuOut() } vw_menu_bg.onClick { runMenuOut() }
vwNavigationBar.layoutParams = vwNavigationBar.layoutParams.apply { vwNavigationBar.layoutParams = vwNavigationBar.layoutParams.apply {
height = height =
if (context.getPrefBoolean("hideNavigationBar") if (context.getPrefBoolean(PreferKey.hideStatusBar)
&& Help.isNavigationBarExist(activity) && Help.isNavigationBarExist(activity)
) context.getNavigationBarHeight() ) context.getNavigationBarHeight()
else 0 else 0

@ -12,6 +12,7 @@ import androidx.fragment.app.DialogFragment
import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import io.legado.app.R import io.legado.app.R
import io.legado.app.constant.Bus import io.legado.app.constant.Bus
import io.legado.app.constant.PreferKey
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.ui.book.read.Help import io.legado.app.ui.book.read.Help
import io.legado.app.utils.postEvent import io.legado.app.utils.postEvent
@ -91,8 +92,8 @@ class MoreConfigDialog : DialogFragment() {
key: String? key: String?
) { ) {
when (key) { when (key) {
"hideStatusBar" -> postEvent(Bus.UP_CONFIG, true) PreferKey.hideStatusBar -> postEvent(Bus.UP_CONFIG, true)
"hideNavigationBar" -> postEvent(Bus.UP_CONFIG, true) PreferKey.hideNavigationBar -> postEvent(Bus.UP_CONFIG, true)
} }
} }

@ -10,6 +10,7 @@ import android.widget.ImageView
import androidx.appcompat.widget.AppCompatImageView import androidx.appcompat.widget.AppCompatImageView
import io.legado.app.R import io.legado.app.R
import io.legado.app.constant.AppConst.TIME_FORMAT import io.legado.app.constant.AppConst.TIME_FORMAT
import io.legado.app.constant.PreferKey
import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadBookConfig
import io.legado.app.utils.* import io.legado.app.utils.*
import kotlinx.android.synthetic.main.view_book_page.view.* import kotlinx.android.synthetic.main.view_book_page.view.*
@ -58,7 +59,7 @@ class ContentView : FrameLayout {
fun upStyle() { fun upStyle() {
ReadBookConfig.getConfig().apply { ReadBookConfig.getConfig().apply {
val pt = if (context.getPrefBoolean("hideStatusBar", false)) { val pt = if (context.getPrefBoolean(PreferKey.hideStatusBar, false)) {
top_bar.visible() top_bar.visible()
0 0
} else { } else {

Loading…
Cancel
Save