|
|
|
@ -125,6 +125,7 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
|
private var loadStates: Boolean = false |
|
|
|
|
override val pageFactory: TextPageFactory get() = binding.readView.pageFactory |
|
|
|
|
override val headerHeight: Int get() = binding.readView.curPage.headerHeight |
|
|
|
|
private val menuLayoutIsVisible get() = bottomDialog > 0 || binding.readMenu.isVisible |
|
|
|
|
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility") |
|
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
@ -330,6 +331,9 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
|
* 按键事件 |
|
|
|
|
*/ |
|
|
|
|
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { |
|
|
|
|
if (menuLayoutIsVisible) { |
|
|
|
|
return super.onKeyDown(keyCode, event) |
|
|
|
|
} |
|
|
|
|
when { |
|
|
|
|
isPrevKey(keyCode) -> { |
|
|
|
|
if (keyCode != KeyEvent.KEYCODE_UNKNOWN) { |
|
|
|
@ -699,6 +703,7 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
|
delayMillis = 20 |
|
|
|
|
} |
|
|
|
|
mHandler.removeCallbacks(autoPageRunnable) |
|
|
|
|
if (!menuLayoutIsVisible) { |
|
|
|
|
if (binding.readView.isScroll) { |
|
|
|
|
binding.readView.curPage.scroll(-scrollOffset) |
|
|
|
|
} else { |
|
|
|
@ -712,6 +717,7 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
|
binding.readView.invalidate() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
mHandler.postDelayed(autoPageRunnable, delayMillis) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|