Merge "Switch to release variants of the xcframework dependencies." into androidx-main
diff --git a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/GalleryTemplateLayouts.kt b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/GalleryTemplateLayouts.kt
index d59b2d4..555356f 100644
--- a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/GalleryTemplateLayouts.kt
+++ b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/GalleryTemplateLayouts.kt
@@ -158,8 +158,12 @@
@Composable
private fun HeaderAndTextBlocks(data: GalleryTemplateData, modifier: GlanceModifier) {
+ // TODO(b/247613894): Weird that we add space after header block but not after text block. For
+ // consistency should we handle all the spacing here rather than in the sub-template functions?
Column(modifier = modifier) {
HeaderBlockTemplate(data.header)
+ // TODO(b/247613894): Should this space always be added? The blocks below may be empty,
+ // which would lead to extra spacing at the bottom
Spacer(modifier = GlanceModifier.height(16.dp).defaultWeight())
TextBlockTemplate(data.mainTextBlock)
ActionBlockTemplate(data.mainActionBlock)
diff --git a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/GlanceAppWidgetTemplates.kt b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/GlanceAppWidgetTemplates.kt
index 09fed4a..c267412 100644
--- a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/GlanceAppWidgetTemplates.kt
+++ b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/GlanceAppWidgetTemplates.kt
@@ -92,6 +92,9 @@
)
}
actionButton?.let {
+ if (headerIcon != null || header != null) {
+ Spacer(modifier = GlanceModifier.width(8.dp))
+ }
AppWidgetTemplateButton(
actionButton,
GlanceModifier.height(48.dp).width(48.dp)
@@ -229,6 +232,8 @@
@Composable
internal fun ActionBlockTemplate(actionBlock: ActionBlock?) {
if (actionBlock?.actionButtons?.isNotEmpty() == true) {
+ // TODO(b/247613894): Leading space here is error prone, space is usually added at a higher
+ // level depending on context. Adding space here may lead to double spacing
Spacer(modifier = GlanceModifier.height(16.dp))
Row {
actionBlock.actionButtons.forEach { button ->
diff --git a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/ListTemplateLayouts.kt b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/ListTemplateLayouts.kt
index 0c4ef2f..61c626f 100644
--- a/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/ListTemplateLayouts.kt
+++ b/glance/glance-appwidget/src/androidMain/kotlin/androidx/glance/appwidget/template/ListTemplateLayouts.kt
@@ -79,6 +79,7 @@
Column(modifier = createTopLevelModifier()) {
if (data.listStyle == ListStyle.Full) {
HeaderBlockTemplate(data.headerBlock)
+ // TODO(b/247613894): Do not add this spacing if header block is empty
Spacer(modifier = GlanceModifier.height(16.dp))
}
LazyColumn {