ListenableEditorSession.Companion

object ListenableEditorSession.Companion


Summary

Public methods

final @RequiresApi(value = 27) @UiThread @NonNull ListenableEditorSession
createHeadlessEditorSession(
    @NonNull ComponentActivity activity,
    @NonNull Intent editIntent,
    @NonNull HeadlessWatchFaceClient headlessWatchFaceClient
)

Constructs an ListenableEditorSession for a remote watch face editor.

final @UiThread @NonNull ListenableFuture<@NonNull ListenableEditorSession>

Constructs a ListenableFuture for a ListenableEditorSession for an on watch face editor.

Public methods

createHeadlessEditorSession

@RequiresApi(value = 27)
@UiThread
@NonNull
public final @RequiresApi(value = 27) @UiThread ListenableEditorSession createHeadlessEditorSession(
    @NonNull ComponentActivity activity,
    @NonNull Intent editIntent,
    @NonNull HeadlessWatchFaceClient headlessWatchFaceClient
)

Constructs an ListenableEditorSession for a remote watch face editor.

Parameters
@NonNull ComponentActivity activity

The ComponentActivity associated with the EditorSession.

@NonNull Intent editIntent

Intent sent by SysUI to launch the editing session.

@NonNull HeadlessWatchFaceClient headlessWatchFaceClient

The HeadlessWatchFaceClient that backs the constructed EditorSession.

listenableCreateOnWatchEditorSession

@UiThread
@NonNull
public final @UiThread ListenableFuture<@NonNull ListenableEditorSessionlistenableCreateOnWatchEditorSession(
    @NonNull ComponentActivity activity
)

Constructs a ListenableFuture for a ListenableEditorSession for an on watch face editor. This registers an activity result handler and so it must be called during an Activity or Fragment initialization path. The EditorSession is lifecycle aware and will automatically close when onDestroy is received.

If watch face editor takes more than 4s to create a watch face, returned future will be resolved with TimeoutCancellationException exception.

Parameters
@NonNull ComponentActivity activity

The ComponentActivity associated with the EditorSession.