Hey guys. Is it possible to convert Spannable to compose Text style?
z
Zach Klippenstein (he/him) [MOD]
09/07/2021, 2:28 PM
Not losslessly. Spannables can do things that compose text styles cannot, eg click handling, drawing.
а
Антон X
09/07/2021, 2:36 PM
@Zach Klippenstein (he/him) [MOD] Thank you, i see. And do we have some kind of helper which may help us to convert existing spannable string to compose annotated string?
z
Zach Klippenstein (he/him) [MOD]
09/07/2021, 2:37 PM
I don’t think there’s an official api for doing that, because it’s impossible to do so completely in all cases. But it shouldn’t be too hard to write something to map the spans you care about to text style ranges if you don’t need that complete functionality.