Drafts guide
Configuration
Drafts are enabled by default, asks the user to save a draft before leave any VideoEditor screen. If you need to change drafts configuration you should add the code below in the VideoEditorModule:
override val draftConfig: BeanDefinition<DraftConfig> = factory(override = true) {
DraftConfig.ENABLED_ASK_TO_SAVE
}
You can choose one of these options:
ENABLED_ASK_TO_SAVE
- drafts enabled, asks the user to save a draftENABLED_ASK_IF_SAVE_NOT_EXPORT
- drafts enabled, asks the user to save a draft without exportENABLED_SAVE_BY_DEFAULT
- drafts enabled, saved by default without asking the userDISABLED
- disabled drafts
Draft Helper
DraftsHelper
interface is used for managing drafts.
interface DraftsHelper {
val allDrafts: StateFlow<List<Draft>>
fun delete(draft: Draft)
fun deleteAll()
fun openDraft(draft: Draft): Intent
fun openLastDraft(): Intent
}
To get the instance of DraftsHelper
use the following in your Fragment or Activity.
val draftsHelper: DraftsHelper by inject()
Used string resources
ResourceId | Value |
---|---|
drafts_title | Drafts |
drafts_empty_description | No Drafts |
drafts_options_edit | Edit |
drafts_options_delete | Delete |
editor_trim_video | Adjust Clips |
editor_discard_changes | Discard changes |
editor_update_draft | Update draft |