Issue
I have a screen where some textfields
I want to show a 'fake' keyboard. The keyboard should be able have as many buttons as I like and be displayed however I want. Just as shown below.
My question then is how do you accomplish something like this?
Is it possible to somehow override the interface to the keyboard so you consume the input and can display a 'fake' keyboard. And then remove the 'fake' keyboard when clicking on the back button on any other textfield
which uses the normal keyboard.
Or do I have to create a custom @Composable
or TextView
with custom callbacks, and also render the text cursor manually?
Solution
You can implement your own TextInputService
or provide null
to completely disable the default input service:
CompositionLocalProvider(
LocalTextInputService provides null // or myTextInputService
) {
TextField(
value = text,
onValueChange = { text = it },
)
}
where myTextInputService
is something like:
TextInputService(object : PlatformTextInputService {
//TODO implement methods
}
Answered By - Gabriele Mariotti
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.