-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customizing background colors for text links #286
Comments
You can provide background color via the Markdown(
MARKDOWN,
imageTransformer = Coil3ImageTransformerImpl,
typography = markdownTypography(
link = MaterialTheme.typography.body1.copy(
fontWeight = FontWeight.Bold,
textDecoration = TextDecoration.Underline,
background = Color.Red
),
),
extendedSpans = markdownExtendedSpans {
remember {
ExtendedSpans(
RoundedCornerSpanPainter(),
)
}
},
) setting background will also then result in the |
Thank you for the hint. Is there a way to apply the background only when the link is pressed? |
The links are styled purely with an annotated string. I don't believe |
Would you be open to change the implementation to |
Oh that was added in compose 1.7.x - that's quite a nice API addition, however it also means some significant refactoring as all the link handling right now is based on logic required prior to compose 1.6.x and I think most of it can probably now be dropped. However it also does not play well with the extended spans feature, so I first need to add compatiblity |
Thank you for the clarification. Please take your time. |
just completed the rework of the extended-spans to support it. It won't support different interactions at this time - so your usecase will only be supported without the use of the squiggly underline. |
PR opened here: #294 |
It works like a charm. I successfully tested the feature with version I am looking forward to the release version. |
Environment
Context
[Example link](https://example.com)
.Use case
Screen_recording_20250130_173923.mp4
Feature request
TextLinkStyles
).Related
The text was updated successfully, but these errors were encountered: