EditorRequest
public final class EditorRequest
The request sent by WatchFaceEditorContract.createIntent.
use Watch Face Format instead
Summary
Public constructors |
|---|
This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
@RequiresApi(value = 30)This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Public methods |
|
|---|---|
static final @NonNull EditorRequest |
This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
final @NonNull String |
This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
final DeviceConfig |
This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
final UserStyleData |
This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
final PreviewScreenshotParams |
This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
final @NonNull ComponentName |
This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
final @NonNull WatchFaceId |
@RequiresApi(value = 30)This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Public constructors
EditorRequest
publicEditorRequest(
@NonNull ComponentName watchFaceComponentName,
@NonNull String editorPackageName,
UserStyleData initialUserStyle
)
Constructs an EditorRequest without a WatchFaceId. This is for use pre-android R.
| Parameters | |
|---|---|
@NonNull ComponentName watchFaceComponentName |
The |
@NonNull String editorPackageName |
The package name of the watch face editor APK. |
UserStyleData initialUserStyle |
The initial |
EditorRequest
@RequiresApi(value = 30)
publicEditorRequest(
@NonNull ComponentName watchFaceComponentName,
@NonNull String editorPackageName,
UserStyleData initialUserStyle,
@NonNull WatchFaceId watchFaceId,
DeviceConfig headlessDeviceConfig,
PreviewScreenshotParams previewScreenshotParams
)
| Parameters | |
|---|---|
@NonNull ComponentName watchFaceComponentName |
The |
@NonNull String editorPackageName |
The package name of the watch face editor APK. |
UserStyleData initialUserStyle |
The initial |
@NonNull WatchFaceId watchFaceId |
Unique ID for the instance of the watch face being edited, only defined for Android R and beyond, it's |
DeviceConfig headlessDeviceConfig |
If |
PreviewScreenshotParams previewScreenshotParams |
If |
Public methods
createFromIntent
public static final @NonNull EditorRequestcreateFromIntent(@NonNull Intent intent)
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.
| Throws | |
|---|---|
kotlinx.coroutines.TimeoutCancellationException |
in case of en error. |
getEditorPackageName
public final @NonNull StringgetEditorPackageName()
The package name of the watch face editor APK.
getHeadlessDeviceConfig
public final DeviceConfiggetHeadlessDeviceConfig()
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.
getInitialUserStyle
public final UserStyleDatagetInitialUserStyle()
The initial UserStyle stored as a UserStyleData or null. Only required for a headless EditorSession.
getPreviewScreenshotParams
public final PreviewScreenshotParamsgetPreviewScreenshotParams()
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.
getWatchFaceComponentName
public final @NonNull ComponentNamegetWatchFaceComponentName()
The ComponentName of the watch face being edited.
getWatchFaceId
@RequiresApi(value = 30)
public final @NonNull WatchFaceIdgetWatchFaceId()
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.