From 601483e103218220f456aea060e02f938216a92e Mon Sep 17 00:00:00 2001 From: IndusAryan <125901294+IndusAryan@users.noreply.github.com> Date: Tue, 16 Jan 2024 23:11:43 +0530 Subject: [PATCH] feat: limit genre tags on home to 2 lines and on result page, 10 tags max (#885) --- .../com/lagradost/cloudstream3/ui/home/HomeScrollAdapter.kt | 1 + app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeScrollAdapter.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeScrollAdapter.kt index 9d95a5fa..666fbc24 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeScrollAdapter.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeScrollAdapter.kt @@ -81,6 +81,7 @@ class HomeScrollAdapter : RecyclerView.Adapter() { binding.homeScrollPreviewTags.apply { text = card.tags?.joinToString(" • ") ?: "" isGone = card.tags.isNullOrEmpty() + maxLines = 2 } binding.homeScrollPreviewTitle.text = card.name } diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt index 1da644e5..388a0c3c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt @@ -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,