GlanceRemoteViews

Class

Android
@ExperimentalGlanceRemoteViewsApi
class GlanceRemoteViews

Object containing the information needed to generate a RemoteViews. The same instance should be reused to compose layouts for a host view.

Functions

suspend fun compose(
        context: Context,
        size: DpSize,
        state: Any? = null,
        appWidgetOptions: Bundle = Bundle(),
        content: @Composable () -> Unit
    ): RemoteViewsCompositionResult

Triggers the composition of content and returns the result.

Parameters

contextThe Context to get the resources during RemoteViews building.
stateLocal view state that can be passed to composition through LocalState.
sizeSize of the RemoteViews to be displayed at.
appWidgetOptionsAppWidget options Bundle to be passed to composition through LocalAppWidgetOptions.
contentDefinition of the UI.

Returns

Composition result containing the RemoteViews.