public enum WidgetSize

  1. Object
  2. Enum<WidgetSize>
  3. WidgetSize

ImplementsComparable<WidgetSize>

The size families a widget kind supports.

The first four are the phone families: iOS maps them to the WidgetKit families (systemSmall / systemMedium / systemLarge, and accessoryRectangular for LOCKSCREEN); Android and desktop treat them as size hints, and LOCKSCREEN is ignored on Android.

The WATCH_* families are complications – the small live readouts on a watch face. They live here rather than in an API of their own because they are the same concept as a widget: content-driven, rendered while your app is not running, and fed by the same WidgetTimeline. On Apple a complication is literally a WidgetKit widget in an accessory family; on Wear OS the simple families become complication data and the richer ones become a Tile.

Design them for a glance. A complication is a few dozen pixels someone reads in under a second, so a SurfaceVector gauge or a single number beats any layout that has to be read.

Enum constants

SMALLSmall square home-screen widget.
MEDIUMMedium home-screen widget.
LARGELarge home-screen widget.
LOCKSCREENLock-screen widget.
WATCH_CIRCULARRound complication – the corner or centre slots of a watch face.
WATCH_RECTANGULARWide complication, a band across the watch face.
WATCH_INLINEOne line of text alongside the time.
WATCH_CORNERCurved complication hugging the bezel of a round face.

Methods

public static WidgetSize[] values()
public static WidgetSize valueOf(String name)
public String getJsonName()Returns the wire-format name used in the serialized descriptor.
public boolean isWatchFamily()True for the watch complication families, which are published to a watch face rather than to a home or lock screen.
public static WidgetSize fromJsonName(String jsonName)Resolves a wire-format name back to its family.

Inherited methods

Enum constant details

SMALL

SMALL
Small square home-screen widget. iOS systemSmall.

MEDIUM

MEDIUM
Medium home-screen widget. iOS systemMedium.

LARGE

LARGE
Large home-screen widget. iOS systemLarge.

LOCKSCREEN

LOCKSCREEN
Lock-screen widget. iOS accessoryRectangular.

WATCH_CIRCULAR

WATCH_CIRCULAR
Round complication – the corner or centre slots of a watch face. iOS accessoryCircular; Wear OS RANGED_VALUE or MONOCHROMATIC_IMAGE. Room for a gauge or one glyph.

WATCH_RECTANGULAR

WATCH_RECTANGULAR
Wide complication, a band across the watch face. iOS accessoryRectangular; Wear OS LONG_TEXT, or a Tile when the layout is richer than text. The roomiest family.

WATCH_INLINE

WATCH_INLINE
One line of text alongside the time. iOS accessoryInline; Wear OS SHORT_TEXT. Text only – anything else is dropped.

WATCH_CORNER

WATCH_CORNER
Curved complication hugging the bezel of a round face. iOS accessoryCorner; renders as the circular family on Wear OS, which has no corner slot.

Method details

values

public static WidgetSize[] values()

valueOf

public static WidgetSize valueOf(String name)

getJsonName

public String getJsonName()
Returns the wire-format name used in the serialized descriptor.

isWatchFamily

public boolean isWatchFamily()
True for the watch complication families, which are published to a watch face rather than to a home or lock screen.

Returns

true if this is a complication family

fromJsonName

public static WidgetSize fromJsonName(String jsonName)
Resolves a wire-format name back to its family.

Parameters

jsonName String
the name produced by getJsonName()

Returns

the matching family, or null when the name is unknown