refs #6779: mobile & Mac SDK style transition options (#7711)

This commit is contained in:
Justin R. Miller
2017-01-18 12:43:08 -08:00
committed by GitHub
parent d076ba0567
commit f6715694f9
16 changed files with 205 additions and 24 deletions

View File

@@ -166,6 +166,52 @@ public final class MapboxMap {
// Style
/**
* <p>
* Get the animation duration for style changes.
* </p>
* The default value is zero, so any changes take effect without animation.
*
* @return Duration in seconds
*/
@UiThread
public long getTransitionDuration() {
return nativeMapView.getTransitionDuration();
}
/**
* Set the animation duration for style changes.
*
* @param duration Duration in seconds
*/
@UiThread
public void setTransitionDuration(long duration) {
nativeMapView.setTransitionDuration(duration);
}
/**
* <p>
* Get the animation delay for style changes.
* </p>
* The default value is zero, so any changes begin to animate immediately.
*
* @return Delay in seconds
*/
@UiThread
public long getTransitionDelay() {
return nativeMapView.getTransitionDelay();
}
/**
* Set the animation delay for style changes.
*
* @param delay Delay in seconds
*/
@UiThread
public void setTransitionDelay(long delay) {
nativeMapView.setTransitionDelay(delay);
}
@Nullable
@UiThread
public Layer getLayer(@NonNull String layerId) {

View File

@@ -767,6 +767,22 @@ final class NativeMapView {
// Runtime style Api
public long getTransitionDuration() {
return nativeGetTransitionDuration(nativeMapViewPtr);
}
public void setTransitionDuration(long duration) {
nativeSetTransitionDuration(nativeMapViewPtr, duration);
}
public long getTransitionDelay() {
return nativeGetTransitionDelay(nativeMapViewPtr);
}
public void setTransitionDelay(long delay) {
nativeSetTransitionDelay(nativeMapViewPtr, delay);
}
public Layer getLayer(String layerId) {
if (isDestroyedOn("getLayer")) {
return null;
@@ -1098,6 +1114,14 @@ final class NativeMapView {
private native double[] nativeGetCameraValues(long nativeMapViewPtr);
private native long nativeGetTransitionDuration(long nativeMapViewPtr);
private native void nativeSetTransitionDuration(long nativeMapViewPtr, long duration);
private native long nativeGetTransitionDelay(long nativeMapViewPtr);
private native void nativeSetTransitionDelay(long nativeMapViewPtr, long delay);
private native Layer nativeGetLayer(long nativeMapViewPtr, String layerId);
private native void nativeAddLayer(long nativeMapViewPtr, long layerPtr, String before);