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

Hide the keyboard when navigating from the chat room screen #3878

Merged

Conversation

jmartinesp
Copy link
Member

Content

Hide the keyboard when the composer is in use when:

  • We tap on the room details screen and navigate to it.
  • We tap on any room member details (avatar, display name) and navigate to their profiles.

Motivation and context

It seems like this became a regression.

Tests

  • Open the keyboard by tapping on the composer in a chat room.
  • Tap on the room header so the room details screen is opened. The keyboard should hide.
  • Go back.
  • Now tap on any user's info in the timeline to open their profile. The keyboard should hide here too.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 14

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@jmartinesp jmartinesp added the PR-Bugfix For bug fix label Nov 15, 2024
@jmartinesp jmartinesp requested a review from a team as a code owner November 15, 2024 15:15
@jmartinesp jmartinesp requested review from bmarty and removed request for a team November 15, 2024 15:15
Copy link
Contributor

github-actions bot commented Nov 15, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/xTMsAb

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

fun hidingKeyboard(block: () -> Unit) {
localView.hideKeyboard()
block()
}
Copy link
Member

Choose a reason for hiding this comment

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

Nice pattern!

},
onRoomDetailsClick = onRoomDetailsClick,
onBackClick = { hidingKeyboard { onBackClick() } },
onRoomDetailsClick = { hidingKeyboard { onRoomDetailsClick() } },
Copy link
Member

Choose a reason for hiding this comment

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

I was thinking about also wrapping onJoinCallClick below but since it will start another Activity, I think it's fine to keep the keyboard opened.

@jmartinesp jmartinesp force-pushed the fix/close-keyboard-when-navigating-out-of-chat-room branch from 068a2db to b75cf92 Compare November 15, 2024 15:58
Copy link

sonarcloud bot commented Nov 15, 2024

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.87%. Comparing base (1be7993) to head (b75cf92).
Report is 12 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3878   +/-   ##
========================================
  Coverage    82.87%   82.87%           
========================================
  Files         1785     1785           
  Lines        45100    45100           
  Branches      5324     5324           
========================================
  Hits         37377    37377           
  Misses        5857     5857           
  Partials      1866     1866           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Nov 15, 2024
@jmartinesp jmartinesp enabled auto-merge (squash) November 15, 2024 18:07
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Nov 15, 2024
@jmartinesp jmartinesp merged commit 8420c82 into develop Nov 15, 2024
29 checks passed
@jmartinesp jmartinesp deleted the fix/close-keyboard-when-navigating-out-of-chat-room branch November 15, 2024 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants