Update explore navigation

This commit is contained in:
Koitharu
2023-11-12 13:15:30 +02:00
parent b093a885c9
commit b928c4123c
7 changed files with 23 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ class SourcesManageFragment :
override fun onResume() {
super.onResume()
activity?.setTitle(R.string.remote_sources)
activity?.setTitle(R.string.manage_sources)
}
override fun onDestroyView() {

View File

@@ -31,6 +31,7 @@ class SourcesCatalogViewModel @Inject constructor(
) : BaseViewModel() {
private val lifecycle = RetainedLifecycleImpl()
private var searchQuery: String = ""
val onActionDone = MutableEventFlow<ReversibleAction>()
val contentType = MutableStateFlow(ContentType.entries.first())
val locales = getLocalesImpl()
@@ -40,7 +41,9 @@ class SourcesCatalogViewModel @Inject constructor(
locale,
contentType,
) { lc, type ->
listProducerFactory.create(lc, type, lifecycle)
listProducerFactory.create(lc, type, lifecycle).also {
it.setQuery(searchQuery)
}
}.stateIn(viewModelScope, SharingStarted.Eagerly, null)
val content = listProducer.flatMapLatest {
@@ -53,6 +56,7 @@ class SourcesCatalogViewModel @Inject constructor(
}
fun performSearch(query: String) {
searchQuery = query
listProducer.value?.setQuery(query)
}