HTML Editor in sketchware

Html is an language used for making webpages designs from frontend. There are tons of writer for html but all these needs large codes and this is not a good method for all users because some just wants to write text and not wants to write codes. So in today's post i am going to show how to make a html editor in sketchware.




This html editor will be nearly same to the blogger and wordpress editor. And this options like undo, redo, headings, paragraph, and many more. 

To make html editor project in sketchware follow all these steps. (currently i am not providing blocks, but if there will be a good response then i'll surely provide.)

View area 

1. In the view editor add a linear and use convert option and replace LinearLayout with jp.wasabeef.richeditor.RichEditor  
2. Use id option and change it's id to mEditor 

You can add other options like undo, redo, headings, subscripts by your mind or as shown in ther picture.


OnCreate
In on activity create event add three asd blocks and add these codes.


mEditor.setEditorFontSize(20); mEditor.setEditorFontColor(Color.BLACK);

mEditor.setPlaceholder("Made by swrevo designs");

mEditor.setOnTextChangeListener(new RichEditor.OnTextChangeListener() { @Override public void onTextChange(String text) {
}
});


Imports 
Add a custom import block and paste the following inside that
 jp.wasabeef.richeditor.RichEditor



Actions codes for html editor 

Action undo 
 mEditor.undo();

Action redo
 mEditor.redo();


Set Bold 
mEditor.setBold();


Set Italic
mEditor.setItalic();


Set StrikeThrough
mEditor.setStrikeThrough();


Set Subscript
mEditor.setSubscript();


Set SuperScript
mEditor.setSuperscript();


Set UnderLine
mEditor.setUnderline();


Set Headings
mEditor.setHeading(1);
mEditor.setHeading(2);
mEditor.setHeading(3);
mEditor.setHeading(4);
mEditor.setHeading(5);
mEditor.setHeading(6);


Set Indent
mEditor.setIndent();


Set Outdent
mEditor.setOutdent();


Set align left
mEditor.setAlignLeft();


Set align center
mEditor.setAlignCenter();


Set align right
mEditor.setAlignRight();


Set Blockquote
mEditor.setBlockquote();


Set Bullets
mEditor.setBullets();


Set numbers
mEditor.setNumbers();


Add TODO
mEditor.insertTodo();




So all these codes were for now, in the next update of html editor i'll add options for adding image, youtube player, Audio, Video, Links and much more features. For getting new updates on html editor you can join https://telegram.dog/sk_comm



Library 

You need a library for proper working of this project you can directly download it from this link
Previous Post Next Post