mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
e12e5f9a5e
commit
87a81478cb
@ -504,12 +504,12 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|||||||
val isDown = action == 0
|
val isDown = action == 0
|
||||||
|
|
||||||
if (keyCode == KeyEvent.KEYCODE_MENU) {
|
if (keyCode == KeyEvent.KEYCODE_MENU) {
|
||||||
if (isDown && !binding.readMenu.cnaShowMenu) {
|
if (isDown && !binding.readMenu.canShowMenu) {
|
||||||
binding.readMenu.runMenuIn()
|
binding.readMenu.runMenuIn()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (!isDown && !binding.readMenu.cnaShowMenu) {
|
if (!isDown && !binding.readMenu.canShowMenu) {
|
||||||
binding.readMenu.cnaShowMenu = true
|
binding.readMenu.canShowMenu = true
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet? = null
|
attrs: AttributeSet? = null
|
||||||
) : FrameLayout(context, attrs) {
|
) : FrameLayout(context, attrs) {
|
||||||
var cnaShowMenu: Boolean = false
|
var canShowMenu: Boolean = false
|
||||||
private val callBack: CallBack get() = activity as CallBack
|
private val callBack: CallBack get() = activity as CallBack
|
||||||
private val binding = ViewReadMenuBinding.inflate(LayoutInflater.from(context), this, true)
|
private val binding = ViewReadMenuBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
private var confirmSkipToChapter: Boolean = false
|
private var confirmSkipToChapter: Boolean = false
|
||||||
@ -140,7 +140,7 @@ class ReadMenu @JvmOverloads constructor(
|
|||||||
this@ReadMenu.invisible()
|
this@ReadMenu.invisible()
|
||||||
binding.titleBar.invisible()
|
binding.titleBar.invisible()
|
||||||
binding.bottomMenu.invisible()
|
binding.bottomMenu.invisible()
|
||||||
cnaShowMenu = false
|
canShowMenu = false
|
||||||
onMenuOutEnd?.invoke()
|
onMenuOutEnd?.invoke()
|
||||||
callBack.upSystemUiVisibility()
|
callBack.upSystemUiVisibility()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user