|
|
@ -134,7 +134,7 @@ class ReadBookActivity : BaseReadBookActivity(), |
|
|
|
val textActionMenu: TextActionMenu by lazy { |
|
|
|
val textActionMenu: TextActionMenu by lazy { |
|
|
|
TextActionMenu(this, this) |
|
|
|
TextActionMenu(this, this) |
|
|
|
} |
|
|
|
} |
|
|
|
private val popupAction by lazy { |
|
|
|
override val imagePopupAction: PopupAction by lazy { |
|
|
|
PopupAction(this) |
|
|
|
PopupAction(this) |
|
|
|
} |
|
|
|
} |
|
|
|
override val isInitFinish: Boolean get() = viewModel.isInitFinish |
|
|
|
override val isInitFinish: Boolean get() = viewModel.isInitFinish |
|
|
@ -960,26 +960,26 @@ class ReadBookActivity : BaseReadBookActivity(), |
|
|
|
* 长按图片 |
|
|
|
* 长按图片 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
override fun onImageLongPress(x: Float, y: Float, src: String) { |
|
|
|
override fun onImageLongPress(x: Float, y: Float, src: String) { |
|
|
|
popupAction.setItems( |
|
|
|
imagePopupAction.setItems( |
|
|
|
listOf( |
|
|
|
listOf( |
|
|
|
SelectItem("查看", "show"), |
|
|
|
SelectItem("查看", "show"), |
|
|
|
SelectItem("刷新", "refresh") |
|
|
|
SelectItem("刷新", "refresh") |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
popupAction.onActionClick = { |
|
|
|
imagePopupAction.onActionClick = { |
|
|
|
when (it) { |
|
|
|
when (it) { |
|
|
|
"show" -> showDialogFragment(PhotoDialog(src)) |
|
|
|
"show" -> showDialogFragment(PhotoDialog(src)) |
|
|
|
"refresh" -> { |
|
|
|
"refresh" -> { |
|
|
|
ImageProvider.bitmapLruCache.remove(src) |
|
|
|
ImageProvider.bitmapLruCache.remove(src) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
popupAction.dismiss() |
|
|
|
imagePopupAction.dismiss() |
|
|
|
} |
|
|
|
} |
|
|
|
val navigationBarHeight = |
|
|
|
val navigationBarHeight = |
|
|
|
if (!ReadBookConfig.hideNavigationBar && navigationBarGravity == Gravity.BOTTOM) |
|
|
|
if (!ReadBookConfig.hideNavigationBar && navigationBarGravity == Gravity.BOTTOM) |
|
|
|
navigationBarHeight else 0 |
|
|
|
navigationBarHeight else 0 |
|
|
|
popupAction.showAtLocation( |
|
|
|
imagePopupAction.showAtLocation( |
|
|
|
binding.readView, Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL, x.toInt(), |
|
|
|
binding.readView, Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL, 0, |
|
|
|
binding.root.height + navigationBarHeight - y.toInt() |
|
|
|
binding.root.height + navigationBarHeight - y.toInt() |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
@ -1102,7 +1102,7 @@ class ReadBookActivity : BaseReadBookActivity(), |
|
|
|
override fun onDestroy() { |
|
|
|
override fun onDestroy() { |
|
|
|
super.onDestroy() |
|
|
|
super.onDestroy() |
|
|
|
textActionMenu.dismiss() |
|
|
|
textActionMenu.dismiss() |
|
|
|
popupAction.dismiss() |
|
|
|
imagePopupAction.dismiss() |
|
|
|
binding.readView.onDestroy() |
|
|
|
binding.readView.onDestroy() |
|
|
|
ReadBook.msg = null |
|
|
|
ReadBook.msg = null |
|
|
|
ReadBook.callBack = null |
|
|
|
ReadBook.callBack = null |
|
|
|