[android] #2805 - Updating Tilt API to support animation duration time

This commit is contained in:
Brad Leege
2015-12-03 14:07:01 -06:00
parent 805aae2439
commit 02feddb816
4 changed files with 17 additions and 11 deletions

View File

@@ -1123,12 +1123,17 @@ public final class MapView extends FrameLayout {
}
/**
* Sets the Tilt in degrees of the MapView
* Sets the Tilt in degrees of the MapView.
* @param pitch New tilt in degrees
* @param duration Animation time in milliseconds. If null then 0 is used, making the animation immediate.
*/
@FloatRange(from = 0.0, to = 60.0)
public void setTilt(double pitch) {
mNativeMapView.setPitch(pitch);
public void setTilt(Double pitch, @Nullable Long duration) {
long actualDuration = 0;
if (duration != null) {
actualDuration = duration;
}
mNativeMapView.setPitch(pitch, actualDuration);
}
//
@@ -1148,7 +1153,7 @@ public final class MapView extends FrameLayout {
setBearing(update.getBearing());
setTilt(update.getTilt());
setTilt((double)update.getTilt(), null);
}
//

View File

@@ -260,8 +260,8 @@ final class NativeMapView {
return nativeGetPitch(mNativeMapViewPtr);
}
public void setPitch(double pitch) {
nativeSetPitch(mNativeMapViewPtr, pitch);
public void setPitch(double pitch, long duration) {
nativeSetPitch(mNativeMapViewPtr, pitch, duration);
}
public void scaleBy(double ds) {
@@ -543,7 +543,7 @@ final class NativeMapView {
private native double nativeGetPitch(long nativeMapViewPtr);
private native void nativeSetPitch(long nativeMapViewPtr, double pitch);
private native void nativeSetPitch(long nativeMapViewPtr, double pitch, long duration);
private native void nativeScaleBy(long nativeMapViewPtr, double ds,
double cx, double cy, long duration);