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 Android view capturing in Session Replay #559

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

jonathanmos
Copy link
Member

@jonathanmos jonathanmos commented Nov 27, 2023

What does this PR do?

Adds support for capturing Android views in Session Replay. Views are supported with the opacity prop or where specifying the opacity through a color with alpha (e.g. FF000000)

Support for border width and color, and for corner radius.

emulator:
Screenshot 2023-11-26 at 21 28 49
replay:
Screenshot 2023-11-28 at 12 07 48

With border and rounded corners.
emulator:
Screenshot 2023-11-29 at 12 50 55

replay:
Screenshot 2023-11-29 at 12 50 09

With parent with 10% opacity:
emulator
Screenshot 2023-11-28 at 13 12 52

replay
Screenshot 2023-11-28 at 13 12 42

Motivation

Part of the effort to add Session Replay to React Native.

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@louiszawadzki
Copy link
Contributor

Can you add screenshots of the nigthly app to see what it looks like?

Also I don't see anything around the opacity prop, if this is handled by another prop, could you mention it in a comment in the code?

@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1816/record-android-views branch 3 times, most recently from c9faa9d to 65f5785 Compare November 28, 2023 15:28
@jonathanmos jonathanmos marked this pull request as ready for review November 28, 2023 15:43
@jonathanmos jonathanmos requested a review from a team as a code owner November 28, 2023 15:43
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1816/record-android-views branch from 65f5785 to 38c508a Compare November 29, 2023 08:12
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1816/record-android-views branch 2 times, most recently from 9a76ff7 to c63ffcb Compare November 29, 2023 10:17
@jonathanmos jonathanmos requested a review from 0xnm November 29, 2023 10:20
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1816/record-android-views branch from c63ffcb to d380eb8 Compare November 29, 2023 10:27
louiszawadzki
louiszawadzki previously approved these changes Nov 29, 2023
Copy link
Contributor

@louiszawadzki louiszawadzki left a comment

Choose a reason for hiding this comment

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

Works for me, I'd like to have an extra approval from a member of the Android SDK team as well.

@jonathanmos
Copy link
Member Author

jonathanmos commented Nov 30, 2023

I refactored three files -> ColorUtils, ColorUtilsTest and ReactViewGroupMapper. The changes were quite extensive so could you please review those three again? Basically, I separated opacity and color alpha entirely as concepts and implemented a simpler method to calculate the rgba from the color int. I also removed the recursion for the opacity, because this logic is not used on the native side and the solution will either have to be on the player side, or on the native side perhaps will require an rfc

@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1816/record-android-views branch 2 times, most recently from ff6e7e9 to c12e0da Compare November 30, 2023 11:06
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1816/record-android-views branch from c12e0da to 2874bf0 Compare November 30, 2023 11:21
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1816/record-android-views branch 2 times, most recently from c81eb1e to b3ff8d9 Compare November 30, 2023 11:25
@jonathanmos jonathanmos requested a review from 0xnm November 30, 2023 14:44
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1816/record-android-views branch from 039b17e to 7bed2b7 Compare November 30, 2023 16:20
@jonathanmos jonathanmos merged commit e4b543e into develop Nov 30, 2023
4 checks passed
@jonathanmos jonathanmos deleted the jmoskovich/rum-1816/record-android-views branch November 30, 2023 17:27
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.

3 participants