0

I'm developping a chat application, and I have a textview to which I append each message formatted in HTML. So something like that :

textView.append(Html.fromHtml(message));

Example of a message : <b><font color=\"#ababab\">User</font></b>: This is a test message<br />

Now what I want to do is insert a custom line spacing between each append. Unfortunately, a line break (append "\n" or another <br />) is too high.

Also, tinkering with android:lineSpacingMultiplier does the exact opposite of what I want : it adds a spacing between lines of a single message that had to be broken down in multiple lines by the TextView, but it does nothing between each append.

I've also tried using LineHeightSpan but it didn't change anything.

Thanks in advance for your suggestions.

Ely
  • 1,189
  • 9
  • 12
  • Have you tried like `textView.append(Html.fromHtml("
    "));`
    – Shree Krishna May 30 '16 at 17:34
  • That didn't work, but I finally got it working by extending LineHeightSpan. The problem is that I was trying to apply it on the view's EditableText while I should have done it before, on the spannable. – Ely May 31 '16 at 14:10

0 Answers0