Hide search on unsupported sources
This commit is contained in:
@@ -111,6 +111,7 @@ class RemoteListFragment : MangaListFragment(), FilterOwner {
|
||||
|
||||
override fun onPrepareMenu(menu: Menu) {
|
||||
super.onPrepareMenu(menu)
|
||||
menu.findItem(R.id.action_search)?.isVisible = viewModel.isSearchAvailable
|
||||
menu.findItem(R.id.action_random)?.isEnabled = !viewModel.isRandomLoading.value
|
||||
menu.findItem(R.id.action_filter_reset)?.isVisible = viewModel.header.value.isFilterApplied
|
||||
}
|
||||
|
||||
@@ -68,6 +68,9 @@ open class RemoteListViewModel @Inject constructor(
|
||||
private var loadingJob: Job? = null
|
||||
private var randomJob: Job? = null
|
||||
|
||||
val isSearchAvailable: Boolean
|
||||
get() = repository.isSearchSupported
|
||||
|
||||
override val content = combine(
|
||||
mangaList.map { it?.distinctById()?.skipNsfwIfNeeded() },
|
||||
listMode,
|
||||
|
||||
Reference in New Issue
Block a user