Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Nov 12, 2023
1 parent e12e5f9 commit 87a8147
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,12 @@ class ReadBookActivity : BaseReadBookActivity(),
val isDown = action == 0

if (keyCode == KeyEvent.KEYCODE_MENU) {
if (isDown && !binding.readMenu.cnaShowMenu) {
if (isDown && !binding.readMenu.canShowMenu) {
binding.readMenu.runMenuIn()
return true
}
if (!isDown && !binding.readMenu.cnaShowMenu) {
binding.readMenu.cnaShowMenu = true
if (!isDown && !binding.readMenu.canShowMenu) {
binding.readMenu.canShowMenu = true
return true
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ReadMenu @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : FrameLayout(context, attrs) {
var cnaShowMenu: Boolean = false
var canShowMenu: Boolean = false
private val callBack: CallBack get() = activity as CallBack
private val binding = ViewReadMenuBinding.inflate(LayoutInflater.from(context), this, true)
private var confirmSkipToChapter: Boolean = false
Expand Down Expand Up @@ -140,7 +140,7 @@ class ReadMenu @JvmOverloads constructor(
this@ReadMenu.invisible()
binding.titleBar.invisible()
binding.bottomMenu.invisible()
cnaShowMenu = false
canShowMenu = false
onMenuOutEnd?.invoke()
callBack.upSystemUiVisibility()
}
Expand Down

0 comments on commit 87a8147

Please sign in to comment.