Skip to content
Snippets Groups Projects
Commit 5ad9172e authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Fix history screen not searchable

Fixes #947
parent e3fd0f3f
No related branches found
No related tags found
1 merge request!220Fix history screen not searchable
Pipeline #9038 passed with stage
in 27 minutes and 4 seconds
......@@ -69,7 +69,7 @@ class HistoryFragment : MediaBrowserFragment<HistoryModel>(), IRefreshable, IHis
historyAdapter.update(it)
updateEmptyView()
if (::cleanMenuItem.isInitialized) {
cleanMenuItem.isVisible = !isEmpty()
cleanMenuItem.isVisible = list.isNotEmpty()
}
}
})
......@@ -101,13 +101,8 @@ class HistoryFragment : MediaBrowserFragment<HistoryModel>(), IRefreshable, IHis
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
inflater.inflate(R.menu.fragment_option_history, menu)
super.onCreateOptionsMenu(menu, inflater)
activity?.invalidateOptionsMenu()
}
override fun onPrepareOptionsMenu(menu: Menu) {
cleanMenuItem = menu.findItem(R.id.ml_menu_clean)
cleanMenuItem.isVisible = !isEmpty()
super.onPrepareOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment