Skip to main content

Interface: Widget

Properties

name

name: string

Name of the widget which will be used to reference it in code


minWidth

minWidth: `${number}dp`


minHeight

minHeight: `${number}dp`


label

Optional label: string

Label that will be shown in widget picker


description

Optional description: string

Description that will be shown in widget picker


maxResizeWidth

Optional maxResizeWidth: `${number}dp`


maxResizeHeight

Optional maxResizeHeight: `${number}dp`


previewImage

Optional previewImage: `./${string}` | `../${string}`


resizeMode

Optional resizeMode: "none" | "horizontal" | "vertical" | "horizontal|vertical"


widgetFeatures

Optional widgetFeatures: "reconfigurable" | "reconfigurable|configuration_optional"

Whether the widget can be configured. 'configurable' means that the widget is configurable, and a configuration activity will be open when the widget is added on home screen. 'reconfigurable|configuration_optional' will make the widget configurable, but will not open the configuration activity when added on home screen, and the configuration can be changed by holding the widget and selecting configure. The widget will not be configurable if widgetFeatures is not provided


updatePeriodMillis

Optional updatePeriodMillis: number

How often the widget should be updated, in milliseconds.

Default is 0 (no automatic updates)

Minimum is 1.800.000 (30 minutes == 30 * 60 * 1000).