Closed jpudysz closed 2 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
react-native-unistyles-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 15, 2024 9:00am |
Summary
Fixes #239
With this PR, from Android 11 onwards,
rt.insets.bottom
will immediately get the correct bottom inset when the keyboard starts to animate (hide). For lower Android versions, this is not possible as such an API does not exist.It also enables reading the real-time value for the bottom inset with
rt.insets.bottom
when the app is showing the keyboard. For keyboard hiding animations,rt.insets.bottom
will always be set to the app bottom inset (for optimization).Examples:
1) Keyboard is hidden
rt.insets.bottom
is updated multiple times, e.g., 40 -> 36 -> 34 -> 32 -> 25 -> ... -> 0.useStyles
hook re-renders the View only once with value 0.2) Keyboard is visible
rt.insets.bottom
is updated immediately from the previous inset 0 -> 40.useStyles
hook re-renders the View only once with value 40.In the next major version of Unistyles
rt.insets.bottom
will be update for every pixel.