RUM-4715:SwitchCompat mapper improvement#2117
Merged
ambushwork merged 1 commit intoJul 3, 2024
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/session-replay/compound-button-mappers #2117 +/- ##
==================================================================================
+ Coverage 69.33% 69.48% +0.15%
==================================================================================
Files 715 715
Lines 26620 26602 -18
Branches 4464 4471 +7
==================================================================================
+ Hits 18455 18482 +27
+ Misses 6942 6879 -63
- Partials 1223 1241 +18
|
xgouchet
approved these changes
Jul 3, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Improve the
SwitchCompatMapperto makeSwitchCompathave similar replay with the real UI.Main Changes
SwitchCompatMapperdoesn't createShapeWireframeany more for checked or unchecked state, instead, we extract the track drawable and thumb drawable to show the real graphic of the component.Motivation
What inspired you to submit this pull request?
Session replay demo
https://mobile-integration.datadoghq.com/rum/replay/sessions/128703cf-1202-45c6-a34a-8a8a2df7275d?applicationId=38030dde-f9f9-4e52-9443-b9804a030080&seed=bd9e3c7b-fbbf-4a75-89b7-a323624f0cd2&ts=1719931750249
New implementation overhead
Since the new implementation of
SwitchCompatMappercreateImageWireframeother thanShapeWireframe, some overhead is in the expectation, to measure this,Method calledmetric is used to measure the total duration of creating a wire frame of eachmapmethod, here is the resultAs we can see the new implementation takes 180us on average, and old implementation takes 120~140us on average, the overhead is nearly 50% percent.
Review checklist (to be filled by reviewers)