WriteableText
fun WriteableText( isInWritingMode: MutableState<Boolean>, writableModifier: Modifier = Modifier, writeableTextColors: TextFieldColors = TextFieldDefaults.colors(
unfocusedContainerColor = MaterialTheme.colorScheme.primary,
focusedContainerColor = MaterialTheme.colorScheme.primary,
focusedIndicatorColor = MaterialTheme.colorScheme.inversePrimary,
unfocusedIndicatorColor = MaterialTheme.colorScheme.primary,
cursorColor = MaterialTheme.colorScheme.inversePrimary,
focusedTextColor = Color.White,
unfocusedTextColor = Color.White
), writeableTextWidth: Dp = 280.dp, writeableText: MutableState<String>, writeableTextStyle: TextStyle = LocalTextStyle.current.merge(
fontSize = 20.sp
), onWriting: (String) -> Unit = {
writeableText.value = it
}, placeholder: StringResource, placeholderStyle: TextStyle = LocalTextStyle.current.merge(
fontSize = 20.sp
), displayedTextModifier: Modifier = Modifier, displayedText: String = writeableText.value, displayedTextStyle: TextStyle = LocalTextStyle.current.merge(
fontSize = 20.sp
), changeEditModeClickingOnSimpleText: Boolean = true)
fun WriteableText( isInWritingMode: MutableState<Boolean>, writableModifier: Modifier = Modifier, writeableTextColors: TextFieldColors = TextFieldDefaults.colors(
unfocusedContainerColor = MaterialTheme.colorScheme.primary,
focusedContainerColor = MaterialTheme.colorScheme.primary,
focusedIndicatorColor = MaterialTheme.colorScheme.inversePrimary,
unfocusedIndicatorColor = MaterialTheme.colorScheme.primary,
cursorColor = MaterialTheme.colorScheme.inversePrimary,
focusedTextColor = Color.White,
unfocusedTextColor = Color.White
), writeableTextWidth: Dp = 280.dp, writeableText: MutableState<String>, writeableTextStyle: TextStyle = LocalTextStyle.current.merge(
fontSize = 20.sp
), onWriting: (String) -> Unit = {
writeableText.value = it
}, placeholder: String, placeholderStyle: TextStyle = LocalTextStyle.current.merge(
fontSize = 20.sp
), displayedTextModifier: Modifier = Modifier, displayedText: String = writeableText.value, displayedTextStyle: TextStyle = LocalTextStyle.current.merge(
fontSize = 20.sp
), changeEditModeClickingOnSimpleText: Boolean = true)
This component allows to display a text or writing a new one clicking on it or using the enableWritingMode method programmatically
Parameters
isInWritingMode
: the control flag used to enter or exit from the writing mode
writableModifier
: the Modifier to apply to the EquinoxTextField used in the writing mode
writeableTextColors
: the colors scheme used for the EquinoxTextField
writeableTextWidth
: the width of the EquinoxTextField
writeableText
: the text state used in the writing mode
writeableTextStyle
: the text style used for the writeableText
onWriting
: the action to execute during the writing mode
placeholder
: the placeholder to use for the EquinoxTextField
placeholderStyle
: the text style used for the placeholder
displayedText
: the text displayed in not-writing mode
displayedTextStyle
: the text style used for the displayedText
changeEditModeClickingOnSimpleText
: whether clicking on the Text the writing mode is directly enabled