GlanceRemoteViews

Class
Android
@ExperimentalGlanceRemoteViewsApi
public 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

public 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

context The Context to get the resources during RemoteViews building.
state Local view state that can be passed to composition through LocalState.
size Size of the RemoteViews to be displayed at.
appWidgetOptions AppWidget options Bundle to be passed to composition through LocalAppWidgetOptions.
content Definition of the UI.

Returns

Composition result containing the RemoteViews.