androidx.glance.appwidget.state
Top-level functions summary
suspend T |
Retrieve the state of an app widget. |
suspend Unit |
updateAppWidgetState( Update the state of an app widget using the global PreferencesGlanceStateDefinition. |
suspend T |
Update the state of an app widget. |
Extension functions summary
suspend T |
Get the state of an App Widget. |
Top-level functions
getAppWidgetState
suspend funAny?> getAppWidgetState(
context: Context,
definition: GlanceStateDefinition,
glanceId: GlanceId
): T
Retrieve the state of an app widget.
The state definition must be the one used for that particular app widget.
updateAppWidgetState
suspend fun updateAppWidgetState(
context: Context,
glanceId: GlanceId,
updateState: suspend (MutablePreferences) -> Unit
): Unit
Update the state of an app widget using the global PreferencesGlanceStateDefinition.
The state definition must be the one used for that particular app widget.
updateAppWidgetState
suspend funAny?> updateAppWidgetState(
context: Context,
definition: GlanceStateDefinition,
glanceId: GlanceId,
updateState: suspend (T) -> T
): T
Update the state of an app widget.
The state definition must be the one used for that particular app widget.
Extension functions
getAppWidgetState
suspend funAny?> GlanceAppWidget.getAppWidgetState(
context: Context,
glanceId: GlanceId
): T
Get the state of an App Widget.