Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Update example and docs for the paddingWhileTracking animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Łukasz Paczos committed Jul 30, 2020
1 parent 937ff71 commit edaf4b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.mapbox.android.gestures.AndroidGesturesManager;
import com.mapbox.mapboxsdk.R;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.style.layers.Layer;

import java.util.Arrays;
Expand Down Expand Up @@ -1729,8 +1730,12 @@ public LocationComponentOptions.Builder staleStateTimeout(long timeout) {
* </p>
*
* @param padding The margins for the map in pixels (left, top, right, bottom).
* @deprecated Use {@link CameraPosition.Builder#padding(double, double, double, double)}
* or {@link CameraUpdateFactory#paddingTo(double, double, double, double)} instead.
* @deprecated Use
* {@link com.mapbox.mapboxsdk.camera.CameraPosition.Builder#padding(double, double, double, double)}
* or {@link com.mapbox.mapboxsdk.camera.CameraUpdateFactory#paddingTo(double, double, double, double)}
* when not tracking and
* {@link LocationComponent#paddingWhileTracking(double[], long, MapboxMap.CancelableCallback)}
* when {@link com.mapbox.mapboxsdk.location.modes.CameraMode} tracking is engaged to manipulate the padding.
*/
@NonNull
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ public void onFinish() {
} else if (id == R.id.action_component_padding_animation_while_tracking) {
Random paddingRandom = new Random();
locationComponent.paddingWhileTracking(new double[] {
paddingRandom.nextDouble() * 500,
paddingRandom.nextDouble() * 500,
paddingRandom.nextDouble() * 500,
paddingRandom.nextDouble() * 500
paddingRandom.nextDouble() * 500 * (paddingRandom.nextBoolean() ? -1: 1),
paddingRandom.nextDouble() * 500 * (paddingRandom.nextBoolean() ? -1: 1),
paddingRandom.nextDouble() * 500 * (paddingRandom.nextBoolean() ? -1: 1),
paddingRandom.nextDouble() * 500 * (paddingRandom.nextBoolean() ? -1: 1)
}, 1000L, new MapboxMap.CancelableCallback() {
@Override
public void onCancel() {
Expand Down

0 comments on commit edaf4b8

Please sign in to comment.