diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt index 0af596c38..a8deef9a6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt @@ -159,13 +159,12 @@ open class BrowseSourceController(bundle: Bundle) : ) filterSheet?.setFilters(presenter.filterItems) - // TODO: [ExtendedFloatingActionButton] hide/show methods don't work properly - filterSheet?.setOnShowListener { actionFab?.isVisible = false } - filterSheet?.setOnDismissListener { actionFab?.isVisible = true } + filterSheet?.setOnShowListener { actionFab?.hide() } + filterSheet?.setOnDismissListener { actionFab?.show() } actionFab?.setOnClickListener { filterSheet?.show() } - actionFab?.isVisible = true + actionFab?.show() } override fun configureFab(fab: ExtendedFloatingActionButton) { @@ -175,7 +174,7 @@ open class BrowseSourceController(bundle: Bundle) : fab.setIconResource(R.drawable.ic_filter_list_24dp) // Controlled by initFilterSheet() - fab.isVisible = false + fab.hide() initFilterSheet() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index c892f1041..6944b6c73 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -562,12 +562,13 @@ class MainActivity : BaseViewBindingActivity() { binding.tabs.isVisible = to is TabbedController if (from is FabController) { - binding.fabLayout.rootFab.isVisible = false from.cleanupFab(binding.fabLayout.rootFab) } if (to is FabController) { - binding.fabLayout.rootFab.isVisible = true + binding.fabLayout.rootFab.show() to.configureFab(binding.fabLayout.rootFab) + } else { + binding.fabLayout.rootFab.hide() } if (!isTablet()) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt index d67d14e1d..99fb8e4b2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt @@ -303,7 +303,7 @@ class MangaController : actionFabScrollListener = actionFab?.shrinkOnScroll(chapterRecycler) // Initially set FAB invisible; will become visible if unread chapters are present - actionFab?.isVisible = false + actionFab?.hide() binding.swipeRefresh.refreshes() .onEach { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/database/ClearDatabaseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/database/ClearDatabaseController.kt index 2b6601881..6bcfc6e57 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/database/ClearDatabaseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/database/ClearDatabaseController.kt @@ -125,7 +125,7 @@ class ClearDatabaseController : override fun configureFab(fab: ExtendedFloatingActionButton) { fab.setIconResource(R.drawable.ic_delete_24dp) fab.setText(R.string.action_delete) - fab.isVisible = false + fab.hide() fab.setOnClickListener { val ctrl = ClearDatabaseSourcesDialog() ctrl.targetController = this @@ -136,7 +136,11 @@ class ClearDatabaseController : private fun updateFab() { val adapter = adapter ?: return - actionFab?.isVisible = adapter.selectedItemCount > 0 + if (adapter.selectedItemCount > 0) { + actionFab?.show() + } else { + actionFab?.hide() + } } override fun cleanupFab(fab: ExtendedFloatingActionButton) {