How to make clickable span text in Jetpack Compose - android

So I want to make a footnote-like feature in compose that highlight texts that contain numbers and clickable also. for the example:
I made this once without Jetpack Compose (View XML) with SpannableString builder, filtered the texts with regex, and applied it into setText().
How can I make this in Jetpack Compose?

Related

How to remember focused element on lazyRow when it is not focused? Jetpack compose android

I would like to make lazyColumn with lazy rows which will be scrolled separately. Also one element would have focus with scrolling. but when I would change focus on other row I would like to remember position of focused element before, and come back to it(like video segments on YouTube TV) is it possible?
I am trying to use remember value but it take index of focused element in other row.

How can we define ClipToPadding in Jetpack compose as well?

How can we define ClipToPadding in Jetpack compose as well?
Consider we have a card component that inside of it we have buttons with shadow, how can we have the ClipToPadding=false in Compose?

Android Compose Text Can we have two different texts set to the start and to the end of parent using same Text() field?

I am trying to use just one Text composable and have two different texts displayed to the start of the parent and to the end of the parent. Is there a recommended way of doing it? I was looking at the official documentation for Text composable and I could only find that using "buildAnnotatedString", we can have multiple texts vertically stacked on top of each other with the help of withStyle and lineHeight. But I am trying to do something like this:Total $40 But "Total" should be all the way to the left and
"$40" should be all the way to the right.

Textview and edit text loses contents from Listview and recyclerview

First I used custom Listview, when i set some content on edit text and select value from dropdown list and after scrolling listview I lost my text view and edit text contents.
Then I use Recyclerview. but same happens with recyclerview too. I again lost contents from textview and edittext.
Are you talking about a FloatingActionButton, I guess?
It subclasses from ImageButton, so was not likely designed with text in mind, but rather, an image. An ImageButton in turn is also an ImageView.
Other Peoples' Solutions
So, you could look up how people have gone about adding text on top of those more common elements. Here are just a few topics on this very site, that came up quickly:
Adding text to ImageView in Android
how to set a text over an imageView?
How to show the text on a ImageButton?
My Ideas
One of several approaches that come to mind would be to implement the FloatingActionButton's onDraw(Canvas canvas) method, and then call drawText() on the Canvas object it receives.
Another idea is to arrange to have a TextView shown on top of the FloatingActionButton.
Or, alternately, don't use FloatingActionButton, but something that more readily accepts text.

How to use Text.StaticLayout in android

I am developing a custom view extending View in android that contains a long text to be drawn. I would like to marquee the text. I am not able to understand how to use StaticLayout or BoringLayout in android to Marquee.

Categories

Resources