From 73c14df982448acdd4f6eca11c98f55ba200b676 Mon Sep 17 00:00:00 2001 From: Jobobby04 Date: Sun, 5 Jul 2020 21:46:39 -0400 Subject: [PATCH] Revert "Revert "Combine author and artist fields in manga info"" This reverts commit 1cc36379e0a10fb7fbdf8015b90c551d35c8e03a. --- .../tachiyomi/ui/manga/MangaAllInOneHolder.kt | 32 +++----------- .../ui/manga/info/MangaInfoController.kt | 33 ++------------ .../layout-land/manga_all_in_one_header.xml | 44 ++----------------- .../res/layout-land/manga_info_controller.xml | 43 ++---------------- .../res/layout/manga_all_in_one_header.xml | 44 ++----------------- .../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 - 8 files changed, 25 insertions(+), 219 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaAllInOneHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaAllInOneHolder.kt index 795748a5c..d8246453e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaAllInOneHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaAllInOneHolder.kt @@ -131,27 +131,11 @@ class MangaAllInOneHolder( } .launchIn(adapter.delegate.controllerScope) - binding.mangaArtist.longClicks() - .onEach { - adapter.delegate.copyToClipboard(binding.mangaArtistLabel.text.toString(), binding.mangaArtist.text.toString()) - } - .launchIn(adapter.delegate.controllerScope) - - binding.mangaArtist.clicks() - .onEach { - var text = binding.mangaArtist.text.toString() - if (adapter.delegate.isEHentaiBasedSource()) { - text = adapter.delegate.wrapTag("artist", text) - } - adapter.delegate.performGlobalSearch(text) - } - .launchIn(adapter.delegate.controllerScope) - binding.mangaAuthor.longClicks() .onEach { // EXH Special case E-Hentai/ExHentai to ignore author field (unused) if (!adapter.delegate.isEHentaiBasedSource()) { - adapter.delegate.copyToClipboard(binding.mangaAuthorLabel.text.toString(), binding.mangaAuthor.text.toString()) + adapter.delegate.copyToClipboard("author", binding.mangaAuthor.text.toString()) } } .launchIn(adapter.delegate.controllerScope) @@ -203,18 +187,12 @@ class MangaAllInOneHolder( 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()) { itemView.context.getString(R.string.unknown) } else { - manga.artist - } - - // Update author TextView. - binding.mangaAuthor.text = if (manga.author.isNullOrBlank()) { - itemView.context.getString(R.string.unknown) - } else { - manga.author + authors.joinToString(", ") } // If manga source is known update source TextView. 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 95c3b840f..6935003e2 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 @@ -176,25 +176,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 { - var text = binding.mangaArtist.text.toString() - if (isEHentaiBasedSource()) { - text = wrapTag("artist", text) - } - performGlobalSearch(text) - } - .launchIn(scope) - binding.mangaAuthor.longClicks() .onEach { // EXH Special case E-Hentai/ExHentai to ignore author field (unused) @@ -337,18 +318,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_all_in_one_header.xml b/app/src/main/res/layout-land/manga_all_in_one_header.xml index 2e880ae57..b31bacbb5 100644 --- a/app/src/main/res/layout-land/manga_all_in_one_header.xml +++ b/app/src/main/res/layout-land/manga_all_in_one_header.xml @@ -70,62 +70,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" /> - - - - - - + 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