Add padding to dialogs when keyboard is open on Android #4182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
Because of the needed changes on Android for the keyboard to behave correctly for DMs (as well as, eventually, the composer), it seems to have affected some users ability to properly scroll down to the button for saving alt-text. This is also apparent on the report dialog. Although it doesn't break functionality (the text can still be input) it isn't possible to see the input, since the container does not get resized correctly.
While it would be possible to use a
KeyboardAvoidingView
inside of the new dialogs fairly easily, this becomes complicated with dialogs that are presented inside of the composer itself. That is because our composer is actually a dialog in the old system, and then we are presenting another new dialog inside of that one. This results in aKeyboardAvoidingView
that wrap otherKeyboardAvoidingView
s. Eventually we won't have this problem, if we move to a better dialog for the composer.For now, we can use an animated view to apply the padding on Android as needed. This actually results in a better experience than what we had before - the input is automatically scrolled to now, something that previously only worked well on iOS.
Test Plan
There are a variety of dialogs on Android where this is useful at. There is no change on iOS, since
null
is returned instead of a view on that platform.Report Dialog
Screen.Recording.2024-05-22.at.6.14.32.PM.mov
Alt Text
Screen.Recording.2024-05-22.at.6.15.29.PM.mov
Appeal Dialog
Screen.Recording.2024-05-22.at.6.19.06.PM.mov