class EditorRequest


The request sent by WatchFaceEditorContract.createIntent.

Summary

Public companion functions

EditorRequest

Returns an EditorRequest saved to a Intent by WatchFaceEditorContract.createIntent if there is one or null otherwise.

Public constructors

EditorRequest(
    watchFaceComponentName: ComponentName,
    editorPackageName: String,
    initialUserStyle: UserStyleData?
)

Constructs an EditorRequest without a WatchFaceId.

@RequiresApi(value = 30)
EditorRequest(
    watchFaceComponentName: ComponentName,
    editorPackageName: String,
    initialUserStyle: UserStyleData?,
    watchFaceId: WatchFaceId,
    headlessDeviceConfig: DeviceConfig?,
    previewScreenshotParams: PreviewScreenshotParams?
)

Public properties

String

The package name of the watch face editor APK.

DeviceConfig?

If non-null then this is the DeviceConfig to use when creating a headless instance to back the EditorSession.

UserStyleData?

The initial UserStyle stored as a UserStyleData or null.

PreviewScreenshotParams?

If non-null then EditorSession upon closing will render a screenshot with PreviewScreenshotParams using the existing interactive or headless instance which will be sent in EditorState to any registered clients.

ComponentName

The ComponentName of the watch face being edited.

WatchFaceId
@RequiresApi(value = 30)
watchFaceId

Unique ID for the instance of the watch face being edited, only defined for Android R and beyond, it's null on Android P and earlier.

Public companion functions

createFromIntent

Added in 1.0.0
fun createFromIntent(intent: Intent): EditorRequest

Returns an EditorRequest saved to a Intent by WatchFaceEditorContract.createIntent if there is one or null otherwise. Intended for use by the watch face editor activity.

Public constructors

EditorRequest

Added in 1.0.0
EditorRequest(
    watchFaceComponentName: ComponentName,
    editorPackageName: String,
    initialUserStyle: UserStyleData?
)

Constructs an EditorRequest without a WatchFaceId. This is for use pre-android R.

Parameters
watchFaceComponentName: ComponentName

The ComponentName of the watch face being edited.

editorPackageName: String

The package name of the watch face editor APK.

initialUserStyle: UserStyleData?

The initial UserStyle stored as a UserStyleData or null. Only required for a headless EditorSession. EditorSession.

EditorRequest

Added in 1.0.0
@RequiresApi(value = 30)
EditorRequest(
    watchFaceComponentName: ComponentName,
    editorPackageName: String,
    initialUserStyle: UserStyleData?,
    watchFaceId: WatchFaceId,
    headlessDeviceConfig: DeviceConfig?,
    previewScreenshotParams: PreviewScreenshotParams?
)
Parameters
watchFaceComponentName: ComponentName

The ComponentName of the watch face being edited.

editorPackageName: String

The package name of the watch face editor APK.

initialUserStyle: UserStyleData?

The initial UserStyle stored as a UserStyleData or null. Only required for a headless EditorSession.

watchFaceId: WatchFaceId

Unique ID for the instance of the watch face being edited, only defined for Android R and beyond, it's null on Android P and earlier. Note each distinct ComponentName can have multiple instances.

headlessDeviceConfig: DeviceConfig?

If non-null then this is the DeviceConfig to use when creating a headless instance to back the EditorSession. If null then the current interactive instance will be used. If there isn't one then the EditorSession won't launch until it's been created. Note supportsWatchFaceHeadlessEditing can be used to determine if this feature is supported. If it's not supported this parameter will be ignored.

previewScreenshotParams: PreviewScreenshotParams?

If non-null then EditorSession upon closing will render a screenshot with PreviewScreenshotParams using the existing interactive or headless instance which will be sent in EditorState to any registered clients.

Public properties

editorPackageName

Added in 1.0.0
val editorPackageNameString

The package name of the watch face editor APK.

headlessDeviceConfig

Added in 1.0.0
val headlessDeviceConfigDeviceConfig?

If non-null then this is the DeviceConfig to use when creating a headless instance to back the EditorSession. If null then the current interactive instance will be used. If there isn't one then the EditorSession won't launch until it's been created. Note supportsWatchFaceHeadlessEditing can be used to determine if this feature is supported. If it's not supported this parameter will be ignored.

initialUserStyle

Added in 1.0.0
val initialUserStyleUserStyleData?

The initial UserStyle stored as a UserStyleData or null. Only required for a headless EditorSession.

previewScreenshotParams

Added in 1.0.0
val previewScreenshotParamsPreviewScreenshotParams?

If non-null then EditorSession upon closing will render a screenshot with PreviewScreenshotParams using the existing interactive or headless instance which will be sent in EditorState to any registered clients.

watchFaceComponentName

Added in 1.0.0
val watchFaceComponentNameComponentName

The ComponentName of the watch face being edited.

watchFaceId

Added in 1.0.0
@RequiresApi(value = 30)
val watchFaceIdWatchFaceId

Unique ID for the instance of the watch face being edited, only defined for Android R and beyond, it's null on Android P and earlier. Note each distinct ComponentName can have multiple instances.