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 support for Picture In Picture for Element Call #3159

Merged
merged 9 commits into from
Jul 8, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jul 8, 2024

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Add support for picture in picture mode for Element Call Activity

Motivation and context

Allow user to keep seeing a call, while navigating in the Element X application or any application installed on the phone.

Screenshots / GIFs

Tests

  • Start a call on a device > API 26
  • Press back, or home button
  • observe that the call is not stopped and is now displayed in PiP

Note that nothing is sent to the Element Call instance, and so the rendering of the Element Call application is not always optimal. sometimes it renders the other party video (which is fine), sometimes it render the local video loopback, which is not ideal.

Tested devices

  • Physical
  • Emulator API 33 and 34.
  • OS version(s):

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

@bmarty bmarty added the PR-Change For updates to an existing feature label Jul 8, 2024
@bmarty bmarty requested a review from a team as a code owner July 8, 2024 10:41
@bmarty bmarty requested review from jmartinesp and removed request for a team July 8, 2024 10:41
Copy link
Member

@jmartinesp jmartinesp 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! I just found a minor issue with the way we handle closing the PiP window, but it may be working as expected: when the window is closed I'd expect the call to be cancelled/hung up, but it actually just closes the window and the call keeps working in background.

)
}
)
if (!pipState.isInPictureInPicture) {
Copy link
Member

Choose a reason for hiding this comment

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

Technically you could also pass the web view's coordinates to the PiP code instead so it only renders that part of the activity so the webview wouldn't need a resize. It's more work, so I'm not sure it's really worth it.

@@ -45,7 +45,7 @@ class BlockedUserViewTest {
fun `clicking on back invokes back callback`() {
val eventsRecorder = EventsRecorder<BlockedUsersEvents>(expectEvents = false)
ensureCalledOnce { callback ->
rule.setLogoutView(
rule.setBlockedUsersView(
Copy link
Member

Choose a reason for hiding this comment

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

🙃

@bmarty bmarty added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Jul 8, 2024
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Jul 8, 2024
Copy link
Contributor

github-actions bot commented Jul 8, 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/YZM6xM

@bmarty
Copy link
Member Author

bmarty commented Jul 8, 2024

Test is failing on CI, but working locally:

image

Commenting out test for version 24 in 962320a

Copy link

codecov bot commented Jul 8, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 23 lines in your changes missing coverage. Please review.

Project coverage is 76.11%. Comparing base (1f69722) to head (214c9d2).
Report is 8 commits behind head on develop.

Files Patch % Lines
...droid/features/call/impl/ui/ElementCallActivity.kt 0.00% 9 Missing ⚠️
...eatures/call/impl/pip/PictureInPicturePresenter.kt 81.81% 1 Missing and 5 partials ⚠️
...droid/features/call/impl/pip/PipSupportProvider.kt 0.00% 4 Missing ⚠️
...nt/android/features/call/impl/ui/CallScreenView.kt 60.00% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3159      +/-   ##
===========================================
+ Coverage    76.03%   76.11%   +0.08%     
===========================================
  Files         1635     1640       +5     
  Lines        38608    38671      +63     
  Branches      7464     7476      +12     
===========================================
+ Hits         29354    29435      +81     
+ Misses        5366     5339      -27     
- Partials      3888     3897       +9     

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

@bmarty bmarty enabled auto-merge July 8, 2024 16:47
@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jul 8, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jul 8, 2024
Copy link

sonarqubecloud bot commented Jul 8, 2024

@bmarty bmarty merged commit b0c9091 into develop Jul 8, 2024
29 of 30 checks passed
@bmarty bmarty deleted the feature/bma/elementCallPip branch July 8, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Change For updates to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants