This is my scenario, I need to get text value of clicked text:
@Composable
fun keyboard(){
val letters: Array<Pair<String, String>> = letterMap.toList().toTypedArray();
val txtModifier = Modifier
.clickable(onClick = { btnTapAction( /* send a letter */ ) })
for(i in 0..3)
Row(){
for(j in (i*8)..(i*8+7))
if (j<30)
Text(letters[j].first, txtModifier)
}
}
I have 30 Text's, each containing one cyrillic letter, they act like keyboard buttons, and I want to send clicked letter to function btnTapAction() which handles entered letters.
I have looked at documentation and I could not find a way to do it, but I hope it can be done?