EditorEvent

interface EditorEvent

An editor event that can be sent via EditorEventHandler. All the instances of classes that inherit from EditorEvent and are declared below are handled internally, i.e. EditorEvent.CloseEditor, EditorEvent.Sheet.Open. All the remaining events are considered as custom and need to be handled manually in ly.img.editor.EditorConfiguration.onEvent. However, no matter internal or custom, all events are forwarded to ly.img.editor.EditorConfiguration.onEvent and can be useful to update your state, do action tracking etc.

Inheritors

Types

Link copied to clipboard
class AddCameraCapturesToScene(val photoUploadAssetSourceType: UploadAssetSourceType, val videoUploadAssetSourceType: UploadAssetSourceType, val captures: List<Capture>, val appendToBackgroundTrack: Boolean = true) : EditorEvent

An event for adding a heterogeneous capture stack (photos + videos in one camera session) to the scene. When appendToBackgroundTrack is true (default), each capture is appended to the background track — Capture.Photos become image-fill graphic blocks with duration Capture.Photo.clipDuration, and Capture.Videos become video clips. When appendToBackgroundTrack is false, each capture is placed on the current page centered like the gallery picker does — appropriate for design / photo / apparel / postcard editors that don't have a background track.

Link copied to clipboard
class AddCameraRecordingsToScene(val uploadAssetSourceType: UploadAssetSourceType, val recordings: List<Pair<Uri, Duration>>) : EditorEvent

An event for adding camera recordings to the scene. In addition, the recordings will be transformed into ly.img.engine.AssetDefinitions and will be added to the asset source represented by uploadAssetSourceType.

Link copied to clipboard
class AddUriToScene(val uploadAssetSourceType: UploadAssetSourceType, val uri: Uri, val addToBackgroundTrack: Boolean = false) : EditorEvent

An event for adding a uri to the scene. In addition, the uri will be transformed into an ly.img.engine.AssetDefinition and will be added to the asset source represented by uploadAssetSourceType.

Link copied to clipboard
class ApplyForceCrop(val designBlock: DesignBlock, val configuration: ForceCropConfiguration) : EditorEvent

An event for applying a force crop configuration to a specific designBlock.

Link copied to clipboard
class ApplyVideoDurationConstraints(val minDuration: Duration? = null, val maxDuration: Duration? = null) : EditorEvent

An event for applying video duration constraints.

Link copied to clipboard

An event for canceling the export job if it is running.

Link copied to clipboard
class CloseEditor(val throwable: Throwable? = null) : EditorEvent

An event for closing the editor. This force closes the editor without entering the ly.img.editor.EngineConfiguration.onClose callback.

Link copied to clipboard
class Export
Link copied to clipboard
class Insets
Link copied to clipboard
class LaunchContract<I, O>(val contract: ActivityResultContract<I, O>, val input: I, val onOutput: EditorScope.(O) -> Unit) : EditorEvent

An event for launching any contract via ActivityResultContract API. IMPORTANT: Do not capture any values in the onOutput. In case the activity of the editor is killed when returning back it may cause issues.

Link copied to clipboard

All events related to navigation inside the editor.

Link copied to clipboard

An event for triggering ly.img.editor.EngineConfiguration.onClose callback.

Link copied to clipboard
class ReplaceUriAtScene(val uploadAssetSourceType: UploadAssetSourceType, val uri: Uri, val designBlock: DesignBlock) : EditorEvent

An event for replacing the content of the designBlock with uri content. In addition, the uri will be transformed into an ly.img.engine.AssetDefinition and will be added to the asset source represented by uploadAssetSourceType.

Link copied to clipboard
class Selection

All events related to design block selection.

Link copied to clipboard
class SetViewMode(val viewMode: EditorViewMode) : EditorEvent

An event for setting the view mode of the editor to a new value.

Link copied to clipboard
class Sheet

All sheet related events.