youlookwhat / RichEditorView

Android 基于WebView的富文本编辑器 - 仿简书编辑器

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RichEditorView

Android 基于WebView的富文本编辑器 - 仿简书编辑器

Functions

  • Bold
  • Italic
  • Strikethrough
  • Blockquote
  • Heading 1
  • Heading 2
  • Heading 3
  • Heading 4
  • Line
  • Undo
  • Redo
  • Insert Image
  • Insert Product(Custom layout)

特点:

  • 点击内容部分,键盘会将底部菜单栏弹起,点击标题则收起
  • 文字会自动定位在菜单栏的上方
  • 文字类型标识如加粗,删除线会根据光标位置自动改变

Setting for Editor

richEditor.edThishtml();                  // 获取标题和内容
richEditor.edUpcover(headerImageSrc);     // 添加封面图片
richEditor.edAddimgsrc(contentImageSrc);  // 添加内容图片
richEditor.edAddProduct(123, new Gson().toJson(goodsBean)); // 添加产品
richEditor.edOutdata(mTitle, mContent);  // 回显内容

Screenshots

Project Origin

为什么会有此开源项目?

公司准备在自己App内做编辑器模块,本来想用百度的开源编辑器,但是功能太复杂,参考了很多类似的编辑器都达不到项目需要的效果。结果发现了RichEditorWeb,基本功能都满足,就在此项目中做了修改,并运用到自己的项目中。感谢此项目的提供者。

在移植到项目中时,出现很多问题(如键盘上面的布局不弹起),为了解决这些问题并在其基础上扩展功能 花费了大量时间。在此特地将编辑器从项目中剥离出来,供后来的朋友参考借鉴。 如有帮助,还请Star一下,支持一下作者,非常感谢~

Question

  • 如果用户自己输入单个 英文单引号',或双引号",会回显不出来,因为html会识别为没有另一个结束符而报错。chromium: [INFO:CONSOLE(1)] "Uncaught SyntaxError: missing ) after argument list", source: file:///android_asset/rich/editor.html (1)

Thanks

License

Copyright (C) 2016 Bin Jing

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Android 基于WebView的富文本编辑器 - 仿简书编辑器

License:Apache License 2.0


Languages

Language:Java 80.6%Language:JavaScript 15.7%Language:CSS 3.0%Language:HTML 0.7%