Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correctly display cozy-apps when the device's Keyboard is displayed #1024

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Nov 21, 2023

fix: Prevent CozyAppScreen's WebView to move after loading animation

The KeyboardAvoidingView component struggles to adapt to Ui layout changes

With previous implementation, the one on CozyAppScreen would offset the View using the wrong values

This is because it is initialized while the isFirstHalf variable being false, and so when the dimensions.statusBarHeight is applied on top of the View, then the KeyboardAvoidingView won't notice the change

To prevent this, we want to avoid any change in the UI layout, and so we want the Animation to have no impact on it

This can be done by moving it outside of the main View

fix: Make cozy-apps handle status bar offset when keyboard is displayed

When using KeyboardAvoidingView we need to apply keyboardVerticalOffset based on the offset between the View that needs to react to keyboard and the top of the screen

Otherwise, the View wouldn't move enough when keyboard is displayed and it would appear behind it

Related documentation:
https://reactnative.dev/docs/keyboardavoidingview#keyboardverticaloffset

The `KeyboardAvoidingView` component struggles to adapt to Ui layout
changes

With previous implementation, the one on `CozyAppScreen` would offset
the View using the wrong values

This is because it is initialized while the `isFirstHalf` variable
being false, and so when the `dimensions.statusBarHeight` is applied on
top of the View, then the `KeyboardAvoidingView` won't notice the
change

To prevent this, we want to avoid any change in the UI layout, and so
we want the `Animation` to have no impact on it

This can be done by moving it outside of the main View
When using `KeyboardAvoidingView` we need to apply
`keyboardVerticalOffset` based on the offset between the View that
needs to react to keyboard and the top of the screen

Otherwise, the View wouldn't move enough when keyboard is displayed
and it would appear behind it

Related documentation:
https://reactnative.dev/docs/keyboardavoidingview#keyboardverticaloffset
@Ldoppea Ldoppea merged commit 8ccbdca into master Nov 21, 2023
1 check passed
@Ldoppea Ldoppea deleted the fix/keyboard_offset_android branch November 21, 2023 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants