I need library that highlight HTML, CSS and JavaScript code. And also User can edit the code.
Asked
Active
Viewed 239 times
0
-
https://github.com/amlcurran/ShowcaseView – Chaudhary Amar Jan 05 '16 at 03:56
-
I haven't found the library – Emma Hoffman Jan 05 '16 at 03:57
-
https://github.com/amlcurran/ShowcaseView/tree/master/library – Chaudhary Amar Jan 05 '16 at 03:59
-
That's not what I want. Thnx anyway – Emma Hoffman Jan 05 '16 at 04:02
-
http://stackoverflow.com/questions/11987660/android-syntax-highlighting – Amit Vaghela Jan 05 '16 at 05:24
1 Answers
0
It seems to be hard to implement, but here is a recipe to make it.
To highlight codes in various styles, you can use https://github.com/binaryfork/Spanny work. It is appliable to
TextView
orEditText
, as the result of Spanny is aSpannable
object.And, to analyze a text file as a HTML, CSS, JavaScript code semantic, you can use Jsoup and iterate each element in order to highlight them with styles. One example usage of Jsoup in Android is shown here.
Above two will show you highlighted output, but not editable as you type. One definite thing to do is to use
EditText.addTextChangedListener
event handler. Rest of editing and displaying fineSpannable
result can be found from EditText with Emoticons trials.