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

RUM-7024: Make ImageViewMapper public #2375

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jonathanmos
Copy link
Contributor

@jonathanmos jonathanmos commented Nov 5, 2024

What does this PR do?

Exposes ImageViewMapper so that it can be used by cross-platform frameworks.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • 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)

@jonathanmos jonathanmos force-pushed the jmoskovich/rum-7024/expose-imageviewmapper branch from b7d6837 to 3a9ae25 Compare November 5, 2024 08:22
@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.34%. Comparing base (b1d6ebb) to head (cba5f65).
Report is 5 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2375      +/-   ##
===========================================
+ Coverage    70.30%   70.34%   +0.04%     
===========================================
  Files          744      744              
  Lines        27721    27719       -2     
  Branches      4630     4630              
===========================================
+ Hits         19488    19497       +9     
+ Misses        6947     6931      -16     
- Partials      1286     1291       +5     
Files with missing lines Coverage Δ
.../sessionreplay/internal/DefaultRecorderProvider.kt 93.60% <ø> (-0.05%) ⬇️
...d/sessionreplay/recorder/mapper/ImageViewMapper.kt 97.14% <100.00%> (ø)

... and 32 files with indirect coverage changes

@jonathanmos jonathanmos force-pushed the jmoskovich/rum-7024/expose-imageviewmapper branch from 3a9ae25 to cba5f65 Compare November 5, 2024 11:06
@jonathanmos jonathanmos marked this pull request as ready for review November 5, 2024 11:59
@jonathanmos jonathanmos requested review from a team as code owners November 5, 2024 11:59
@jonathanmos jonathanmos changed the title RUM-7024: Make ImageViewMapper visible RUM-7024: Make ImageViewMapper public Nov 5, 2024
@@ -47,12 +48,12 @@ internal class ImageViewMapper(

val drawable = view.drawable?.current ?: return wireframes

val parentRect = imageViewUtils.resolveParentRectAbsPosition(view)
val contentRect = imageViewUtils.resolveContentRectWithScaling(view, drawable)
val parentRect = ImageViewUtils.resolveParentRectAbsPosition(view)
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the purpose of changing this line?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Warning

This here is a regression going in the wrong way: replacing a call to an interface dependency with a call to a singleton object is not something we want to do.
We can create a public constructor with a default that will automatically inject the ImageViewUtils if none is provided but we shouldn't rely directly on the object

@@ -47,12 +48,12 @@ internal class ImageViewMapper(

val drawable = view.drawable?.current ?: return wireframes

val parentRect = imageViewUtils.resolveParentRectAbsPosition(view)
val contentRect = imageViewUtils.resolveContentRectWithScaling(view, drawable)
val parentRect = ImageViewUtils.resolveParentRectAbsPosition(view)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Warning

This here is a regression going in the wrong way: replacing a call to an interface dependency with a call to a singleton object is not something we want to do.
We can create a public constructor with a default that will automatically inject the ImageViewUtils if none is provided but we shouldn't rely directly on the object

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.

4 participants