WatchFaceEditorContract

open class WatchFaceEditorContract : ActivityResultContract


An ActivityResultContract for invoking a watch face editor. Note watch face editors are invoked by SysUI and the normal activity result isn't used for returning EditorState because Activity.onStop isn't guaranteed to be called when SysUI UX needs it to. Instead EditorState is broadcast by the editor usingEditorSession.close, to observe these broadcasts use WatchFaceControlClient.getEditorServiceClient and EditorServiceClient.addListener.

Summary

Public constructors

Public functions

open Intent
createIntent(context: Context, input: EditorRequest)

Create an intent that can be used for android.app.Activity.startActivityForResult.

open Unit
parseResult(resultCode: Int, intent: Intent?)

Convert result obtained from android.app.Activity.onActivityResult to O.

Inherited functions

From androidx.activity.result.contract.ActivityResultContract
open ActivityResultContract.SynchronousResult<Unit>?

An optional method you can implement that can be used to potentially provide a result in lieu of starting an activity.

Constants

ACTION_WATCH_FACE_EDITOR

const val ACTION_WATCH_FACE_EDITORString

Public constructors

WatchFaceEditorContract

Added in 1.0.0
WatchFaceEditorContract()

Public functions

createIntent

Added in 1.0.0
open fun createIntent(context: Context, input: EditorRequest): Intent

Create an intent that can be used for android.app.Activity.startActivityForResult.

parseResult

Added in 1.0.0
open fun parseResult(resultCode: Int, intent: Intent?): Unit

Convert result obtained from android.app.Activity.onActivityResult to O.