|
|
@ -51,7 +51,6 @@ import io.legado.app.ui.book.read.config.TipConfigDialog.Companion.TIP_COLOR |
|
|
|
import io.legado.app.ui.book.read.page.ContentTextView |
|
|
|
import io.legado.app.ui.book.read.page.ContentTextView |
|
|
|
import io.legado.app.ui.book.read.page.ReadView |
|
|
|
import io.legado.app.ui.book.read.page.ReadView |
|
|
|
import io.legado.app.ui.book.read.page.entities.PageDirection |
|
|
|
import io.legado.app.ui.book.read.page.entities.PageDirection |
|
|
|
import io.legado.app.ui.book.read.page.provider.ImageProvider |
|
|
|
|
|
|
|
import io.legado.app.ui.book.read.page.provider.TextPageFactory |
|
|
|
import io.legado.app.ui.book.read.page.provider.TextPageFactory |
|
|
|
import io.legado.app.ui.book.searchContent.SearchContentActivity |
|
|
|
import io.legado.app.ui.book.searchContent.SearchContentActivity |
|
|
|
import io.legado.app.ui.book.searchContent.SearchResult |
|
|
|
import io.legado.app.ui.book.searchContent.SearchResult |
|
|
@ -137,7 +136,7 @@ class ReadBookActivity : BaseReadBookActivity(), |
|
|
|
val textActionMenu: TextActionMenu by lazy { |
|
|
|
val textActionMenu: TextActionMenu by lazy { |
|
|
|
TextActionMenu(this, this) |
|
|
|
TextActionMenu(this, this) |
|
|
|
} |
|
|
|
} |
|
|
|
private val imagePopupAction: PopupAction by lazy { |
|
|
|
private val popupAction: PopupAction by lazy { |
|
|
|
PopupAction(this) |
|
|
|
PopupAction(this) |
|
|
|
} |
|
|
|
} |
|
|
|
override val isInitFinish: Boolean get() = viewModel.isInitFinish |
|
|
|
override val isInitFinish: Boolean get() = viewModel.isInitFinish |
|
|
@ -961,26 +960,23 @@ class ReadBookActivity : BaseReadBookActivity(), |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@SuppressLint("RtlHardcoded") |
|
|
|
@SuppressLint("RtlHardcoded") |
|
|
|
override fun onImageLongPress(x: Float, y: Float, src: String) { |
|
|
|
override fun onImageLongPress(x: Float, y: Float, src: String) { |
|
|
|
imagePopupAction.setItems( |
|
|
|
popupAction.setItems( |
|
|
|
listOf( |
|
|
|
listOf( |
|
|
|
SelectItem(getString(R.string.show), "show"), |
|
|
|
SelectItem(getString(R.string.show), "show"), |
|
|
|
SelectItem(getString(R.string.refresh), "refresh") |
|
|
|
SelectItem(getString(R.string.refresh), "refresh") |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
imagePopupAction.onActionClick = { |
|
|
|
popupAction.onActionClick = { |
|
|
|
when (it) { |
|
|
|
when (it) { |
|
|
|
"show" -> showDialogFragment(PhotoDialog(src)) |
|
|
|
"show" -> showDialogFragment(PhotoDialog(src)) |
|
|
|
"refresh" -> { |
|
|
|
"refresh" -> viewModel.refreshImage(src) |
|
|
|
ImageProvider.bitmapLruCache.remove(src) |
|
|
|
|
|
|
|
ReadBook.loadContent(false) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
imagePopupAction.dismiss() |
|
|
|
popupAction.dismiss() |
|
|
|
} |
|
|
|
} |
|
|
|
val navigationBarHeight = |
|
|
|
val navigationBarHeight = |
|
|
|
if (!ReadBookConfig.hideNavigationBar && navigationBarGravity == Gravity.BOTTOM) |
|
|
|
if (!ReadBookConfig.hideNavigationBar && navigationBarGravity == Gravity.BOTTOM) |
|
|
|
navigationBarHeight else 0 |
|
|
|
navigationBarHeight else 0 |
|
|
|
imagePopupAction.showAtLocation( |
|
|
|
popupAction.showAtLocation( |
|
|
|
binding.readView, Gravity.BOTTOM or Gravity.LEFT, x.toInt(), |
|
|
|
binding.readView, Gravity.BOTTOM or Gravity.LEFT, x.toInt(), |
|
|
|
binding.root.height + navigationBarHeight - y.toInt() |
|
|
|
binding.root.height + navigationBarHeight - y.toInt() |
|
|
|
) |
|
|
|
) |
|
|
@ -1104,7 +1100,7 @@ class ReadBookActivity : BaseReadBookActivity(), |
|
|
|
override fun onDestroy() { |
|
|
|
override fun onDestroy() { |
|
|
|
super.onDestroy() |
|
|
|
super.onDestroy() |
|
|
|
textActionMenu.dismiss() |
|
|
|
textActionMenu.dismiss() |
|
|
|
imagePopupAction.dismiss() |
|
|
|
popupAction.dismiss() |
|
|
|
binding.readView.onDestroy() |
|
|
|
binding.readView.onDestroy() |
|
|
|
ReadBook.msg = null |
|
|
|
ReadBook.msg = null |
|
|
|
ReadBook.callBack = null |
|
|
|
ReadBook.callBack = null |
|
|
|