Last active
December 8, 2021 17:13
-
-
Save FStranieri/6237386b20c6bffac6b92bb537f2f9da to your computer and use it in GitHub Desktop.
The list of available languages to translate on Cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
LazyColumn( horizontalAlignment = Alignment.CenterHorizontally, | |
verticalArrangement = Arrangement.spacedBy(8.dp)) { | |
languages?.let { list -> | |
items(list.toList(), key = { it }) { lang -> | |
BuildTransLangCard(lang = lang, listener = listener) | |
} | |
} | |
} | |
... | |
} | |
@Composable | |
fun BuildTransLangCard(lang: String, listener: TextRecognitionComposableInterface) { | |
Card( | |
backgroundColor = Color.White, | |
elevation = 4.dp, | |
shape = RoundedCornerShape(8.dp), | |
modifier = Modifier.selectable(selected = false, | |
onClick = { listener.onLanguageToTranslateSelected(lang) } | |
) | |
) { | |
Text( | |
text = Locale.forLanguageTag(lang).displayName, | |
color = Color.Black, | |
fontSize = 22.sp, | |
modifier = Modifier.padding(16.dp) | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment