Skip to content

Commit e8a46cb

Browse files
committed
added buttom text on the platform page and made learn more a link(still to add real link)
1 parent 2d53927 commit e8a46cb

1 file changed

Lines changed: 50 additions & 1 deletion

File tree

app/src/main/java/com/example/sw0b_001/ui/views/tabs/SupportedPlatformsViews.kt

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ import uniffi.relaysms_spec_payload.V1ContentCategories
7979
import uniffi.relaysms_spec_payload.V1PayloadsSupportedProtocols
8080
import uniffi.relaysms_spec_payload.v1ContentCategoryFromU8
8181
import uniffi.relaysms_spec_payload.v1PayloadSupportProtocolsFromU8
82+
import androidx.compose.foundation.text.ClickableText
83+
import androidx.compose.ui.text.SpanStyle
84+
import androidx.compose.ui.text.buildAnnotatedString
85+
import androidx.compose.ui.text.withStyle
86+
import androidx.compose.ui.text.style.TextDecoration
8287

8388

8489
@OptIn(ExperimentalLayoutApi::class, ExperimentalMaterial3Api::class)
@@ -248,7 +253,6 @@ fun PlatformListContent(
248253
}
249254
}
250255

251-
252256
Column(
253257
modifier = Modifier
254258
.fillMaxWidth()
@@ -283,6 +287,51 @@ fun PlatformListContent(
283287
}
284288
}
285289

290+
Spacer(modifier = Modifier.height(16.dp))
291+
292+
val infoText = buildAnnotatedString {
293+
append("Connect your accounts once while online. Send from any of them offline, anytime. ")
294+
pushStringAnnotation(
295+
tag = "learn_more",
296+
annotation = "learn_more"
297+
)
298+
withStyle(
299+
style = SpanStyle(
300+
color = MaterialTheme.colorScheme.primary,
301+
fontWeight = FontWeight.SemiBold,
302+
)
303+
) {
304+
append("Learn more")
305+
}
306+
307+
pop()
308+
}
309+
310+
311+
ClickableText(
312+
text = infoText,
313+
style = MaterialTheme.typography.bodySmall.copy(
314+
color = MaterialTheme.colorScheme.onSurfaceVariant,
315+
textAlign = TextAlign.Start
316+
),
317+
modifier = Modifier
318+
.fillMaxWidth()
319+
.padding(9.dp),
320+
onClick = { offset ->
321+
322+
infoText
323+
.getStringAnnotations(
324+
tag = "learn_more",
325+
start = offset,
326+
end = offset
327+
)
328+
.firstOrNull()
329+
?.let {
330+
// TODO: Navigate to Learn More page
331+
}
332+
}
333+
)
334+
286335

287336
val storeCallback : () -> Unit = {
288337
CoroutineScope(Dispatchers.Default).launch {

0 commit comments

Comments
 (0)