ContainerInfo
class ContainerInfo
Describes a container supported by a widget provider.
A container is one representation of a widget, with a given size and shape.
The fields in this class correspond to the fields in the <container> xml tag.
For example:
<container
android:type="@integer/glance_wear_container_type_large"
android:previewImage="@drawable/large_preview"
android:label="@string/large_label" />
Summary
Constants |
|
|---|---|
const Int |
Represents a large widget container. |
const Int |
Represents a small widget container. |
const Int |
Represents a container equivalent to a Wear Tile. |
Public properties |
|
|---|---|
String? |
The override description for this widget container. |
String? |
The override label for this widget container. |
@DrawableRes Int |
The resource id of the preview image for this widget container. |
Int |
The type of this widget container. |
Constants
CONTAINER_TYPE_LARGE
const val CONTAINER_TYPE_LARGE: Int
Represents a large widget container. Support for this container type is device dependent.
CONTAINER_TYPE_SMALL
const val CONTAINER_TYPE_SMALL: Int
Represents a small widget container. Support for this container type is device dependent.
CONTAINER_TYPE_TILE_COMPAT
const val CONTAINER_TYPE_TILE_COMPAT: Int
Represents a container equivalent to a Wear Tile. This widget is embedded inside a Tile container, and its contents are restricted to specs similar to CONTAINER_TYPE_LARGE
For this container type, the host shows the widget label above the contents (and may also show icon).
Public functions
Public properties
description
val description: String?
The override description for this widget container.
previewImage
val previewImage: @DrawableRes Int
The resource id of the preview image for this widget container.
type
val type: Int
The type of this widget container. This can be one of ContainerInfo.CONTAINER_TYPE_LARGE or ContainerInfo.CONTAINER_TYPE_SMALL.