You can have look at
TagCsBuilder a class that I had made some time ago.
TagCSBuilder is a class built on top of CSBuilder (source code include, and no external dependencies).
With
TagCSbuilder the formatting information is not provided by method calls but by tags included in a string.
This makes it easier to modify the formatting by changing the tags or save/restore : it's string manipulation
https://www.b4x.com/android/forum/threads/charsequence-tagcsbuilder.127015/
Hi!
Very good! A fantastic code! It helped me a lot for what I need. It allowed me to make additions so that when defining a text box, you can mark a word or text snippet and format it as desired. Almost a text editor! (after fully ready I can share).
However, I still have a serious problem that without solving it is useless: Imagine that I have a text in the text box that is formatted (with colors, styles and without tags, as it is already the processed content). If the person adds some word in it, I can't get the new text (previous formatting with new word).
When the person formats the text, I keep a copy of it with the tags in a variable, but I have no way to "mirror" what is being typed in the text box in this variable with the tags, as the positions vary a lot and it would be very complex this processing. Do you have any idea, suggestion?