public final class EditorState


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

Summary

Public methods

boolean
equals(Object other)
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 @NonNull UserStyleData

The current UserStyle encoded as a UserStyleData.

final @NonNull WatchFaceId

The system's watch face instance ID.

int
final boolean

Whether or not this state should be committed (i.e. the user aborted the session).

@NonNull String

Public methods

equals

public boolean equals(Object other)

getPreviewComplicationsData

Added in 1.0.0
public final @NonNull Map<@NonNull Integer, @NonNull ComplicationDatagetPreviewComplicationsData()

Preview ComplicationData needed for taking screenshots without live complication data.

getPreviewImage

Added in 1.0.0
public final Bitmap getPreviewImage()

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).

getUserStyle

Added in 1.0.0
public final @NonNull UserStyleData getUserStyle()

The current UserStyle encoded as a UserStyleData.

getWatchFaceId

Added in 1.0.0
public final @NonNull WatchFaceId getWatchFaceId()

The system's watch face instance ID. See WatchFaceId for details.

hashCode

public int hashCode()

shouldCommitChanges

Added in 1.2.0
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.

toString

public @NonNull String toString()