'Build Software Keyboard with Jetpack Compose - Add 3 additional buttons on top of keyboard

I need to create a custom software keyboard and add 3 buttons in the top: the underline, bold, italic buttons.

When clicking on the TextField I need to be able to show this custom keyboard.

    TextField(
        value = textValue,
        modifier = Modifier
            .padding(16.dp)
            .fillMaxWidth(),
        placeholder = { Text(text = "John Doe") },

        textStyle = TextStyle(
            color = Color.Gray,
            fontSize = 20.sp,
            //  fontWeight = FontWeight.Bold,
            //  textDecoration = TextDecoration.Underline
        ),

        // Update value of textValue with the latest value of the text field
        onValueChange = {
            textValue = it
        },

        keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
        keyboardActions = KeyboardActions(
            onDone = {
                keyboardController?.hide()
                // do something here
            }
        )

Also, how to call the custom keyboard when user clicks on the TextField?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source