Use FAB for catalogue filter

This commit is contained in:
arkon
2020-04-10 14:43:13 -04:00
parent c38b457ba0
commit 9a28cbc1e4
5 changed files with 15 additions and 23 deletions

View File

@ -125,7 +125,12 @@ open class BrowseCatalogueController(bundle: Bundle) :
setupRecycler(view)
// Prepare filter sheet
initFilterSheet()
if (presenter.sourceFilters.isNotEmpty()) {
initFilterSheet()
binding.fabFilter.setOnClickListener { filterSheet?.show() }
binding.fabFilter.visible()
}
binding.progress.visible()
}
@ -245,18 +250,6 @@ open class BrowseCatalogueController(bundle: Bundle) :
}
)
// Setup filters button
menu.findItem(R.id.action_set_filter).apply {
icon.mutate()
if (presenter.sourceFilters.isEmpty()) {
isEnabled = false
icon.alpha = 128
} else {
isEnabled = true
icon.alpha = 255
}
}
// Show next display mode
menu.findItem(R.id.action_display_mode).apply {
val icon = if (presenter.isListMode)
@ -278,7 +271,6 @@ open class BrowseCatalogueController(bundle: Bundle) :
when (item.itemId) {
R.id.action_search -> expandActionViewFromInteraction = true
R.id.action_display_mode -> swapDisplayMode()
R.id.action_set_filter -> filterSheet?.show()
R.id.action_open_in_web_view -> openInWebView()
}
return super.onOptionsItemSelected(item)

View File

@ -23,6 +23,5 @@ class LatestUpdatesController(bundle: Bundle) : BrowseCatalogueController(bundle
override fun onPrepareOptionsMenu(menu: Menu) {
super.onPrepareOptionsMenu(menu)
menu.findItem(R.id.action_search).isVisible = false
menu.findItem(R.id.action_set_filter).isVisible = false
}
}