From 58a8c91c80fc0748ec2fda9b8964076767d316fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Sun, 13 Oct 2024 19:55:01 +0100 Subject: [PATCH] Activity Details: Fix table after odd number of cells --- .../gadgetbridge/activities/ActivitySummaryDetail.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ActivitySummaryDetail.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ActivitySummaryDetail.java index 996b03198..ee700c559 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ActivitySummaryDetail.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ActivitySummaryDetail.java @@ -373,6 +373,10 @@ public class ActivitySummaryDetail extends AbstractGBActivity { int cellNumber = 0; for (final Pair entry : entries) { final int columnSpan = entry.getRight().getColumnSpan(); + if (columnSpan == 2 && cellNumber % 2 != 0) { + // This entry needs 2 columns, so let's move to the next row + cellNumber++; + } LinearLayout linearLayout = generateLinearLayout(cellNumber, cellNumber + 2 >= totalCells, columnSpan); entry.getRight().populate(entry.getLeft(), linearLayout, workoutValueFormatter); gridLayout.addView(linearLayout);