From 25a0f44324b5c893b7eabe3461d66a2170ba2092 Mon Sep 17 00:00:00 2001 From: mars885 Date: Thu, 15 Aug 2024 01:53:15 +0300 Subject: [PATCH] Fix title's constraint layout params --- .../ui/widgets/categorypreview/GamesCategoryPreview.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common-ui-widgets/src/main/java/com/paulrybitskyi/gamedge/common/ui/widgets/categorypreview/GamesCategoryPreview.kt b/common-ui-widgets/src/main/java/com/paulrybitskyi/gamedge/common/ui/widgets/categorypreview/GamesCategoryPreview.kt index cf59152d4..960fc644a 100644 --- a/common-ui-widgets/src/main/java/com/paulrybitskyi/gamedge/common/ui/widgets/categorypreview/GamesCategoryPreview.kt +++ b/common-ui-widgets/src/main/java/com/paulrybitskyi/gamedge/common/ui/widgets/categorypreview/GamesCategoryPreview.kt @@ -70,10 +70,16 @@ fun GamesCategoryPreview( Title( title = title, modifier = Modifier.constrainAs(titleRef) { + val endAnchor = when { + isProgressBarVisible -> progressBarRef.start + isMoreButtonVisible -> moreBtnRef.start + else -> parent.end + } + width = Dimension.fillToConstraints top.linkTo(parent.top, titleRefMargin) start.linkTo(parent.start, titleRefMargin) - end.linkTo(progressBarRef.start, titleRefMargin) + end.linkTo(endAnchor, titleRefMargin) }, )