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

Mohan manu

02/15/2022, 5:10 AM
Is there a way we can customise keyboard with compose? Not able to find any blogs related to this Thanks in advance
j

Joseph Hawkes-Cates

02/15/2022, 5:19 AM
You can check out the “keyboardOptions” parameter for the TextField composable. It has a KeyboardType to flex things like keyboards for email, phone numbers, passwords, etc. KeyboardOptions also has fields for autoCorrect and the imeAction setting.
👍 1
There’s some brief documentation on it here: https://developer.android.com/jetpack/compose/text#keyboard-options
m

Mohan manu

02/15/2022, 5:22 AM
Yeah but in my case I need to customise the keyboard by adding custom buttons, don't want to use the system keyboard, is there a way I can do it with compose?
j

Joseph Hawkes-Cates

02/15/2022, 5:55 AM
As far as I know your app can’t alter the users keyboard beyond those settings unless you’re talking about making a keyboard app with compose.
m

Mohan manu

02/15/2022, 6:02 AM
Yes I want to create custom keyboard, with compose with limited set of numbers and characters and symbols
j

Joseph Hawkes-Cates

02/15/2022, 4:47 PM
ah gotcha, sounds cool. That seems like something you could do in Compose, but I’m not familiar with how keyboard apps are created so can’t say for sure. Hopefully someone else knows.
z

Zach Klippenstein (he/him) [MOD]

02/16/2022, 2:13 PM
You could create something that looks like a keyboard but is part of your screen. Probably just a grid with buttons. You would just need to coordinate it’s visibility with the IME.
7 Views