0

I need library that highlight HTML, CSS and JavaScript code. And also User can edit the code.

Emma Hoffman
  • 61
  • 2
  • 7

1 Answers1

0

It seems to be hard to implement, but here is a recipe to make it.

  1. To highlight codes in various styles, you can use https://github.com/binaryfork/Spanny work. It is appliable to TextView or EditText, as the result of Spanny is a Spannable object.

  2. 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.

  3. 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 fine Spannable result can be found from EditText with Emoticons trials.

Community
  • 1
  • 1
Youngjae
  • 24,352
  • 18
  • 113
  • 198