@@ -555,18 +555,28 @@ private object TextEffectiveStateManagement2 {
555555// [START android_compose_text_link_1]
556556@Composable
557557fun AnnotatedStringWithLinkSample () {
558- // Display a link in the text
558+ // Display multiple links in the text
559559 Text (
560560 buildAnnotatedString {
561- append(" Build better apps faster with " )
561+ append(" Go to the " )
562562 withLink(
563563 LinkAnnotation .Url (
564- " https://developer.android.com/jetpack/compose " ,
564+ " https://developer.android.com/" ,
565565 TextLinkStyles (style = SpanStyle (color = Color .Blue ))
566566 )
567567 ) {
568- append(" Jetpack Compose " )
568+ append(" Android Developers " )
569569 }
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(" ." )
570580 }
571581 )
572582}
@@ -597,7 +607,7 @@ fun AnnotatedStringWithListenerSample() {
597607// [END android_compose_text_link_2]
598608
599609@Composable
600- private fun TextSample (samples : Map <String , @Composable ()- > Unit >) {
610+ private fun TextSample (samples : Map <String , @Composable () - > Unit >) {
601611 MaterialTheme {
602612 Box (
603613 Modifier
@@ -631,6 +641,7 @@ private const val SAMPLE_LONG_TEXT =
631641 " It simplifies and accelerates UI development on Android bringing your apps " +
632642 " to life with less code, powerful tools, and intuitive Kotlin APIs. " +
633643 " It makes building Android UI faster and easier."
644+
634645@Composable
635646@Preview
636647fun LineBreakSample () {
0 commit comments