Implementing a rich text editor in Android?

Solution 1:

I just published my rich text editor component under the Apache 2.0 license:

https://github.com/1gravity/Android-RTEditor

enter image description here

Solution 2:

You can make use of any of the following libraries:-

https://github.com/commonsguy/cwac-richedit

https://github.com/chinalwb/Android-Rich-text-Editor

https://github.com/wasabeef/richeditor-android

https://github.com/irshuLx/Android-WYSIWYG-Editor

Solution 3:

I would probably extend both EditText and TableLayout or at least end up using most of their source if there were big enough changes I needed to make.

Solution 4:

Can you do the following:

  1. Manually hold the contents in the EditText as your own model (ie by seperating and maintaing the content document and the view attributes as seperate entities).
  2. Override the render (or draw method) to do custom layout on parts of the content document (part of your model) that handle non text characters (say bullets with particular attribute).

To me seems like if you have to muck about with the layout, are you better off writing it from scratch on your own. From what I remember the Edit text (and the richt text editor) is great for anything where you the data is pure text.

Solution 5:

There is an open source EditText rich text editor called android-richtexteditor but the code was inexplicably deleted in r5. The code is still there in r4; just use svn to check out r4 or earlier to access it. The code appears to support italics, underline, color picker, text size, and more.

Also answered in these questions: 1, 2