https://kotlinlang.org logo
#compose
Title
# compose
a

alaershov

05/24/2022, 8:43 AM
Hello Composers! Is there any straightforward way to directly handle software keyboard input without using
TextField
? Or more specifically: what is the most reasonable way to create a PIN code input widget with input from software keyboard? I'm used to hacks with invisible
EditTexts
in View system, but I'd like very much to avoid this stuff in Compose and do it the right way. Any recommendations?
c

Chris Fillmore

05/24/2022, 1:57 PM
Do you want BasicTextField?
It's basically a text field without the ui, it just accepts the input
a

alaershov

05/24/2022, 3:00 PM
Maybe, I've found it in the sources of TextField, but the code is not the most straightforward, and I wasn't sure if I'm supposed to use it or not) Could you share some good articles on how to use BasicTextField? Is this the only way?
In particular, check how to use decorationBox parameter if you need it
a

alaershov

05/25/2022, 4:30 AM
Thanks Chris, I'll give it a try!
d

Daniele Segato

11/20/2022, 5:01 PM
@Chris Fillmore did you manage to do it? Can you share something for the next developer?
2 Views