From a5d9fb518a9f4457a3224f4ddc6e5f9124528057 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 19 Apr 2020 15:12:46 -0400 Subject: [PATCH] Minor edits --- .../ui/manga/info/MangaInfoController.kt | 16 +++++++++------- .../main/res/layout/manga_info_controller.xml | 9 --------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt index b3e2baecc..ec0070fd2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt @@ -284,24 +284,26 @@ class MangaInfoController(private val fromSource: Boolean = false) : } private fun toggleMangaInfo(context: Context) { + val isExpanded = binding.mangaInfoToggle.text == context.getString(R.string.manga_info_collapse) + binding.mangaInfoToggle.text = - if (binding.mangaInfoToggle.text == context.getString(R.string.manga_info_expand)) - context.getString(R.string.manga_info_collapse) - else + if (isExpanded) context.getString(R.string.manga_info_expand) + else + context.getString(R.string.manga_info_collapse) with(binding.mangaSummary) { maxLines = - if (maxLines == Int.MAX_VALUE) + if (isExpanded) 3 else Int.MAX_VALUE ellipsize = - if (ellipsize == TextUtils.TruncateAt.END) - null - else + if (isExpanded) TextUtils.TruncateAt.END + else + null } binding.mangaGenresTags.toggle() diff --git a/app/src/main/res/layout/manga_info_controller.xml b/app/src/main/res/layout/manga_info_controller.xml index 3a7309b7a..a724c1edc 100644 --- a/app/src/main/res/layout/manga_info_controller.xml +++ b/app/src/main/res/layout/manga_info_controller.xml @@ -206,15 +206,6 @@ android:text="@string/add_to_library" app:icon="@drawable/ic_add_to_library_24dp" /> - - - - - - - - -