mirror of
https://github.com/mihonapp/mihon.git
synced 2025-07-01 05:27:50 +02:00
Restore separate artist field
This commit is contained in:
@ -6,6 +6,7 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import eu.kanade.tachiyomi.R
|
||||
@ -143,6 +144,21 @@ class MangaInfoHeaderAdapter(
|
||||
}
|
||||
.launchIn(scope)
|
||||
|
||||
binding.mangaArtist.longClicks()
|
||||
.onEach {
|
||||
controller.activity?.copyToClipboard(
|
||||
binding.mangaArtist.text.toString(),
|
||||
binding.mangaArtist.text.toString()
|
||||
)
|
||||
}
|
||||
.launchIn(scope)
|
||||
|
||||
binding.mangaArtist.clicks()
|
||||
.onEach {
|
||||
controller.performGlobalSearch(binding.mangaArtist.text.toString())
|
||||
}
|
||||
.launchIn(scope)
|
||||
|
||||
binding.mangaSummary.longClicks()
|
||||
.onEach {
|
||||
controller.activity?.copyToClipboard(
|
||||
@ -172,19 +188,25 @@ class MangaInfoHeaderAdapter(
|
||||
* @param source the source of the manga.
|
||||
*/
|
||||
private fun setMangaInfo(manga: Manga, source: Source?) {
|
||||
// update full title TextView.
|
||||
// Update full title TextView.
|
||||
binding.mangaFullTitle.text = if (manga.title.isBlank()) {
|
||||
view.context.getString(R.string.unknown)
|
||||
} else {
|
||||
manga.title
|
||||
}
|
||||
|
||||
// Update author/artist TextView.
|
||||
val authors = listOf(manga.author, manga.artist).filter { !it.isNullOrBlank() }.distinct()
|
||||
binding.mangaAuthor.text = if (authors.isEmpty()) {
|
||||
// Update author TextView.
|
||||
binding.mangaAuthor.text = if (manga.author.isNullOrBlank()) {
|
||||
view.context.getString(R.string.unknown)
|
||||
} else {
|
||||
authors.joinToString(", ")
|
||||
manga.author
|
||||
}
|
||||
|
||||
// Update artist TextView.
|
||||
val hasArtist = !manga.artist.isNullOrBlank() && manga.artist != manga.author
|
||||
binding.mangaArtist.isVisible = hasArtist
|
||||
if (hasArtist) {
|
||||
binding.mangaArtist.text = manga.artist
|
||||
}
|
||||
|
||||
// If manga source is known update source TextView.
|
||||
|
Reference in New Issue
Block a user