mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-11 05:59:10 +01:00
Hide & Expand Categories buttons now show/hide dynamically
This commit is contained in:
parent
38ea9eea16
commit
1aede09d35
@ -639,6 +639,10 @@ class LibraryController(
|
||||
scrollToHeader(activeCategory)
|
||||
}
|
||||
category_hopper_frame.visibleIf(!singleCategory)
|
||||
filter_bottom_sheet.updateButtons(
|
||||
showHideCategories = presenter.allCategories.size > 1,
|
||||
showExpand = !singleCategory && presenter.showAllCategories
|
||||
)
|
||||
adapter.isLongPressDragEnabled = canDrag()
|
||||
category_recycler.setCategories(presenter.categories)
|
||||
filter_bottom_sheet.setExpandText(preferences.collapsedCategories().getOrDefault().isNotEmpty())
|
||||
|
@ -27,6 +27,7 @@ import eu.kanade.tachiyomi.util.view.hide
|
||||
import eu.kanade.tachiyomi.util.view.inflate
|
||||
import eu.kanade.tachiyomi.util.view.isExpanded
|
||||
import eu.kanade.tachiyomi.util.view.isHidden
|
||||
import eu.kanade.tachiyomi.util.view.isVisible
|
||||
import eu.kanade.tachiyomi.util.view.updatePaddingRelative
|
||||
import eu.kanade.tachiyomi.util.view.visibleIf
|
||||
import kotlinx.android.synthetic.main.filter_bottom_sheet.view.*
|
||||
@ -429,6 +430,14 @@ class FilterBottomSheet @JvmOverloads constructor(context: Context, attrs: Attri
|
||||
}
|
||||
}
|
||||
|
||||
fun updateButtons(showHideCategories: Boolean, showExpand: Boolean) {
|
||||
hide_categories.visibleIf(showHideCategories)
|
||||
expand_categories.visibleIf(showExpand)
|
||||
first_layout.visibleIf(
|
||||
hide_categories.isVisible() || expand_categories.isVisible() || !second_layout.isVisible()
|
||||
)
|
||||
}
|
||||
|
||||
private fun clearFilters() {
|
||||
preferences.filterDownloaded().set(0)
|
||||
preferences.filterUnread().set(0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user