Activity Details: Fix table after odd number of cells

This commit is contained in:
José Rebelo 2024-10-13 19:55:01 +01:00
parent c66467a915
commit 58a8c91c80

View File

@ -373,6 +373,10 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
int cellNumber = 0;
for (final Pair<String, ActivitySummaryEntry> 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);