From 395ca3630c8cf3cd608f1b9093e3894518683516 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 13 Jun 2020 16:25:26 -0400 Subject: [PATCH] Combine author and artist fields in manga info --- .../ui/manga/info/MangaInfoController.kt | 29 ++---------- .../res/layout-land/manga_info_controller.xml | 43 ++---------------- .../main/res/layout/manga_info_controller.xml | 44 ++----------------- app/src/main/res/layout/source_list_item.xml | 2 - app/src/main/res/values/strings.xml | 2 - 5 files changed, 12 insertions(+), 108 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 5b49905b0d..620df130f0 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 @@ -137,21 +137,6 @@ class MangaInfoController(private val fromSource: Boolean = false) : } .launchIn(scope) - binding.mangaArtist.longClicks() - .onEach { - activity?.copyToClipboard( - binding.mangaArtistLabel.text.toString(), - binding.mangaArtist.text.toString() - ) - } - .launchIn(scope) - - binding.mangaArtist.clicks() - .onEach { - performGlobalSearch(binding.mangaArtist.text.toString()) - } - .launchIn(scope) - binding.mangaAuthor.longClicks() .onEach { activity?.copyToClipboard( @@ -231,18 +216,12 @@ class MangaInfoController(private val fromSource: Boolean = false) : manga.title } - // Update artist TextView. - binding.mangaArtist.text = if (manga.artist.isNullOrBlank()) { + // Update author/artist TextView. + val authors = listOf(manga.author, manga.artist).filter { !it.isNullOrBlank() }.distinct() + binding.mangaAuthor.text = if (authors.isEmpty()) { view.context.getString(R.string.unknown) } else { - manga.artist - } - - // Update author TextView. - binding.mangaAuthor.text = if (manga.author.isNullOrBlank()) { - view.context.getString(R.string.unknown) - } else { - manga.author + authors.joinToString(", ") } // If manga source is known update source TextView. diff --git a/app/src/main/res/layout-land/manga_info_controller.xml b/app/src/main/res/layout-land/manga_info_controller.xml index 24c9761b23..934dd9c4b9 100644 --- a/app/src/main/res/layout-land/manga_info_controller.xml +++ b/app/src/main/res/layout-land/manga_info_controller.xml @@ -53,61 +53,26 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - - - - - - + app:layout_constraintTop_toBottomOf="@+id/manga_full_title" + tools:text="Author" /> + app:layout_constraintTop_toBottomOf="@+id/manga_author" /> - - - - - - + app:layout_constraintTop_toBottomOf="@+id/manga_full_title" + tools:text="Author" /> + app:layout_constraintTop_toBottomOf="@+id/manga_author" /> Title Added to library Removed from library - Author - Artist Chapters Last chapter Updated