From fed80c2b883f3339f4aa70c300cc98280a24c467 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 17 Apr 2022 20:25:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/ReadBookActivity.kt | 8 ++++---- .../main/java/io/legado/app/ui/book/read/page/ReadView.kt | 6 ------ app/src/main/java/io/legado/app/ui/widget/PopupAction.kt | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 50d3c0a25..4355ea183 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -131,17 +131,17 @@ class ReadBookActivity : BaseReadBookActivity(), private var menu: Menu? = null private var changeSourceMenu: PopupMenu? = null private var refreshMenu: PopupMenu? = null + private var autoPageJob: Job? = null + private var backupJob: Job? = null + private var keepScreenJon: Job? = null val textActionMenu: TextActionMenu by lazy { TextActionMenu(this, this) } - override val imagePopupAction: PopupAction by lazy { + private val imagePopupAction: PopupAction by lazy { PopupAction(this) } override val isInitFinish: Boolean get() = viewModel.isInitFinish override val isScroll: Boolean get() = binding.readView.isScroll - private var keepScreenJon: Job? = null - private var autoPageJob: Job? = null - private var backupJob: Job? = null override var autoPageProgress = 0 override var isAutoPage = false override var isShowingSearchResult = false diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt index 1d8c79e50..c96eb6fed 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt @@ -25,7 +25,6 @@ import io.legado.app.ui.book.read.page.entities.TextChapter import io.legado.app.ui.book.read.page.entities.TextPos import io.legado.app.ui.book.read.page.provider.ChapterProvider import io.legado.app.ui.book.read.page.provider.TextPageFactory -import io.legado.app.ui.widget.PopupAction import io.legado.app.utils.activity import io.legado.app.utils.screenshot import java.text.BreakIterator @@ -207,10 +206,6 @@ class ReadView(context: Context, attrs: AttributeSet) : if (!pressDown) return true pressDown = false if (!isMove) { - if (!longPressed && callBack.imagePopupAction.isShowing) { - callBack.imagePopupAction.dismiss() - return true - } if (!longPressed && !pressOnTextSelected) { onSingleTapUp() return true @@ -544,7 +539,6 @@ class ReadView(context: Context, attrs: AttributeSet) : val isInitFinish: Boolean val isAutoPage: Boolean val autoPageProgress: Int - val imagePopupAction: PopupAction fun showActionMenu() fun screenOffTimerStart() fun showTextActionMenu() diff --git a/app/src/main/java/io/legado/app/ui/widget/PopupAction.kt b/app/src/main/java/io/legado/app/ui/widget/PopupAction.kt index fa8296684..e83808168 100644 --- a/app/src/main/java/io/legado/app/ui/widget/PopupAction.kt +++ b/app/src/main/java/io/legado/app/ui/widget/PopupAction.kt @@ -24,7 +24,7 @@ class PopupAction(private val context: Context) : isTouchable = true isOutsideTouchable = false - isFocusable = false + isFocusable = true binding.recyclerView.adapter = adapter }