From 088160ed323a8e542746b770635001fb7505124c Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 17 Apr 2020 19:51:57 -0400 Subject: [PATCH] Extra genre chip text trimming --- .../ui/manga/info/MangaInfoController.kt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 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 ae2f3380a..109148369 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 @@ -245,14 +245,16 @@ class MangaInfoController : NucleusController(), if (!manga.genre.isNullOrBlank()) { binding.mangaGenresTags.removeAllViews() - manga.genre?.split(", ")?.forEach { genre -> - val chip = Chip(view.context).apply { - text = genre - setOnClickListener { performSearch(genre) } - } + manga.genre?.split(", ").orEmpty() + .map { it.trim() } + .forEach { genre -> + val chip = Chip(view.context).apply { + text = genre + setOnClickListener { performSearch(genre) } + } - binding.mangaGenresTags.addView(chip) - } + binding.mangaGenresTags.addView(chip) + } } // Update description TextView.