feat: android geometry resolvers#98
Merged
Merged
Conversation
Co-authored-by: MessiasLima <MessiasLima@users.noreply.github.com>
9 tasks
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.
Implemented the Android geometry resolvers.
Changes
Resolvers (
android/src/main/java/dev/appoutlet/some/android/resolver/)RectResolver—Rect(left, top, right, bottom)withleft < right,top < bottomRectFResolver—RectF(...)with the same ordering constraintPointResolver—Point(x, y)with randomIntcoordinatesPointFResolver—PointF(x, y)with randomFloatcoordinatesSizeResolver—Size(width, height)with positiveIntdimensionsSizeFResolver—SizeF(width, height)with positiveFloatdimensionsEach resolver:
Random(no strategy)typeOf<T>()matching incanResolveTests (
android/src/test/java/dev/appoutlet/some/android/resolver/)Added a test class per resolver covering:
canResolvereturnstruefor the matching typecanResolvereturnsfalsefor the other geometry types and primitivesleft < right,top < bottom, positive width/height)The tests run with
RobolectricTestRunnerso the geometry objects behave correctly on the JVM (the mockedandroid.jarstubs the constructors otherwise).Documentation
Updated
docs/android/index.mdto list the six new supported Android types and expanded the “When to use it” bullet.Verification
./gradlew test ./gradlew detektBoth pass across
core,android, andkotest.Closes #78
opencode session | github run