How to check from keyboard state whether showing o...
# compose
a
How to check from keyboard state whether showing or hiding?
c
You can use accompanist-insets for that
Copy code
val keyboardIsVisible = LocalWindowInsets.current.ime.isVisible
a
The value is true even the keyboard showing, I put
ProvideWindowInsets
at the top, am I missing another code?
c
You also need
android:windowSoftInputMode="adjustResize"
in your
Activity
in the manifest. See here.
a
Actually still give me true all time
c
We also have
WindowCompat.setDecorFitsSystemWindows(window, false)
in our app, in Activity.onCreate. The keyboard state works well.
1
a
Now it's working but the design was broken, anyway Thank you.