SimpleTextField

fun SimpleTextField(modifier: Modifier = Modifier, state: PCIFieldState, onEvent: (SimpleTextFieldEvent) -> Unit, enabled: Boolean = true, readOnly: Boolean = false, decorationBox: @Composable (innerTextField: @Composable () -> Unit) -> Unit = @Composable { innerTextField -> innerTextField() }, textStyle: TextStyle = MaterialTheme.typography.bodyLarge, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, cursorBrush: Brush = SolidColor(MaterialTheme.colorScheme.primary), visualTransformation: VisualTransformation = VisualTransformation.None)

A PCI-compliant simple text input component for handling generic text input.

This component provides a secure and flexible input field that can be used for any type of text input in PCI-compliant contexts. It wraps the base PCITextField with a simplified event interface while maintaining all the security features.

The component integrates with PCIFieldState for secure input management and provides events through SimpleTextFieldEvent for handling focus changes and value changes.

Features:

  • PCI-compliant input handling

  • Flexible for any text input use case

  • Real-time input state feedback

  • Customizable appearance and behavior

Example usage:

val state = rememberPCIFieldState()

SimpleTextField(
state = state,
onEvent = { event ->
when (event) {
is SimpleTextFieldEvent.OnValueChanged -> {
// Handle value change
}
is SimpleTextFieldEvent.OnFocusChanged -> {
// Handle focus change
}
}
},
textStyle = MaterialTheme.typography.bodyLarge
)

Parameters

modifier

Modifier to customize the style and behavior of the field

state

A PCIFieldState object that manages the secure input data

onEvent

Callback triggered for field events (focus changes, value changes)

enabled

Controls whether the field is interactive

readOnly

Controls whether the field is editable

decorationBox

Composable for adding decorative elements around the text field

textStyle

Text style applied to the input content

keyboardOptions

Configuration for the software keyboard

keyboardActions

Callbacks for keyboard action events

cursorBrush

Brush applied to customize the cursor appearance

visualTransformation

Visual transformations applied to the input text

See also