richeditor-android富文本编辑器
介绍:
富文本编辑器就是能显示(编辑)图文效果的输入控件,webview其实就是一个富文本控件(但是不能编辑),不过webview所要支持的功能过于庞大,因此不适合小而美的应用对性能的追求。该控件非常适合于记事本应用。
运行效果:
使用说明:
Gradle
repositories {
jcenter()
}
dependencies {
compile 'jp.wasabeef:richeditor-android:0.0.2@aar'
}
粗体
RichEditor editor = (RichEditor) findViewById(R.id.editor);
editor.setBold();
斜体
RichEditor editor = (RichEditor) findViewById(R.id.editor);
editor.setItalic();
插入图片
RichEditor editor = (RichEditor) findViewById(R.id.editor);
editor.insertImage("https://raw.githubusercontent.com/wasabeef/art/master/twitter.png","twitter");
监听文字改变
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);
}
});
已下载
0