diff --git a/glance/src/main/kotlin/de/jeanlucmakiola/floret/glance/RemoteViewsColors.kt b/glance/src/main/kotlin/de/jeanlucmakiola/floret/glance/RemoteViewsColors.kt index 7656ae4..8aa6d5f 100644 --- a/glance/src/main/kotlin/de/jeanlucmakiola/floret/glance/RemoteViewsColors.kt +++ b/glance/src/main/kotlin/de/jeanlucmakiola/floret/glance/RemoteViewsColors.kt @@ -35,6 +35,8 @@ enum class WidgetColorRole(@ColorRes internal val resId: Int) { PRIMARY(R.color.floret_widget_primary), ON_PRIMARY(R.color.floret_widget_on_primary), ON_SECONDARY_CONTAINER(R.color.floret_widget_on_secondary_container), + SURFACE_VARIANT(R.color.floret_widget_surface_variant), + WIDGET_BACKGROUND(R.color.floret_widget_widget_background), } /** @@ -128,4 +130,6 @@ private fun ColorProviders.provider(role: WidgetColorRole): ColorProvider = when WidgetColorRole.PRIMARY -> primary WidgetColorRole.ON_PRIMARY -> onPrimary WidgetColorRole.ON_SECONDARY_CONTAINER -> onSecondaryContainer + WidgetColorRole.SURFACE_VARIANT -> surfaceVariant + WidgetColorRole.WIDGET_BACKGROUND -> widgetBackground } diff --git a/glance/src/main/kotlin/de/jeanlucmakiola/floret/glance/WidgetHeader.kt b/glance/src/main/kotlin/de/jeanlucmakiola/floret/glance/WidgetHeader.kt index db5fff9..3d4ddd3 100644 --- a/glance/src/main/kotlin/de/jeanlucmakiola/floret/glance/WidgetHeader.kt +++ b/glance/src/main/kotlin/de/jeanlucmakiola/floret/glance/WidgetHeader.kt @@ -38,13 +38,16 @@ enum class WidgetActionStyle { TONAL, FILLED } * weighted to fill, and a trailing slot for [WidgetActionButton]s. On a * [WidgetBackground.TRANSPARENT] root the title gets its own small pill behind * it, so it stays legible over an arbitrary wallpaper (calendula#292); on a - * filled root it sits directly on the surface, as before. + * filled root it sits directly on the surface, as before, [titleInset] in from + * the start to line it up with the content below. The pill sits flush instead, + * like the actions on the other side, its own padding insetting the text. */ @Composable fun WidgetHeader( title: String, modifier: GlanceModifier = GlanceModifier, titleAction: Action? = null, + titleInset: Dp = 0.dp, actions: @Composable RowScope.() -> Unit = {}, ) { val transparentTitle = LocalWidgetBackground.current == WidgetBackground.TRANSPARENT @@ -66,7 +69,7 @@ fun WidgetHeader( } Spacer(GlanceModifier.defaultWeight()) } else { - Box(modifier = GlanceModifier.defaultWeight().then(clickable)) { + Box(modifier = GlanceModifier.defaultWeight().then(clickable).padding(start = titleInset)) { HeaderText(title) } } diff --git a/glance/src/main/res/values-night-v31/floret_widget_colors.xml b/glance/src/main/res/values-night-v31/floret_widget_colors.xml index d6143ed..ea3404b 100644 --- a/glance/src/main/res/values-night-v31/floret_widget_colors.xml +++ b/glance/src/main/res/values-night-v31/floret_widget_colors.xml @@ -6,4 +6,6 @@ @android:color/system_accent1_200 @android:color/system_accent1_800 @android:color/system_accent2_100 + @android:color/system_neutral2_700 + @android:color/system_accent2_800 diff --git a/glance/src/main/res/values-night/floret_widget_colors.xml b/glance/src/main/res/values-night/floret_widget_colors.xml index 1868de7..e3e62de 100644 --- a/glance/src/main/res/values-night/floret_widget_colors.xml +++ b/glance/src/main/res/values-night/floret_widget_colors.xml @@ -6,4 +6,6 @@ #FFBAC3FF #FF08218A #FFDEE1F9 + #FF46464F + #FF2B2D3A diff --git a/glance/src/main/res/values-v31/floret_widget_colors.xml b/glance/src/main/res/values-v31/floret_widget_colors.xml index 82d4432..902f378 100644 --- a/glance/src/main/res/values-v31/floret_widget_colors.xml +++ b/glance/src/main/res/values-v31/floret_widget_colors.xml @@ -6,4 +6,6 @@ @android:color/system_accent1_600 @android:color/system_accent1_0 @android:color/system_accent2_900 + @android:color/system_neutral2_100 + @android:color/system_accent2_50 diff --git a/glance/src/main/res/values/floret_widget_colors.xml b/glance/src/main/res/values/floret_widget_colors.xml index a84fe7b..e2a744f 100644 --- a/glance/src/main/res/values/floret_widget_colors.xml +++ b/glance/src/main/res/values/floret_widget_colors.xml @@ -6,4 +6,6 @@ #FF4355B9 #FFFFFFFF #FF171B2C + #FFE3E1EC + #FFF3F3FA