Gradlerepositories {
jcenter()
}
dependencies {
compile 'jp.wasabeef:richeditor-android:[email protected]'
}
粗体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);
}
});