优化分屏模式

pull/368/head
gedoor 4 years ago
parent 7225449c41
commit e9261424c9
  1. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 13
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivityHelp.kt
  3. 6
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt

@ -695,7 +695,7 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo
* 更新状态栏,导航栏
*/
override fun upSystemUiVisibility() {
ReadBookActivityHelp.upSystemUiVisibility(window, !read_menu.isVisible)
ReadBookActivityHelp.upSystemUiVisibility(window, isInMultiWindow, !read_menu.isVisible)
upNavigationBarColor()
}

@ -32,15 +32,20 @@ import org.jetbrains.anko.layoutInflater
object ReadBookActivityHelp {
/**
* 更新状态栏,导航栏
*/
fun upSystemUiVisibility(window: Window, toolBarHide: Boolean = true) {
var flag = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
fun upSystemUiVisibility(
window: Window,
isInMultiWindow: Boolean,
toolBarHide: Boolean = true
) {
var flag = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
or View.SYSTEM_UI_FLAG_IMMERSIVE
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
if (!isInMultiWindow) {
flag = flag or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
}
if (ReadBookConfig.hideNavigationBar) {
flag = flag or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
}

@ -31,7 +31,7 @@ import io.legado.app.lib.dialogs.okButton
import io.legado.app.lib.theme.bottomBackground
import io.legado.app.lib.theme.getPrimaryTextColor
import io.legado.app.lib.theme.getSecondaryTextColor
import io.legado.app.ui.book.read.ReadBookActivityHelp
import io.legado.app.ui.book.read.ReadBookActivity
import io.legado.app.ui.filechooser.FileChooserDialog
import io.legado.app.ui.filechooser.FilePicker
import io.legado.app.ui.widget.text.AutoCompleteTextView
@ -129,9 +129,7 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
sw_dark_status_icon.onCheckedChange { buttonView, isChecked ->
if (buttonView?.isPressed == true) {
setStatusIconDark(isChecked)
activity?.window?.let {
ReadBookActivityHelp.upSystemUiVisibility(it)
}
(activity as? ReadBookActivity)?.upSystemUiVisibility()
}
}
tv_text_color.onClick {

Loading…
Cancel
Save