Package com.google.android.glance.appwidget.host

Types

AppWidgetHostState
Link copied to clipboard
class AppWidgetHostState(providerInfo: AppWidgetProviderInfo?, state: MutableState<AppWidgetHostView?>)
State for the AppWidgetHost that holds the host view and allows to update the appwidget.

Functions

AppWidgetHost
Link copied to clipboard
@Composable()
fun AppWidgetHost(modifier: Modifier = Modifier, displaySize: DpSize, state: AppWidgetHostState, gridColor: Color? = null)
A layout composable with an AppWidgetHostView to display the provided RemoteViews from the state.
AppWidgetHostPreview
Link copied to clipboard
@Composable()
fun AppWidgetHostPreview(modifier: Modifier = Modifier, displaySize: DpSize = DpSize.Unspecified, provider: AppWidgetProviderInfo? = null, content: suspend (Context) -> RemoteViews)
Use this composable inside a androidx.compose.ui.tooling.preview.
exportSnapshot
Link copied to clipboard
@RequiresApi(value = 29)
suspend fun AppWidgetHostView.exportSnapshot(fileName: String? = null): Result<Uri>
Extracts and image from the current host and stores it in the device picture directory
getMaxSize
Link copied to clipboard
fun AppWidgetProviderInfo.getMaxSize(context: Context): DpSize
getMinSize
Link copied to clipboard
fun AppWidgetProviderInfo.getMinSize(context: Context): DpSize
getSingleSize
Link copied to clipboard
fun AppWidgetProviderInfo.getSingleSize(context: Context): DpSize
getTargetSize
Link copied to clipboard
fun AppWidgetProviderInfo.getTargetSize(context: Context): DpSize
rememberAppWidgetHostState
Link copied to clipboard
@Composable()
fun rememberAppWidgetHostState(providerInfo: AppWidgetProviderInfo? = null): AppWidgetHostState
requestPin
Link copied to clipboard
fun AppWidgetHostState.requestPin(target: ComponentName = value!!.appWidgetInfo.provider, successCallback: PendingIntent? = null): Boolean
Request the launcher to pin the current hosted appwidget if any.
toPixels
Link copied to clipboard
fun Dp.toPixels(context: Context): Int
fun Dp.toPixels(displayMetrics: DisplayMetrics): Int
toSizeExtras
Link copied to clipboard
fun AppWidgetProviderInfo.toSizeExtras(context: Context, availableSize: DpSize): Bundle
toSizeF
Link copied to clipboard
fun DpSize.toSizeF(): SizeF

Properties

appwidgetBackgroundRadius
Link copied to clipboard
val Context.appwidgetBackgroundRadius: Dp
appwidgetBackgroundRadiusPixels
Link copied to clipboard
val Context.appwidgetBackgroundRadiusPixels: Float