Improving genre search started from the manga page of a popular manga (#4375)
Co-authored-by: E3FxGaming <E3FxGaming@users.noreply.github.com>
This commit is contained in:
@@ -638,6 +638,29 @@ class MangaController :
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a genre search using the provided genre name.
|
||||
*
|
||||
* @param genreName the search genre to the parent controller
|
||||
*/
|
||||
fun performGenreSearch(genreName: String) {
|
||||
if (router.backstackSize < 2) {
|
||||
return
|
||||
}
|
||||
|
||||
val previousController = router.backstack[router.backstackSize - 2].controller
|
||||
val presenterSource = presenter.source
|
||||
|
||||
if (previousController is BrowseSourceController &&
|
||||
presenterSource is HttpSource
|
||||
) {
|
||||
router.handleBack()
|
||||
previousController.searchWithGenre(genreName)
|
||||
} else {
|
||||
performSearch(genreName)
|
||||
}
|
||||
}
|
||||
|
||||
private fun shareCover() {
|
||||
try {
|
||||
val activity = activity!!
|
||||
|
||||
@@ -262,11 +262,11 @@ class MangaInfoHeaderAdapter(
|
||||
if (!manga.genre.isNullOrBlank()) {
|
||||
binding.mangaGenresTagsCompactChips.setChips(
|
||||
manga.getGenres(),
|
||||
controller::performSearch
|
||||
controller::performGenreSearch
|
||||
)
|
||||
binding.mangaGenresTagsFullChips.setChips(
|
||||
manga.getGenres(),
|
||||
controller::performSearch
|
||||
controller::performGenreSearch
|
||||
)
|
||||
} else {
|
||||
binding.mangaGenresTagsCompactChips.isVisible = false
|
||||
|
||||
Reference in New Issue
Block a user