mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 18:15:49 +01:00
Activity Details: Fix table after odd number of cells
This commit is contained in:
parent
c66467a915
commit
58a8c91c80
@ -373,6 +373,10 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
|
|||||||
int cellNumber = 0;
|
int cellNumber = 0;
|
||||||
for (final Pair<String, ActivitySummaryEntry> entry : entries) {
|
for (final Pair<String, ActivitySummaryEntry> entry : entries) {
|
||||||
final int columnSpan = entry.getRight().getColumnSpan();
|
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);
|
LinearLayout linearLayout = generateLinearLayout(cellNumber, cellNumber + 2 >= totalCells, columnSpan);
|
||||||
entry.getRight().populate(entry.getLeft(), linearLayout, workoutValueFormatter);
|
entry.getRight().populate(entry.getLeft(), linearLayout, workoutValueFormatter);
|
||||||
gridLayout.addView(linearLayout);
|
gridLayout.addView(linearLayout);
|
||||||
|
Loading…
Reference in New Issue
Block a user