feat: limit genre tags on home to 2 lines and on result page, 10 tags max (#885)

This commit is contained in:
IndusAryan 2024-01-16 23:11:43 +05:30 committed by GitHub
parent 9733d0b316
commit 601483e103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -81,6 +81,7 @@ class HomeScrollAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
binding.homeScrollPreviewTags.apply {
text = card.tags?.joinToString("") ?: ""
isGone = card.tags.isNullOrEmpty()
maxLines = 2
}
binding.homeScrollPreviewTitle.text = card.name
}

View File

@ -90,8 +90,9 @@ object UIHelper {
if (view == null) return
view.removeAllViews()
val context = view.context ?: return
val maxTags = tags.take(10) // Limited because they are too much
tags.forEach { tag ->
maxTags.forEach { tag ->
val chip = Chip(context)
val chipDrawable = ChipDrawable.createFromAttributes(
context,