Repository navigation
Conversation
As the indicator moves onto the first or last stop, the side facing the track's end cap now morphs from the standard corner radius to a fully rounded end that follows the curve of the end cap. With a single stop, both sides are rounded. In the horizontal layout the indicator is inset equally from the track's ends and sides, so the rounded end is concentric with the end cap. In the vertical layout the indicator is flush with the track's sides, so on the end stops it also extends to the end of the track and fills the end cap. Also adds previews and screenshot tests for the first, middle, and last stops in both orientations and the single-stop case, sharing a ZoomBarPreview helper.
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the ZoomBar component to draw a custom zoom indicator that morphs its corners and extends to fill the end caps when moving onto the first or last stops. It introduces the drawZoomIndicator modifier and endCapFraction helper, along with corresponding unit tests and a new screenshot test suite. The review feedback suggests updating the visibility of the new screenshot preview functions to internal and adding KDoc documentation to comply with the repository's style guide.
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.
Follow-up to #625 based on design feedback.
When the zoom bar indicator moves onto the first or last stop, the side facing the end of the track now morphs from the standard corner radius to a fully rounded end that follows the curve of the track's end cap. The side facing the other stops keeps the standard corner radius. With a single stop, both sides are rounded.
The morph is driven by the existing animated indicator position, so it eases in and out as the indicator slides between stops.
Before / After
Previews and screenshot tests
ZoomBarPreviewhelper shared by all zoom bar previews and the new screenshot tests.ZoomBarScreenshotTestcovering the first, middle, and last stops in both orientations, plus the single-stop case. The reference images show the new end caps.Testing
ZoomBarComponentsTest(unit)validateStableDebugScreenshotTest:ui:components:captureand the app'sDebugOverlayTest