mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-30 21:17:50 +02:00
Add status icons to manga info (#5832)
* Add icons to manga status * Slightly better formatting Mixed in with a dose of syntactic sugar * Remove unnecessary lines I think they are, at least * Change according to review comments - Fix forgotten Tablet code removal - Change 'android:background' to 'app:srcCompat' * Adjust size of icon Smaller and more fitting to the environment
This commit is contained in:
@ -270,15 +270,17 @@ class MangaInfoHeaderAdapter(
|
||||
}
|
||||
}
|
||||
|
||||
// Update status TextView.
|
||||
binding.mangaStatus.setText(
|
||||
when (manga.status) {
|
||||
SManga.ONGOING -> R.string.ongoing
|
||||
SManga.COMPLETED -> R.string.completed
|
||||
SManga.LICENSED -> R.string.licensed
|
||||
else -> R.string.unknown_status
|
||||
// Update manga status.
|
||||
binding.apply {
|
||||
val (statusDrawable, statusString) = when (manga.status) {
|
||||
SManga.ONGOING -> R.drawable.ic_status_ongoing_24dp to R.string.ongoing
|
||||
SManga.COMPLETED -> R.drawable.ic_status_completed_24dp to R.string.completed
|
||||
SManga.LICENSED -> R.drawable.ic_status_licensed_24dp to R.string.licensed
|
||||
else -> R.drawable.ic_status_unknown_24dp to R.string.unknown
|
||||
}
|
||||
)
|
||||
mangaStatusIcon.setImageResource(statusDrawable)
|
||||
mangaStatus.setText(statusString)
|
||||
}
|
||||
|
||||
// Set the favorite drawable to the correct one.
|
||||
setFavoriteButtonState(manga.favorite)
|
||||
|
Reference in New Issue
Block a user