RichEditor for Android

repositories { jcenter()}dependencies { compile 'jp.wasabeef:richeditor-android:1.2.1'}

Height

editor.setEditorHeight(200);

Font

editor.setEditorFontSize(22);
editor.setEditorFontColor(Color.RED);

Background

editor.setEditorBackgroundColor(Color.BLUE);
editor.setBackgroundColor(Color.BLUE);
editor.setBackgroundResource(R.drawable.bg);
editor.setBackground("https://raw.githubusercontent.com/wasabeef/art/master/chip.jpg");

Padding

editor.setPadding(10, 10, 10, 10);

Placeholder

editor.setPlaceholder("Insert text here...");

Bold

editor.setBold();

Italic

editor.setItalic();

Insert Image

editor.insertImage("https://raw.githubusercontent.com/wasabeef/art/master/twitter.png","twitter");

Text Change Listener

RichEditor editor = (RichEditor) findViewById(R.id.editor);
editor. setOnTextChangeListener(new RichEditor.OnTextChangeListener() 
{ 
@Override
 public void onTextChange(String text) 
{ 
// Do Something Log.d("RichEditor", "Preview " + text); 
}
}
);

Requirements
Android 4+

demo2.gif

Bold
Italic
Subscript
Superscript
Strikethrough
Underline
Justify Left
Justify Center
Justify Right
Blockquote
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Undo
Redo
Indent
Outdent
Insert Image
Insert Link
Checkbox
Text Color
Text Background Color
Text Font Size
Unordered List (Bullets)
Ordered List (Numbers)

demo.gif

Attribute change of editor

Font Size
Background Color
Width
Height
Placeholder
Load CSS
State Callback

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 不会用代码框,所以看着有些乱套,,,,html部分 <!DOCTYPE html> 迅雷看看 ...
    这就是个帅气的名字阅读 5,442评论 0 0
  • 1、垂直对齐 如果你用CSS,则你会有困惑:我该怎么垂直对齐容器中的元素?现在,利用CSS3的Transform,...
    kiddings阅读 8,382评论 0 11
  • 选择qi:是表达式 标签选择器 类选择器 属性选择器 继承属性: color,font,text-align,li...
    wzhiq896阅读 5,785评论 0 2
  • 我这一代可以接触到历史转折的机会是最多的。 这是最好的一代,也是最坏的一代。 经典闪光灯,关键词 1. 未来三大问...
    3分钟即兴演讲阅读 4,177评论 0 2
  • 良好的习惯是人在其神经系统中存放的道德资本,这个资本不断增值,而人在整个一生中就享受着它的利息。 本系列一共三篇:...
    李浪溪_WaterLee阅读 5,276评论 1 7