Android的富文本编辑器:RichEditor for Android
jopen
10年前
RichEditor for Android 是 Android的一个所见即所得的富文本编辑器控件。
支持的功能
- Bold
- Italic
- Subscript
- Superscript
- Strikethrough
- Underline
- Justify Left
- Justify Center
- Justify Right
- Heading 1
- Heading 2
- Heading 3
- Heading 4
- Heading 5
- Heading 6
- Undo
- Redo
- Indent
- Outdent
- Insert Image
- Insert Link
- Text Color
- Text Background Color
Milestone
- Blockquote
Attribute change of editor
- Font Size
- Background Color
- Width
- Height
Setup
Gradle
repositories { jcenter() } dependencies { compile 'jp.wasabeef:richeditor-android:0.0.2@aar' }
Functions
Bold
RichEditor editor = (RichEditor) findViewById(R.id.editor); editor.setBold();
Italic
RichEditor editor = (RichEditor) findViewById(R.id.editor); editor.setItalic();
Insert Image
RichEditor editor = (RichEditor) findViewById(R.id.editor); editor.insertImage("https://raw.githubusercontent.com/wasabeef/art/master/推ter.png","推ter");
Text Change Listener
RichEditor editor = (RichEditor) findViewById(R.id.editor); editor. setOnTextChangeListener(new RichEditor.OnTextChangeListener() { @Override public void onTextChange(String text) { // Do omething Log.d("RichEditor", "Preview " + text); } });
Others
Please refer the samples for usage.
Requirements
Android 4+