Skip to content

Java api: Advance

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

      editorFragment.getEditor().getHtmlContent( new OnHtmlReturned() {
          @Override
          public void process(@NotNull final String html) {
              // Do something with html
          }
      } );
    
  • To set custom HTML content:

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

      editorFragment.getEditor().getText( new OnTextReturned() {
          @Override
          public void process(@NotNull final String text) {
              // Do something with text
          }
      } );
    
  • To retrieve contents (Delta object string):

      editorFragment.getEditor().getContents( new OnContentsReturned() {
          @Override
          public void process(@NotNull String contents) {
              // Do something with contents
          }
      } );
    
  • To set contents (Delta object string):

      editorFragment.getEditor().setContents(saved_contents)       
    
  • To insert image (e.g: onActivityResult/after uploading with image path (local)/URL):

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