File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
compose/snippets/src/main/java/com/example/compose/snippets/text Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -550,17 +550,29 @@ private object TextEffectiveStateManagement2 {
550
550
// [START android_compose_text_link_1]
551
551
@Composable
552
552
fun AnnotatedStringWithLinkSample () {
553
- // Display a link in the text
553
+ // Display multiple links in the text
554
554
Text (
555
555
buildAnnotatedString {
556
- append(" Build better apps faster with " )
556
+ append(" Go to the " )
557
557
withLink(
558
558
LinkAnnotation .Url (
559
559
" https://developer.android.com/jetpack/compose" ,
560
560
TextLinkStyles (style = SpanStyle (color = Color .Blue ))
561
561
)
562
562
) {
563
- append(" Jetpack Compose" )
563
+ append(" Android Developers " )
564
+ pop()
565
+ append(" website, and check out the" )
566
+ }
567
+ withLink(
568
+ LinkAnnotation .Url (
569
+ " https://developer.android.com/jetpack/compose" ,
570
+ TextLinkStyles (style = SpanStyle (color = Color .Green ))
571
+ )
572
+ ) {
573
+ append(" Compose guidance" )
574
+ pop()
575
+ append(" ." )
564
576
}
565
577
}
566
578
)
You can’t perform that action at this time.
0 commit comments