This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
This file contains 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
39d816f
to
f26a767
Compare
af99751
to
47a5d4e
Compare
tobrun
reviewed
Aug 27, 2019
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.
Looking good, can we add @Size
annotations to the padding[] public API setters?
...orm/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java
Show resolved
Hide resolved
...ndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactoryTest.kt
Show resolved
Hide resolved
...ndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactoryTest.kt
Outdated
Show resolved
Hide resolved
...GLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/camera/CameraTest.java
Outdated
Show resolved
Hide resolved
47a5d4e
to
3e29912
Compare
When padding is not provided, the current one that's cached in the TransformState is going to be returned.
3e29912
to
60c9c92
Compare
tobrun
approved these changes
Aug 29, 2019
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.
Besides the removal of using Espresso in the animation tests this is ready to ship.
Let's do that as tail work of this PR.
This removes the cached insets on the Android side, making the core TransformState the source of truth. This still leaves an option to lazily set the padding which is going to be applied only when the next camera animation is started.
60c9c92
to
a00fc3a
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #15436.
This PR exposes
CameraPosition#padding
and a bunch of utility methods around it. This gives a choice to set the padding lazily withMapboxMap#setPadding
or immediately withMapboxMap#moveCamera(paddingTo(0, value, 0, 0))
.For example, both of the below will have the same effect:
Additionally, this PR deprecates the lazy padding setters in favor of the camera property because now, the camera object can server use cases like what's mentioned in #15412 (comment):
for example:
/cc @astojilj