From f66aff9ed7722d653b60c1392fdeea67fdfa49db Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 17 Jul 2020 16:29:59 -0400 Subject: [PATCH] Toggle about section when tapping on header/empty space (cherry picked from commit d7a70b962b28160b524d69c6767c6624079bf0b4) --- .../tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt index 393969bda..b2b392a56 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt @@ -38,8 +38,10 @@ import exh.util.makeSearchChip import exh.util.setChipsExtended import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.Job import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.merge import kotlinx.coroutines.flow.onEach import reactivecircus.flowbinding.android.view.clicks import reactivecircus.flowbinding.android.view.longClicks @@ -249,6 +251,7 @@ class MangaInfoHeaderAdapter( * @param manga manga object containing information about manga. * @param source the source of the manga. */ + @ExperimentalCoroutinesApi private fun setMangaInfo(manga: Manga, source: Source?) { // Update full title TextView. binding.mangaFullTitle.text = if (manga.title.isBlank()) { @@ -349,10 +352,7 @@ class MangaInfoHeaderAdapter( } // Handle showing more or less info - binding.mangaSummary.clicks() - .onEach { toggleMangaInfo(view.context) } - .launchIn(scope) - binding.mangaInfoToggle.clicks() + merge(view.clicks(), binding.mangaSummary.clicks(), binding.mangaInfoToggle.clicks()) .onEach { toggleMangaInfo(view.context) } .launchIn(scope)