richeditor-android rich text editor
- Category: Text Input Box (EditText)
- Rating: ★★★★★
- Updated: 2015-04-03 08:46
- Size: 1579kb
- Development environment: Android Studio
- Views: 5768 times
- Downloads: 819 times
- Project address: https://github.com/wasabeef/richeditor-android
RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android.
introduce:
A rich text editor is an input control that can display (edit) graphic effects. A webview is actually a rich text control (but it cannot be edited). However, the functions supported by the webview are too large, so it is not suitable for small and beautiful applications. The pursuit of performance . This control is ideal for notepad applications.
running result:
Instructions for use:
Gradle
1
2
3
4
5
6
7
|
repositories {
jcenter()
}
dependencies {
compile
'jp.wasabeef:richeditor-android:0.0.2@aar'
}
|
bold
1
2
|
RichEditor editor = (RichEditor) findViewById(R.id.editor);
editor.setBold();
|
Italics
1
2
|
RichEditor editor = (RichEditor) findViewById(R.id.editor);
editor.setItalic();
|
Insert picture
1
2
|
RichEditor editor = (RichEditor) findViewById(R.id.editor);
editor.insertImage(
"https://raw.githubusercontent.com/wasabeef/art/master/twitter.png"
,
"twitter"
);
|
Listen for text changes
1
2
3
4
5
6
7
8
|
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);
}
});
|