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 functions

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

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_LARGEInt

Represents a large widget container. Support for this container type is device dependent.

CONTAINER_TYPE_SMALL

const val CONTAINER_TYPE_SMALLInt

Represents a small widget container. Support for this container type is device dependent.

CONTAINER_TYPE_TILE_COMPAT

const val CONTAINER_TYPE_TILE_COMPATInt

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

equals

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

hashCode

open fun hashCode(): Int

Public properties

description

Added in 1.0.0-alpha15
val descriptionString?

The override description for this widget container.

label

Added in 1.0.0-alpha15
val labelString?

The override label for this widget container.

previewImage

Added in 1.0.0-alpha15
val previewImage: @DrawableRes Int

The resource id of the preview image for this widget container.

type

Added in 1.0.0-alpha15
val typeInt

The type of this widget container. This can be one of ContainerInfo.CONTAINER_TYPE_LARGE or ContainerInfo.CONTAINER_TYPE_SMALL.