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

Add padding to dialogs when keyboard is open on Android #4182

Merged
merged 4 commits into from
May 23, 2024

Conversation

haileyok
Copy link
Contributor

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 a KeyboardAvoidingView that wrap other KeyboardAvoidingViews. 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

Copy link

render bot commented May 23, 2024

Copy link

Old size New size Diff
7.29 MB 7.29 MB 18 B (0.00%)

Copy link
Member

@estrattonbailey estrattonbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a slick solution to me

@haileyok haileyok merged commit 5217876 into main May 23, 2024
6 checks passed
@haileyok haileyok deleted the hailey/keyboard-padding branch May 23, 2024 17:01
haileyok added a commit that referenced this pull request May 23, 2024
* add keyboard padding to android dialogs

* missing `keyboardDismissMode` for `ScrollableInner`

* add to `MutedWords`

* add to `LabelsOnMe`

(cherry picked from commit 5217876)
estrattonbailey added a commit that referenced this pull request May 23, 2024
* origin/main:
  Remove `getProfile` calls when loading feed (#3881)
  Log error statuses from failed resume session calls (#4174)
  disable alt text auto focus on Android (#4198)
  [🐴] add link to chat settings from main settings (#4197)
  ✍️ Add OTA Docs (#4187)
  Decrease thickness of border on message input (#4196)
  [🐴] better error message for "Bad token scope" error (#4194)
  Add padding to dialogs when keyboard is open on Android (#4182)
  [🐴] Do not init event bus if no session (#4193)
  stop line breaks for timeelapsed (#4191)
  Reduce polling when app is backgrounded (#4192)
  implement a safari hack for ime (#4186)
  [🐴] Suspend event bus when switching accounts (#4190)
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