mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 02:19:16 +01:00
Combine author and artist fields in manga info
This commit is contained in:
parent
e9fbdb660b
commit
395ca3630c
@ -137,21 +137,6 @@ class MangaInfoController(private val fromSource: Boolean = false) :
|
|||||||
}
|
}
|
||||||
.launchIn(scope)
|
.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()
|
binding.mangaAuthor.longClicks()
|
||||||
.onEach {
|
.onEach {
|
||||||
activity?.copyToClipboard(
|
activity?.copyToClipboard(
|
||||||
@ -231,18 +216,12 @@ class MangaInfoController(private val fromSource: Boolean = false) :
|
|||||||
manga.title
|
manga.title
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update artist TextView.
|
// Update author/artist TextView.
|
||||||
binding.mangaArtist.text = if (manga.artist.isNullOrBlank()) {
|
val authors = listOf(manga.author, manga.artist).filter { !it.isNullOrBlank() }.distinct()
|
||||||
|
binding.mangaAuthor.text = if (authors.isEmpty()) {
|
||||||
view.context.getString(R.string.unknown)
|
view.context.getString(R.string.unknown)
|
||||||
} else {
|
} else {
|
||||||
manga.artist
|
authors.joinToString(", ")
|
||||||
}
|
|
||||||
|
|
||||||
// Update author TextView.
|
|
||||||
binding.mangaAuthor.text = if (manga.author.isNullOrBlank()) {
|
|
||||||
view.context.getString(R.string.unknown)
|
|
||||||
} else {
|
|
||||||
manga.author
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If manga source is known update source TextView.
|
// If manga source is known update source TextView.
|
||||||
|
@ -53,61 +53,26 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/manga_author_label"
|
|
||||||
style="@style/TextAppearance.Medium.Body2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/manga_info_author_label"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/manga_full_title" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/manga_author"
|
android:id="@+id/manga_author"
|
||||||
style="@style/TextAppearance.Regular.Body1.Secondary"
|
style="@style/TextAppearance.Regular.Body1.Secondary"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
app:layout_constraintBaseline_toBaselineOf="@+id/manga_author_label"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/manga_author_label" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/manga_artist_label"
|
|
||||||
style="@style/TextAppearance.Medium.Body2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/manga_info_artist_label"
|
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/manga_author_label" />
|
app:layout_constraintTop_toBottomOf="@+id/manga_full_title"
|
||||||
|
tools:text="Author" />
|
||||||
<TextView
|
|
||||||
android:id="@+id/manga_artist"
|
|
||||||
style="@style/TextAppearance.Regular.Body1.Secondary"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
app:layout_constraintBaseline_toBaselineOf="@+id/manga_artist_label"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/manga_artist_label" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/manga_chapters_label"
|
android:id="@+id/manga_chapters_label"
|
||||||
style="@style/TextAppearance.Medium.Body2"
|
style="@style/TextAppearance.Medium.Body2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
android:text="@string/manga_info_last_chapter_label"
|
android:text="@string/manga_info_last_chapter_label"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/manga_artist_label" />
|
app:layout_constraintTop_toBottomOf="@+id/manga_author" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/manga_chapters"
|
android:id="@+id/manga_chapters"
|
||||||
|
@ -70,7 +70,6 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:paddingBottom="8dp"
|
|
||||||
android:text="@string/manga_info_full_title_label"
|
android:text="@string/manga_info_full_title_label"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
app:autoSizeMaxTextSize="20sp"
|
app:autoSizeMaxTextSize="20sp"
|
||||||
@ -80,62 +79,27 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/manga_author_label"
|
|
||||||
style="@style/TextAppearance.Medium.Body2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/manga_info_author_label"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/manga_full_title" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/manga_author"
|
android:id="@+id/manga_author"
|
||||||
style="@style/TextAppearance.Regular.Body1.Secondary"
|
style="@style/TextAppearance.Regular.Body1.Secondary"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
app:layout_constraintBaseline_toBaselineOf="@+id/manga_author_label"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/manga_author_label" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/manga_artist_label"
|
|
||||||
style="@style/TextAppearance.Medium.Body2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/manga_info_artist_label"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/manga_author_label" />
|
app:layout_constraintTop_toBottomOf="@+id/manga_full_title"
|
||||||
|
tools:text="Author" />
|
||||||
<TextView
|
|
||||||
android:id="@+id/manga_artist"
|
|
||||||
style="@style/TextAppearance.Regular.Body1.Secondary"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
app:layout_constraintBaseline_toBaselineOf="@+id/manga_artist_label"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/manga_artist_label" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/manga_chapters_label"
|
android:id="@+id/manga_chapters_label"
|
||||||
style="@style/TextAppearance.Medium.Body2"
|
style="@style/TextAppearance.Medium.Body2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
android:text="@string/manga_info_last_chapter_label"
|
android:text="@string/manga_info_last_chapter_label"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/manga_artist_label" />
|
app:layout_constraintTop_toBottomOf="@+id/manga_author" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/manga_chapters"
|
android:id="@+id/manga_chapters"
|
||||||
|
@ -26,9 +26,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
@ -459,8 +459,6 @@
|
|||||||
<string name="manga_info_full_title_label">Title</string>
|
<string name="manga_info_full_title_label">Title</string>
|
||||||
<string name="manga_added_library">Added to library</string>
|
<string name="manga_added_library">Added to library</string>
|
||||||
<string name="manga_removed_library">Removed from library</string>
|
<string name="manga_removed_library">Removed from library</string>
|
||||||
<string name="manga_info_author_label">Author</string>
|
|
||||||
<string name="manga_info_artist_label">Artist</string>
|
|
||||||
<string name="manga_info_chapters_label">Chapters</string>
|
<string name="manga_info_chapters_label">Chapters</string>
|
||||||
<string name="manga_info_last_chapter_label">Last chapter</string>
|
<string name="manga_info_last_chapter_label">Last chapter</string>
|
||||||
<string name="manga_info_latest_data_label">Updated</string>
|
<string name="manga_info_latest_data_label">Updated</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user