Migrate Source Filter Screen to Compose (#7031)

* Migrate Source Filter Screen to Compose

* Changes from Review and some more fixes

* Rename some variable and classes

* Review Change

* Ewbase and Review changes
This commit is contained in:
FourTOne5
2022-04-30 08:49:02 -07:00
committed by GitHub
parent cccd09fb5c
commit 23f8f35354
14 changed files with 324 additions and 123 deletions

View File

@@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.update
import rx.Observable
@@ -18,6 +19,8 @@ open class SourceManager(private val context: Context) {
private val _catalogueSources: MutableStateFlow<List<CatalogueSource>> = MutableStateFlow(listOf())
val catalogueSources: Flow<List<CatalogueSource>> = _catalogueSources
val onlineSources: Flow<List<HttpSource>> =
_catalogueSources.map { sources -> sources.filterIsInstance<HttpSource>() }
init {
createInternalSources().forEach { registerSource(it) }