appWidgetBackground

Function

Android
fun GlanceModifier.appWidgetBackground(): GlanceModifier

Define the current view as the background of the App Widget.

By definition, the background of the App Widget is the view with the id @android:id/background.

There can be only one view with this modifier in a given App Widget.

This modifier does not automatically set corner radius. To have these set for you, use the androidx.glance.appwidget.components.Scaffold component.

For more information about widget backgrounds, See the documentation on Enable smoother transitions(https://developer.android.com/guide/topics/appwidgets/enhance#enable-smoother-transitions) and Implement rounded corners(https://developer.android.com/guide/topics/appwidgets#rounded-corner) for details on why it is important to label a view as being the background, and why you will want to set the cornerRadius of the same view.