More minor refactorings

Extracted from #7244

Co-authored-by: ivaniskandar <ivaniskandar@users.noreply.github.com>
This commit is contained in:
arkon
2022-06-19 17:32:31 -04:00
parent 68c47a3238
commit cb1830d747
10 changed files with 34 additions and 37 deletions
@@ -84,7 +84,7 @@ class SearchController(
if (!isReplacingManga) {
router.popController(this)
if (newManga != null) {
val newMangaController = RouterTransaction.with(MangaController(newManga))
val newMangaController = RouterTransaction.with(MangaController(newManga.id!!))
if (router.backstack.lastOrNull()?.controller is MangaController) {
// Replace old MangaController
router.replaceTopController(newMangaController)
@@ -140,7 +140,7 @@ class SearchController(
}
.setNeutralButton(activity?.getString(R.string.action_show_manga)) { _, _ ->
dismissDialog()
router.pushController(MangaController(newManga))
router.pushController(MangaController(newManga!!.id!!))
}
.create()
}
@@ -575,7 +575,7 @@ open class BrowseSourceController(bundle: Bundle) :
*/
override fun onItemClick(view: View, position: Int): Boolean {
val item = adapter?.getItem(position) as? SourceItem ?: return false
router.pushController(MangaController(item.manga, true))
router.pushController(MangaController(item.manga.id!!, true))
return false
}
@@ -65,7 +65,7 @@ open class GlobalSearchController(
* @param manga clicked item containing manga information.
*/
override fun onMangaClick(manga: Manga) {
router.pushController(MangaController(manga, true))
router.pushController(MangaController(manga.id!!, true))
}
/**