I’ve ran into a bit of an issue as I’d like two TextViews to layout side-by-side even if the first TextView has several lines of text. Ideally, the next TextView should simply follow right after. It’s a bit hard to explain, so I’ve made this picture to illustrate it:

(the first TextView contains a title, and the second TextView contains a year)
I’ve been trying a few different things now, both layout hacks and using Html.fromHtml(), but nothing has worked so far. It’s probably impossible to do, but I just wanted to be sure.
This sounds like a job for
Spannable. As you’ve noticed the problem with doing two views is that the bounds of theTextViewin your two line example is still a rectangle, so laying out the second view at the end of the text gets tricky. HTML can work for simple tags (bold, underline, headings), but isn’t too flexible.The solution is to use
Spannableto create the text ouf of pieces of content with specific formatting applied to each “span”. As it turns out, then you can just stick the whole results right into a singleTextView. Something like:There are a ton of different span definitions in
android.text.style, the above is just an example to create two different text sizes in the same string. You should be able to get what you want out of this one,TextAppearanceSpan,TypefaceSpan, or some other combination.HTH