EditorRequest


class EditorRequest


The request sent by WatchFaceEditorContract.createIntent.

use Watch Face Format instead

Summary

Public companion functions

EditorRequest

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Public constructors

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

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

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

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Public properties

String

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

DeviceConfig?

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

UserStyleData?

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

PreviewScreenshotParams?

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

ComponentName

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

WatchFaceId
@RequiresApi(value = 30)
watchFaceId

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Public companion functions

createFromIntent

Added in 1.0.0
Deprecated in 1.3.0-alpha06
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
Deprecated in 1.3.0-alpha06
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
Deprecated in 1.3.0-alpha06
@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
Deprecated in 1.3.0-alpha06
val editorPackageNameString

The package name of the watch face editor APK.

headlessDeviceConfig

Added in 1.0.0
Deprecated in 1.3.0-alpha06
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
Deprecated in 1.3.0-alpha06
val initialUserStyleUserStyleData?

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

previewScreenshotParams

Added in 1.0.0
Deprecated in 1.3.0-alpha06
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
Deprecated in 1.3.0-alpha06
val watchFaceComponentNameComponentName

The ComponentName of the watch face being edited.

watchFaceId

Added in 1.0.0
Deprecated in 1.3.0-alpha06
@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.