is there a way write a composable screen which support keyboard awareness, which mean when keyboard show or hide, it will re-compose.
z
Zach Klippenstein (he/him) [MOD]
04/15/2021, 5:39 PM
I don’t know if it comes built-in, but you could use the recent Android keyboard controller APIs (i think introduced in android 10?) to observe changes to window insets/keyboard state. Accompanist has support for observing window insets. For the low-level apis see this blog post
➕ 1
a
Adam Powell
04/15/2021, 6:06 PM
generally you want to key off of things like available space rather than presence or absence of a soft keyboard. Between chromeos devices running android apps and compose for desktop, "soft keyboard showing" isn't a good signal for much of anything.