-
Notifications
You must be signed in to change notification settings - Fork 61
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
RUMM-2806 Drop the covered wireframes only if top ones have a background #1198
RUMM-2806 Drop the covered wireframes only if top ones have a background #1198
Conversation
a97e155
to
cc0004b
Compare
@@ -72,6 +72,13 @@ internal class WireframeUtils { | |||
} | |||
} | |||
|
|||
private fun MobileSegment.Wireframe.hasBackground(): Boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the background is transparent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I am going to filter those out also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 or semi-transparent. On iOS we recently added isTranslucent
for similar use case, which also takes view's alpha
(opacity) into account. It doesn't yet check the background color's alpha, but remains extensible in that direction (e.g. a background of #FF000099
should be considered translucent).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup I modified it in order to just consider alpha FF
in the color and 1f
in the ShapeStyle
opacity. Any other wireframe with any alpha value will be not considered as overlay.
Codecov Report
@@ Coverage Diff @@
## feature/sdkv2 #1198 +/- ##
=================================================
- Coverage 83.38% 83.36% -0.02%
=================================================
Files 356 356
Lines 11987 11985 -2
Branches 2061 2061
=================================================
- Hits 9995 9991 -4
- Misses 1357 1358 +1
- Partials 635 636 +1
|
0dc18c5
to
ae7a05f
Compare
a7148b4
to
63123ae
Compare
@@ -51,7 +51,7 @@ internal class WireframeUtils { | |||
return false | |||
} | |||
topWireframes.forEach { | |||
if (it.bounds().isCovering(wireframeBounds)) { | |||
if (it.bounds().isCovering(wireframeBounds) && it.isNotTranslucent()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking here, maybe using isOpaque
would avoid having to handle the negation when thinking at the logic
63123ae
to
b3f7083
Compare
What does this PR do?
Before we were filtering out all the overlayed wireframes no matter if the top ones were having a solid background or not. This creates a problem because if the removed wireframe is actual the one that gives the main background in a View we will be loosing the contrast in the replay and will make some elements invisible (e.g. texts).
In order to fix this we are now only considering as valid overlays the wireframes that also have a solid backround.
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)