EditorState

public final class EditorState


The state of the editing session. See androidx.wear.watchface.editor.EditorSession.

Summary

Public fields

final @NonNull Map<@NonNull Integer, @NonNull ComplicationData>

Preview ComplicationData needed for taking screenshots without live complication data.

final Bitmap

If non-null this Bitmap contains a preview image of the watch face rendered with the final style and complications and the androidx.wear.watchface.editor.PreviewScreenshotParams specified in the androidx.wear.watchface.editor.EditorRequest.

final boolean

Whether or not this state should be committed (i.e.

final @NonNull UserStyleData

The current UserStyle encoded as a UserStyleData.

final @NonNull WatchFaceId
@RequiresApi(value = 30)
watchFaceId

Unique ID for the instance of the watch face being edited (see androidx.wear.watchface.editor.EditorRequest.watchFaceId), only defined for Android R and beyond.

Public methods

@NonNull String

Public fields

previewComplicationsData

public final @NonNull Map<@NonNull Integer, @NonNull ComplicationDatapreviewComplicationsData

Preview ComplicationData needed for taking screenshots without live complication data.

previewImage

public final Bitmap previewImage

If non-null this Bitmap contains a preview image of the watch face rendered with the final style and complications and the androidx.wear.watchface.editor.PreviewScreenshotParams specified in the androidx.wear.watchface.editor.EditorRequest. If shouldCommitChanges is false then this will also be null (see implementation of androidx.wear.watchface.editor.EditorSession.close).

shouldCommitChanges

public final boolean shouldCommitChanges

Whether or not this state should be committed (i.e. the user aborted the session). If it's not committed then any changes (E.g. complication data source changes) should be abandoned. There's no need to resend the style to the watchface because the library will have restored the previous style.

userStyle

public final @NonNull UserStyleData