Revert "Make controllers responsible for showing/hiding FAB"
This reverts commit 8ef548032f.
This commit is contained in:
+12
-7
@@ -47,7 +47,6 @@ import eu.kanade.tachiyomi.util.view.snack
|
||||
import eu.kanade.tachiyomi.util.view.visible
|
||||
import eu.kanade.tachiyomi.widget.AutofitRecyclerView
|
||||
import eu.kanade.tachiyomi.widget.EmptyView
|
||||
import kotlinx.android.synthetic.main.main_activity.root_fab
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.flow.drop
|
||||
import kotlinx.coroutines.flow.filter
|
||||
@@ -87,6 +86,7 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
*/
|
||||
private var adapter: FlexibleAdapter<IFlexible<*>>? = null
|
||||
|
||||
private var actionFab: ExtendedFloatingActionButton? = null
|
||||
private var actionFabScrollListener: RecyclerView.OnScrollListener? = null
|
||||
|
||||
/**
|
||||
@@ -167,21 +167,27 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
filterSheet?.setFilters(presenter.filterItems)
|
||||
|
||||
// TODO: [ExtendedFloatingActionButton] hide/show methods don't work properly
|
||||
filterSheet?.setOnShowListener { activity!!.root_fab.gone() }
|
||||
filterSheet?.setOnDismissListener { activity!!.root_fab.visible() }
|
||||
filterSheet?.setOnShowListener { actionFab?.gone() }
|
||||
filterSheet?.setOnDismissListener { actionFab?.visible() }
|
||||
|
||||
activity!!.root_fab.setOnClickListener { filterSheet?.show() }
|
||||
actionFab?.setOnClickListener { filterSheet?.show() }
|
||||
|
||||
activity!!.root_fab.visible()
|
||||
actionFab?.visible()
|
||||
}
|
||||
|
||||
override fun configureFab(fab: ExtendedFloatingActionButton) {
|
||||
actionFab = fab
|
||||
|
||||
// Controlled by initFilterSheet()
|
||||
fab.gone()
|
||||
|
||||
fab.setText(R.string.action_filter)
|
||||
fab.setIconResource(R.drawable.ic_filter_list_24dp)
|
||||
}
|
||||
|
||||
override fun cleanupFab(fab: ExtendedFloatingActionButton) {
|
||||
actionFabScrollListener?.let { recycler?.removeOnScrollListener(it) }
|
||||
actionFab = null
|
||||
}
|
||||
|
||||
override fun onDestroyView(view: View) {
|
||||
@@ -190,7 +196,6 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
adapter = null
|
||||
snack = null
|
||||
recycler = null
|
||||
activity!!.root_fab.gone()
|
||||
super.onDestroyView(view)
|
||||
}
|
||||
|
||||
@@ -242,7 +247,7 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
)
|
||||
recycler.clipToPadding = false
|
||||
|
||||
activity!!.root_fab.shrinkOnScroll(recycler)
|
||||
actionFab?.shrinkOnScroll(recycler)
|
||||
}
|
||||
|
||||
recycler.setHasFixedSize(true)
|
||||
|
||||
Reference in New Issue
Block a user