1"use strict";(self.webpackChunkmy_website=self.webpackChunkmy_website||[]).push([[6066],{4462:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>i,metadata:()=>r,toc:()=>o});const r=JSON.parse('{"id":"android/guide_drafts","title":"Drafts screen on Android","description":"Guide to integrating and customizing drafts screen on Video Editor SDK.","source":"@site/docs/android/guide_drafts.md","sourceDirName":"android","slug":"/android/guide_drafts","permalink":"/ve-pe-sdk/docs/android/guide_drafts","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"sidebar_label":"Drafts screen"},"sidebar":"androidSidebar","previous":{"title":"Gallery screen","permalink":"/ve-pe-sdk/docs/android/guide_gallery"},"next":{"title":"Share video screen","permalink":"/ve-pe-sdk/docs/android/guide_share_video"}}');var s=n(4848),d=n(8453);const i={sidebar_label:"Drafts screen"},a="Drafts screen on Android",l={},o=[{value:"Configuration",id:"configuration",level:2},{value:"Draft Helper",id:"draft-helper",level:2},{value:"Used string resources",id:"used-string-resources",level:3}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"drafts-screen-on-android",children:"Drafts screen on Android"})}),"\n",(0,s.jsx)(t.p,{children:"Guide to integrating and customizing drafts screen on Video Editor SDK."}),"\n",(0,s.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsxs)(t.p,{children:["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 ",(0,s.jsx)(t.a,{href:"https://github.com/Banuba/ve-sdk-android-integration-sample/blob/main/app/src/main/java/com/banuba/example/integrationapp/VideoEditorModule.kt#L60",children:"VideoEditorModule"}),":"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-kotlin",children:" override val draftConfig: BeanDefinition<DraftConfig> = factory(override = true) {\n DraftConfig.ENABLED_ASK_TO_SAVE\n }\n"})}),"\n",(0,s.jsx)(t.p,{children:"You can choose one of these options:"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"ENABLED_ASK_TO_SAVE"})," - drafts enabled, asks the user to save a draft"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"ENABLED_ASK_IF_SAVE_NOT_EXPORT"})," - drafts enabled, asks the user to save a draft without export"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"ENABLED_SAVE_BY_DEFAULT"})," - drafts enabled, saved by default without asking the user"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"DISABLED"})," - disabled drafts"]}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"draft-helper",children:"Draft Helper"}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.code,{children:"DraftsHelper"})," interface is used for managing drafts."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-kotlin",children:"interface DraftsHelper {\n\n val allDrafts: StateFlow<List<Draft>>\n\n fun delete(draft: Draft)\n\n fun deleteAll()\n\n fun openDraft(draft: Draft): Intent\n\n fun openLastDraft(): Intent\n}\n"})}),"\n",(0,s.jsxs)(t.p,{children:["To get the instance of ",(0,s.jsx)(t.code,{children:"DraftsHelper"})," use the following in your Fragment or Activity."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-kotlin",children:"val draftsHelper: DraftsHelper by inject()\n"})}),"\n",(0,s.jsx)(t.h3,{id:"used-string-resources",children:"Used string resources"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{style:{textAlign:"center"},children:"ResourceId"}),(0,s.jsx)(t.th,{style:{textAlign:"center"},children:"Value"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"drafts_title"}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"Drafts"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"drafts_empty_description"}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"No Drafts"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"drafts_options_edit"}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"Edit"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"drafts_options_delete"}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"Delete"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"editor_trim_video"}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"Adjust Clips"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"editor_discard_changes"}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"Discard changes"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"editor_update_draft"}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"Update draft"})]})]})]})]})}function h(e={}){const{wrapper:t}={...(0,d.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>a});var r=n(6540);const s={},d=r.createContext(s);function i(e){const t=r.useContext(d);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(d.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.