diff options
Diffstat (limited to 'android/app/src')
| -rw-r--r-- | android/app/src/main/java/org/terst/doot/widget/ui/WidgetRows.kt | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/android/app/src/main/java/org/terst/doot/widget/ui/WidgetRows.kt b/android/app/src/main/java/org/terst/doot/widget/ui/WidgetRows.kt index 6515131..750dc7b 100644 --- a/android/app/src/main/java/org/terst/doot/widget/ui/WidgetRows.kt +++ b/android/app/src/main/java/org/terst/doot/widget/ui/WidgetRows.kt @@ -350,33 +350,40 @@ fun TomorrowSection( zone: ZoneId, textSize: WidgetTextSize ) { - Box(modifier = GlanceModifier.fillMaxWidth().height(1.dp).padding(vertical = 4.dp).background(Color(0x1AFFFFFF))) {} + // This whole section renders inside a single LazyColumn `item { }` slot + // (see DootWidget.kt), which composes to one RemoteViews node -- without + // an explicit Column wrapping the divider/header/rows below, they have + // no shared vertical-flow container and all stack at the same position + // instead of flowing top-to-bottom. + Column(modifier = GlanceModifier.fillMaxWidth()) { + Box(modifier = GlanceModifier.fillMaxWidth().height(1.dp).padding(vertical = 4.dp).background(Color(0x1AFFFFFF))) {} - Row(modifier = GlanceModifier.fillMaxWidth().padding(top = 6.dp, bottom = 2.dp)) { - Text( - "TOMORROW", - style = TextStyle( - color = ColorProvider(Color(0x99FFFFFF)), - fontSize = textSize.scaledHeaderSize(11), - fontWeight = textSize.scaledHeaderWeight(FontWeight.Bold) + Row(modifier = GlanceModifier.fillMaxWidth().padding(top = 6.dp, bottom = 2.dp)) { + Text( + "TOMORROW", + style = TextStyle( + color = ColorProvider(Color(0x99FFFFFF)), + fontSize = textSize.scaledHeaderSize(11), + fontWeight = textSize.scaledHeaderWeight(FontWeight.Bold) + ) ) - ) - } + } - allDayEvents.forEach { AllDayRow(it, textSize) } - multiDayEvents.forEach { (item, variant) -> AllDayRow(item, textSize, variant) } + allDayEvents.forEach { AllDayRow(it, textSize) } + multiDayEvents.forEach { (item, variant) -> AllDayRow(item, textSize, variant) } - items.forEach { item -> - val isPast = false - if (item.type == "event") { - TomorrowEventRow(item, zone, textSize) - } else { - TaskRow(item, textSize) + items.forEach { item -> + val isPast = false + if (item.type == "event") { + TomorrowEventRow(item, zone, textSize) + } else { + TaskRow(item, textSize) + } } - } - fragments.forEach { frag -> - frag.slots.forEach { slot -> TaskRow(slot.task, textSize) } + fragments.forEach { frag -> + frag.slots.forEach { slot -> TaskRow(slot.task, textSize) } + } } } |
