Move SmartSearchConfig around

This commit is contained in:
Jobobby04
2022-12-03 00:19:24 -05:00
parent 8e2f5aa495
commit 07c7ec972d
11 changed files with 28 additions and 57 deletions
@@ -5,14 +5,14 @@ import androidx.compose.runtime.Composable
import androidx.core.os.bundleOf
import cafe.adriel.voyager.navigator.Navigator
import eu.kanade.tachiyomi.ui.base.controller.BasicFullComposeController
import eu.kanade.tachiyomi.ui.browse.source.SourcesController
import eu.kanade.tachiyomi.ui.browse.source.SourcesScreen
import eu.kanade.tachiyomi.util.system.getSerializableCompat
class SmartSearchController(bundle: Bundle) : BasicFullComposeController() {
private val sourceId = bundle.getLong(ARG_SOURCE_ID, -1)
private val smartSearchConfig = bundle.getSerializableCompat<SourcesController.SmartSearchConfig>(ARG_SMART_SEARCH_CONFIG)!!
private val smartSearchConfig = bundle.getSerializableCompat<SourcesScreen.SmartSearchConfig>(ARG_SMART_SEARCH_CONFIG)!!
constructor(sourceId: Long, smartSearchConfig: SourcesController.SmartSearchConfig) : this(
constructor(sourceId: Long, smartSearchConfig: SourcesScreen.SmartSearchConfig) : this(
bundleOf(
ARG_SOURCE_ID to sourceId,
ARG_SMART_SEARCH_CONFIG to smartSearchConfig,
@@ -25,12 +25,12 @@ import eu.kanade.presentation.components.Scaffold
import eu.kanade.presentation.util.LocalRouter
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
import eu.kanade.tachiyomi.ui.browse.source.SourcesController
import eu.kanade.tachiyomi.ui.browse.source.SourcesScreen
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceController
import eu.kanade.tachiyomi.ui.manga.MangaController
import eu.kanade.tachiyomi.util.system.toast
class SmartSearchScreen(private val sourceId: Long, private val smartSearchConfig: SourcesController.SmartSearchConfig) : Screen {
class SmartSearchScreen(private val sourceId: Long, private val smartSearchConfig: SourcesScreen.SmartSearchConfig) : Screen {
@Composable
override fun Content() {
@@ -6,7 +6,7 @@ import eu.kanade.domain.manga.interactor.NetworkToLocalManga
import eu.kanade.domain.manga.model.Manga
import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.source.SourceManager
import eu.kanade.tachiyomi.ui.browse.source.SourcesController
import eu.kanade.tachiyomi.ui.browse.source.SourcesScreen
import eu.kanade.tachiyomi.util.lang.launchIO
import exh.smartsearch.SmartSearchEngine
import kotlinx.coroutines.CancellationException
@@ -15,7 +15,7 @@ import uy.kohesive.injekt.api.get
class SmartSearchScreenModel(
private val sourceId: Long,
private val config: SourcesController.SmartSearchConfig,
private val config: SourcesScreen.SmartSearchConfig,
private val networkToLocalManga: NetworkToLocalManga = Injekt.get(),
private val sourceManager: SourceManager = Injekt.get(),
) : StateScreenModel<SmartSearchScreenModel.SearchResults?>(null) {