-
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
RUM-7216: Add Slider semantics node mapper #2459
base: develop
Are you sure you want to change the base?
Conversation
@@ -148,6 +152,8 @@ internal class RootSemanticsNodeMapper( | |||
textFieldSemanticsNodeMapper |
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.
Tip
Maybe worth to use when
here?
): SemanticsWireframe { | ||
var index = 0 | ||
val trackWireframe = resolveTrackWireframe(parentContext, semanticsNode, index++) | ||
val thumbWireframe = resolveThumbWireframe(parentContext, semanticsNode, index) |
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.
Tip
Seems like could use 0 and 1 directly instead of index
val globalBounds = resolveBounds(semanticsNode) | ||
val progressBarRangeInfo = semanticsUtils.getProgressBarRangeInfo(semanticsNode) | ||
val progress = progressBarRangeInfo?.let { | ||
it.current / (it.range.endInclusive - it.range.start) |
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.
Warning
Are you sure that there is no chance for ArithmeticException
here?
val thumbHeight = DEFAULT_THUMB_RADIUS.value * 2 * parentContext.density | ||
val yOffset = (globalBounds.height - thumbHeight).toLong() / 2 | ||
println("prod thumb - height: ${globalBounds.height}, thumbHeight $thumbHeight") | ||
println("test thumb - yOffset: $yOffset") |
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.
Note
Debug leftovers?
|
||
companion object { | ||
// TODO RUM-7467: Use contrast color of parent color | ||
private const val DEFAULT_COLOR = "#000000FF" |
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.
Tip
Probably it's better to put color name into the constant?
val xOffset = fakeProgress * fakeGlobalBounds.width + fakeGlobalBounds.x | ||
val thumbHeight = DEFAULT_THUMB_RADIUS.value * 2 * fakeUiContext.density | ||
val expectedTrackWireframe = MobileSegment.Wireframe.ShapeWireframe( | ||
id = (fakeSemanticsId.toLong() shl 32) + 0, |
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.
Note
It's not clear why we need shift here?
) | ||
) | ||
val yThumbOffset = (fakeGlobalBounds.height - thumbHeight).toLong() / 2 | ||
println("test thumb - height: ${fakeGlobalBounds.height}, thumbHeight $thumbHeight") |
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.
Note
same here, do we need this prints?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2459 +/- ##
===========================================
- Coverage 70.37% 70.30% -0.07%
===========================================
Files 780 781 +1
Lines 28850 28901 +51
Branches 4835 4839 +4
===========================================
+ Hits 20301 20317 +16
- Misses 7205 7233 +28
- Partials 1344 1351 +7
|
What does this PR do?
A brief description of the change being made with this pull request.
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)