mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 19:27:25 +01:00
Hide filter FAB in source latest
This commit is contained in:
parent
f6e25627de
commit
1ed291086a
@ -121,22 +121,21 @@ open class BrowseCatalogueController(bundle: Bundle) :
|
|||||||
override fun onViewCreated(view: View) {
|
override fun onViewCreated(view: View) {
|
||||||
super.onViewCreated(view)
|
super.onViewCreated(view)
|
||||||
|
|
||||||
|
// Prepare filter sheet
|
||||||
|
initFilterSheet()
|
||||||
|
|
||||||
// Initialize adapter, scroll listener and recycler views
|
// Initialize adapter, scroll listener and recycler views
|
||||||
adapter = FlexibleAdapter(null, this)
|
adapter = FlexibleAdapter(null, this)
|
||||||
setupRecycler(view)
|
setupRecycler(view)
|
||||||
|
|
||||||
// Prepare filter sheet
|
|
||||||
if (presenter.sourceFilters.isNotEmpty()) {
|
|
||||||
initFilterSheet()
|
|
||||||
|
|
||||||
binding.fabFilter.setOnClickListener { filterSheet?.show() }
|
|
||||||
binding.fabFilter.visible()
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.progress.visible()
|
binding.progress.visible()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initFilterSheet() {
|
open fun initFilterSheet() {
|
||||||
|
if (presenter.sourceFilters.isEmpty()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
filterSheet = CatalogueFilterSheet(
|
filterSheet = CatalogueFilterSheet(
|
||||||
activity!!,
|
activity!!,
|
||||||
onSearchClicked = {
|
onSearchClicked = {
|
||||||
@ -153,6 +152,9 @@ open class BrowseCatalogueController(bundle: Bundle) :
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
filterSheet?.setFilters(presenter.filterItems)
|
filterSheet?.setFilters(presenter.filterItems)
|
||||||
|
|
||||||
|
binding.fabFilter.setOnClickListener { filterSheet?.show() }
|
||||||
|
binding.fabFilter.visible()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroyView(view: View) {
|
override fun onDestroyView(view: View) {
|
||||||
@ -204,7 +206,7 @@ open class BrowseCatalogueController(bundle: Bundle) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (presenter.sourceFilters.isNotEmpty()) {
|
if (filterSheet != null) {
|
||||||
// Add bottom padding if filter FAB is visible
|
// Add bottom padding if filter FAB is visible
|
||||||
recycler.setPadding(
|
recycler.setPadding(
|
||||||
0,
|
0,
|
||||||
|
@ -24,4 +24,8 @@ class LatestUpdatesController(bundle: Bundle) : BrowseCatalogueController(bundle
|
|||||||
super.onPrepareOptionsMenu(menu)
|
super.onPrepareOptionsMenu(menu)
|
||||||
menu.findItem(R.id.action_search).isVisible = false
|
menu.findItem(R.id.action_search).isVisible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun initFilterSheet() {
|
||||||
|
// No-op: we don't allow filtering in latest
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user