From 22294395472ff9df97ee7e89edaf23c16a5fc233 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Sat, 5 Jul 2025 10:23:44 +0300 Subject: [PATCH] Hide chapter-pages tabs when action mode started (closes #1454) --- .../kotatsu/details/ui/pager/ChaptersPagesSheet.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/pager/ChaptersPagesSheet.kt b/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/pager/ChaptersPagesSheet.kt index c49071301..3e91e7e16 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/pager/ChaptersPagesSheet.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/pager/ChaptersPagesSheet.kt @@ -30,7 +30,6 @@ import org.koitharu.kotatsu.core.util.ext.menuView import org.koitharu.kotatsu.core.util.ext.observe import org.koitharu.kotatsu.core.util.ext.observeEvent import org.koitharu.kotatsu.core.util.ext.recyclerView -import org.koitharu.kotatsu.core.util.ext.setTabsEnabled import org.koitharu.kotatsu.core.util.ext.smoothScrollToTop import org.koitharu.kotatsu.databinding.SheetChaptersPagesBinding import org.koitharu.kotatsu.details.ui.DetailsViewModel @@ -144,7 +143,11 @@ class ChaptersPagesSheet : BaseAdaptiveSheet(), private fun adjustLockState() { viewBinding?.run { pager.isUserInputEnabled = !isLocked - tabs.setTabsEnabled(!isLocked) + tabs.visibility = when { + (pager.adapter?.itemCount ?: 0) <= 1 -> View.GONE + isLocked -> View.INVISIBLE + else -> View.VISIBLE + } } }