|
@@ -15,6 +15,7 @@ import eu.kanade.tachiyomi.databinding.GlobalSearchControllerBinding
|
|
import eu.kanade.tachiyomi.source.CatalogueSource
|
|
import eu.kanade.tachiyomi.source.CatalogueSource
|
|
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
|
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
|
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
|
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
|
|
|
+import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceController
|
|
import eu.kanade.tachiyomi.ui.manga.MangaController
|
|
import eu.kanade.tachiyomi.ui.manga.MangaController
|
|
import kotlinx.coroutines.flow.filterIsInstance
|
|
import kotlinx.coroutines.flow.filterIsInstance
|
|
import kotlinx.coroutines.flow.launchIn
|
|
import kotlinx.coroutines.flow.launchIn
|
|
@@ -31,7 +32,8 @@ open class GlobalSearchController(
|
|
protected val initialQuery: String? = null,
|
|
protected val initialQuery: String? = null,
|
|
protected val extensionFilter: String? = null
|
|
protected val extensionFilter: String? = null
|
|
) : NucleusController<GlobalSearchControllerBinding, GlobalSearchPresenter>(),
|
|
) : NucleusController<GlobalSearchControllerBinding, GlobalSearchPresenter>(),
|
|
- GlobalSearchCardAdapter.OnMangaClickListener {
|
|
|
|
|
|
+ GlobalSearchCardAdapter.OnMangaClickListener,
|
|
|
|
+ GlobalSearchAdapter.OnTitleClickListener {
|
|
|
|
|
|
/**
|
|
/**
|
|
* Adapter containing search results grouped by lang.
|
|
* Adapter containing search results grouped by lang.
|
|
@@ -190,4 +192,12 @@ open class GlobalSearchController(
|
|
fun onMangaInitialized(source: CatalogueSource, manga: Manga) {
|
|
fun onMangaInitialized(source: CatalogueSource, manga: Manga) {
|
|
getHolder(source)?.setImage(manga)
|
|
getHolder(source)?.setImage(manga)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Opens a catalogue with the given search.
|
|
|
|
+ */
|
|
|
|
+ override fun onTitleClick(source: CatalogueSource) {
|
|
|
|
+ presenter.preferences.lastUsedCatalogueSource().set(source.id)
|
|
|
|
+ router.pushController(BrowseSourceController(source, presenter.query).withFadeTransaction())
|
|
|
|
+ }
|
|
}
|
|
}
|