WidgetInstanceInfo

class WidgetInstanceInfo


Information representing an active placed widget instance across host display surfaces.

Each widget definition is identified by widgetName (shared across all instances of a GlanceAdaptiveWidgetReceiver, e.g. "weather_forecast"), while widgetId identifies the logical widget instance configuration (either a developer-defined custom tag, e.g. "bucharest_weather", or an auto-generated UUID).

Multiple placements on the same surface or across different host surfaces (e.g. two placements on the home screen, or one on the home screen and one on the lock screen) can share the same widgetId. placementsPerSurface maps each active GlanceSurface to the number of placements currently showing this widgetId on that surface.

Summary

Public constructors

WidgetInstanceInfo(
    widgetName: String,
    widgetId: String,
    options: Bundle,
    placementsPerSurface: ObjectIntMap<GlanceSurface>
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Bundle

User configuration options and metadata stored for this widget instance.

ObjectIntMap<GlanceSurface>

Map of host GlanceSurface to active placement count.

String

Identifier for this logical widget instance, which may be shared across multiple placements.

String

Identifier of the widget definition.

Public constructors

WidgetInstanceInfo

Added in 1.0.0-alpha05
WidgetInstanceInfo(
    widgetName: String,
    widgetId: String,
    options: Bundle = Bundle(),
    placementsPerSurface: ObjectIntMap<GlanceSurface> = emptyObjectIntMap()
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

options

Added in 1.0.0-alpha05
val options: Bundle

User configuration options and metadata stored for this widget instance.

placementsPerSurface

Added in 1.0.0-alpha05
val placementsPerSurface: ObjectIntMap<GlanceSurface>

Map of host GlanceSurface to active placement count.

widgetId

Added in 1.0.0-alpha05
val widgetId: String

Identifier for this logical widget instance, which may be shared across multiple placements.

widgetName

Added in 1.0.0-alpha05
val widgetName: String

Identifier of the widget definition.