Bugfixes for the combined author/atrist field
This commit is contained in:
parent
b1593e3fe7
commit
63744d5fc4
@ -188,7 +188,17 @@ class MangaAllInOneHolder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update author/artist TextView.
|
// Update author/artist TextView.
|
||||||
val authors = listOf(manga.author, manga.artist).filter { !it.isNullOrBlank() }.distinct()
|
|
||||||
|
val authors: MutableSet<String> = mutableSetOf()
|
||||||
|
val author = manga.author
|
||||||
|
val artist = manga.artist
|
||||||
|
val splitRegex = "([,\\-])".toRegex()
|
||||||
|
if (author != null) {
|
||||||
|
authors += author.split(splitRegex).map { it.trim() }.filter { !it.isBlank() }.toMutableSet()
|
||||||
|
}
|
||||||
|
if (artist != null) {
|
||||||
|
authors += artist.split(splitRegex).map { it.trim() }.filter { !it.isBlank() }.toMutableSet()
|
||||||
|
}
|
||||||
binding.mangaAuthor.text = if (authors.isEmpty()) {
|
binding.mangaAuthor.text = if (authors.isEmpty()) {
|
||||||
itemView.context.getString(R.string.unknown)
|
itemView.context.getString(R.string.unknown)
|
||||||
} else {
|
} else {
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
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:maxLines="2"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/manga_full_title"
|
app:layout_constraintTop_toBottomOf="@+id/manga_full_title"
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
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:maxLines="2"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/manga_full_title"
|
app:layout_constraintTop_toBottomOf="@+id/manga_full_title"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user