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

This commit is contained in:
IndusAryan 2024-01-15 23:47:23 +05:30
parent 9f1b172f34
commit 8d4747e94a
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,