From 9d400010562370629790c0a1f575ad13888d7751 Mon Sep 17 00:00:00 2001 From: razeeman Date: Sun, 22 Dec 2024 10:21:58 +0300 Subject: [PATCH] fix goal excess range buttons margin --- .../mapper/StatisticsDetailViewDataMapper.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/features/feature_statistics_detail/src/main/java/com/example/util/simpletimetracker/feature_statistics_detail/mapper/StatisticsDetailViewDataMapper.kt b/features/feature_statistics_detail/src/main/java/com/example/util/simpletimetracker/feature_statistics_detail/mapper/StatisticsDetailViewDataMapper.kt index c581bbf72..5445d32f5 100644 --- a/features/feature_statistics_detail/src/main/java/com/example/util/simpletimetracker/feature_statistics_detail/mapper/StatisticsDetailViewDataMapper.kt +++ b/features/feature_statistics_detail/src/main/java/com/example/util/simpletimetracker/feature_statistics_detail/mapper/StatisticsDetailViewDataMapper.kt @@ -779,9 +779,12 @@ class StatisticsDetailViewDataMapper @Inject constructor( } if (chartLengthViewData.isNotEmpty()) { + // Update margin top depending if has buttons before. + val hasButtonsBefore = items.lastOrNull() is StatisticsDetailButtonsRowViewData + val marginTopDp = if (hasButtonsBefore) -10 else 4 items += StatisticsDetailButtonsRowViewData( block = StatisticsDetailBlock.GoalChartLength, - marginTopDp = -10, + marginTopDp = marginTopDp, data = chartLengthViewData, ) }