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

cb

12/02/2020, 8:47 PM
🚀 Accompanist v0.4.0 has been released. The big feature is the new animated insets support (keyboard animations). ⌨️ https://github.com/chrisbanes/accompanist/releases/tag/v0.4.0
👏 7
🎉 25
a

Adriano Celentano

12/03/2020, 2:19 PM
Copy code
ProvideWindowInsets(windowInsetsAnimationsEnabled = true) {
                Box(Modifier.fillMaxSize()) {
                    TextField(
                        value = "test",
                        onValueChange = {},
                        modifier = Modifier
                            .align(Alignment.BottomCenter)
                            .navigationBarsWithImePadding()
                            .padding(bottom = 50.dp)
                    )
                }
            }
shouldnt the TextField be above the Keyboard ?
c

cb

12/03/2020, 2:24 PM
You’re missing the
WindowCompat.setDecorFitsSystemWindows(window, false)
Oh, and you also need to manually set
android:windowSoftInputMode="adjustResize"
on the activity
a

Adriano Celentano

12/03/2020, 2:29 PM
ah i wasnt ware there are even samples, super nice thank you 🙏
c

cb

12/03/2020, 2:35 PM
It is but it's hidden. I'll add this to the docs, and see if I can make it a runtime exception
💪 2
Thanks for flagging btw. I'm just merged in some improved docs: https://chrisbanes.github.io/accompanist/insets/. (PR: https://github.com/chrisbanes/accompanist/pull/161)
👍 1
2 Views