Jasmin Fajkic
11/04/2022, 8:18 PM"title": {
"text": "{0} shared a feeling",
"actions": [
{
"text": "Sara+021122",
"action": "test1",
"id": "9f714870-1c79-4398-ab0e-0b699d39606f"
}
],
"badgeName": "mood-level-4"
}
and now i need to construct from this :
“Sara+021122 shared a feeling” where Sara+021122 is clickable part of text. More in 🧵Jasmin Fajkic
11/04/2022, 8:21 PM"title": {
"text": "{0} shared a feeling and {1} is awesome",
"actions": [
{
"text": "Sara+021122",
"action": "test1",
"id": "9f714870-1c79-4398-ab0e-0b699d39606f"
},
{
"text": "Jasmin",
"action": "test2",
"id": "9f714870-1c79-4398-ab0e-0b699d39606f"
}
],
"badgeName": "mood-level-4"
}
And I need to construct text like Sara+021122 shared a feeling and Jasmin is awesome where Jasmin and Sara are clickable parts. I followed documentation with annotated strings but still not have clear idea how to make this data model to work. Any help maybe as I lost whole day 🙂orangy
buildAnnotatedString { items.forEach { when(it) { ReferenceItem -> …} } }
and put appropriate code with annotations for URLs and plain text sections
• follow examples on how to make annotated string to responds to clicks 🙂Jasmin Fajkic
11/04/2022, 8:42 PMorangy
0
) or plain TextItem with the actual text. When building annotated string, for ReferenceItem you would retrieve index, and then get info from actions to build actual dataorangy
0
index right during parsing and make LinkItem
with all data right there. Depends on how you structure your codeJasmin Fajkic
11/04/2022, 8:48 PMCasey Brooks
11/04/2022, 9:10 PMJasmin Fajkic
11/04/2022, 9:15 PMCasey Brooks
11/04/2022, 9:23 PMJasmin Fajkic
11/04/2022, 11:03 PM