I'm trying to create a textview within a bottomsheetdialog, with example layout as shown below. I've put my desired formatting notes in brackets Most of the spanned texts (bold, underlined etc.) are easy to create
Linespacing of 2 is easy with "\n\n", but how do I create 1.5 line spacing between certain lines? I'm adding text dynamically, using append(...), so I can't use the android:text atribute in the layout xml. Most of the examples I've seen have line spacing hard-wired into xml too which applies to all the text. I've found that you can apply different line spacings for paragraphs, but the "\n" would break the paragraph and the different line spacing won't work.
title (underlined, bold, very large)
(linespace 1.5)
blurb
(linespace 2)
sub-section1 (underlined, bold, large)
(linespace 1.5)
ClickableSubheading1
(linespace 1.5)
clickableSubheading2
(linespace 1.5)
[could be many more subheadings here...]
(linespace 2)
sub-section2 (underlined, bold, large)
(linespace 1.5)
ClickableSubheading1a
(linespace 1.5)
clickableSubheading2a
(linespace 1.5)
[could be many more subheadings here...]
etc - more subsections to be added as and when needed
NB: the clickable sub headings apply code implicit to the app, and are not hyperlinks (I thought about doing the whole lot as html and then reading that into my textview) Basically, what I need is a span, or similar that says "put a linebreak, m times '\n' here", where 'm' can be any value