Build apps faster with our new App builder! Check it out →

Scaffold

Android

Component in Jetpack Glance

A simple slot api component for displaying widget UI with a [TitleBar]. Sets the background color to GlanceTheme.colors.surface and applies padding. This is intended to be used as a top level component.

Last updated:

Installation

dependencies {
   implementation("androidx.glance:glance-appwidget:1.1.1")
}

Overloads

@Composable
fun Scaffold(
    modifier: GlanceModifier = GlanceModifier,
    titleBar: @Composable (() -> Unit)? = null,
    backgroundColor: ColorProvider = GlanceTheme.colors.widgetBackground,
    horizontalPadding: Dp = 12.dp,
    content: @Composable () -> Unit,
)

Parameters

namedescription
modifiera modifier
titleBarA composable that creates the [TitleBar]. Optional parameter.
backgroundColorthe background color for the layout.
horizontalPaddingScaffold provides a default padding which should work for most use cases. However, it can be overridden.
contentThe main content of the widget.
by @alexstyl