@@ -555,18 +555,28 @@ private object TextEffectiveStateManagement2 {
555
555
// [START android_compose_text_link_1]
556
556
@Composable
557
557
fun AnnotatedStringWithLinkSample () {
558
- // Display a link in the text
558
+ // Display multiple links in the text
559
559
Text (
560
560
buildAnnotatedString {
561
- append(" Build better apps faster with " )
561
+ append(" Go to the " )
562
562
withLink(
563
563
LinkAnnotation .Url (
564
- " https://developer.android.com/jetpack/compose " ,
564
+ " https://developer.android.com/" ,
565
565
TextLinkStyles (style = SpanStyle (color = Color .Blue ))
566
566
)
567
567
) {
568
- append(" Jetpack Compose " )
568
+ append(" Android Developers " )
569
569
}
570
+ append(" website, and check out the" )
571
+ withLink(
572
+ LinkAnnotation .Url (
573
+ " https://developer.android.com/jetpack/compose" ,
574
+ TextLinkStyles (style = SpanStyle (color = Color .Green ))
575
+ )
576
+ ) {
577
+ append(" Compose guidance" )
578
+ }
579
+ append(" ." )
570
580
}
571
581
)
572
582
}
@@ -597,7 +607,7 @@ fun AnnotatedStringWithListenerSample() {
597
607
// [END android_compose_text_link_2]
598
608
599
609
@Composable
600
- private fun TextSample (samples : Map <String , @Composable ()- > Unit >) {
610
+ private fun TextSample (samples : Map <String , @Composable () - > Unit >) {
601
611
MaterialTheme {
602
612
Box (
603
613
Modifier
@@ -631,6 +641,7 @@ private const val SAMPLE_LONG_TEXT =
631
641
" It simplifies and accelerates UI development on Android bringing your apps " +
632
642
" to life with less code, powerful tools, and intuitive Kotlin APIs. " +
633
643
" It makes building Android UI faster and easier."
644
+
634
645
@Composable
635
646
@Preview
636
647
fun LineBreakSample () {
0 commit comments