Skip to content

Kotlin api: Advance

Duy Dao edited this page Jan 13, 2019 · 2 revisions
  • To retrieve HTML code:

      editorFragment.editor.getHtmlContent { html ->
              do_something_with(html)
      }
    
  • To set custom HTML content:

      editorFragment.editor.setHtmlContent(htmlContent: String)
    
  • To retrieve text:

      editorFragment.editor.getText { text ->
              do_something_with(text)
      }
    
  • To retrieve contents (Delta object string):

      editorFragment.editor.getContents{ contents -> // String
              do_something_with(contents)
      }
    
  • To set contents (Delta object string):

      editorFragment.editor.setContents(contents: String) // e.g: to load saved contents
    
  • To insert image (e.g: onActivityResult/after uploading with image path (local)/URL):

      editorFragment.editor.command(EditorButton.IMAGE, true (for local path - Base64)/false (for URL), path/URL: String)
    
Clone this wiki locally