From 1374535e632c8ff40de15adacab1e1b0435cc66c Mon Sep 17 00:00:00 2001 From: Tobrun Date: Thu, 8 Nov 2018 12:49:02 +0100 Subject: [android] - cleanup old style java constants file, migrate style transition to Style.java --- .../java/com/mapbox/mapboxsdk/constants/Style.java | 87 ----------------- .../java/com/mapbox/mapboxsdk/maps/MapView.java | 2 +- .../java/com/mapbox/mapboxsdk/maps/MapboxMap.java | 50 +--------- .../main/java/com/mapbox/mapboxsdk/maps/Style.java | 106 ++++++++++++++++++++- .../mapboxsdk/snapshotter/MapSnapshotter.java | 2 +- .../mapboxsdk/maps/MapboxMapOptionsTest.java | 2 +- .../mapboxsdk/location/LocationComponentTest.kt | 2 +- .../location/LocationLayerControllerTest.kt | 2 +- .../mapbox/mapboxsdk/style/CustomGeometryTest.kt | 2 +- .../activity/annotation/PolygonActivity.java | 2 +- .../activity/camera/ManualZoomActivity.java | 2 +- .../activity/camera/MaxMinZoomActivity.java | 2 +- .../activity/fragment/MapFragmentActivity.java | 2 +- .../fragment/SupportMapFragmentActivity.java | 2 +- .../activity/fragment/ViewPagerActivity.java | 2 +- .../activity/imagegenerator/SnapshotActivity.java | 2 +- .../activity/location/LocationModesActivity.java | 4 +- .../mapboxsdk/testapp/activity/location/Utils.java | 2 +- .../activity/maplayout/BottomSheetActivity.java | 2 +- .../activity/maplayout/DebugModeActivity.java | 2 +- .../activity/maplayout/DoubleMapActivity.java | 2 +- .../offline/MergeOfflineRegionsActivity.kt | 2 +- .../testapp/activity/offline/OfflineActivity.java | 2 +- .../activity/snapshot/MapSnapshotterActivity.java | 2 +- .../snapshot/MapSnapshotterMarkerActivity.java | 2 +- .../snapshot/MapSnapshotterReuseActivity.java | 2 +- .../activity/style/CircleLayerActivity.java | 2 +- .../activity/style/RuntimeStyleActivity.java | 4 +- .../textureview/TextureViewDebugModeActivity.java | 2 +- 29 files changed, 136 insertions(+), 163 deletions(-) delete mode 100644 platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java (limited to 'platform/android') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java deleted file mode 100644 index 9943a72e06..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.mapbox.mapboxsdk.constants; - -import android.support.annotation.StringDef; - -import com.mapbox.mapboxsdk.maps.MapView; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - *

- * Style provides URLs to several professional styles designed by Mapbox. - *

- * These styles are all ready to go in your app. To load one, pass it into {@link MapView#setStyleUrl(String)} - * - * @see MapView#setStyleUrl(String) - */ -public class Style { - - /** - * Indicates the parameter accepts one of the values from Style. Using one of these - * constants means your map style will always use the latest version and may change as we - * improve the style - */ - @StringDef( {MAPBOX_STREETS, OUTDOORS, LIGHT, DARK, SATELLITE, SATELLITE_STREETS, TRAFFIC_DAY, TRAFFIC_NIGHT}) - @Retention(RetentionPolicy.SOURCE) - public @interface StyleUrl { - } - - // IMPORTANT: If you change any of these you also need to edit them in strings.xml - - /** - * Mapbox Streets: A complete basemap, perfect for incorporating your own data. Using this - * constant means your map style will always use the latest version and may change as we - * improve the style. - */ - public static final String MAPBOX_STREETS = "mapbox://styles/mapbox/streets-v10"; - - /** - * Outdoors: A general-purpose style tailored to outdoor activities. Using this constant means - * your map style will always use the latest version and may change as we improve the style. - */ - public static final String OUTDOORS = "mapbox://styles/mapbox/outdoors-v10"; - - /** - * Light: Subtle light backdrop for data visualizations. Using this constant means your map - * style will always use the latest version and may change as we improve the style. - */ - public static final String LIGHT = "mapbox://styles/mapbox/light-v9"; - - /** - * Dark: Subtle dark backdrop for data visualizations. Using this constant means your map style - * will always use the latest version and may change as we improve the style. - */ - public static final String DARK = "mapbox://styles/mapbox/dark-v9"; - - /** - * Satellite: A beautiful global satellite and aerial imagery layer. Using this constant means - * your map style will always use the latest version and may change as we improve the style. - */ - public static final String SATELLITE = "mapbox://styles/mapbox/satellite-v9"; - - /** - * Satellite Streets: Global satellite and aerial imagery with unobtrusive labels. Using this - * constant means your map style will always use the latest version and may change as we - * improve the style. - */ - public static final String SATELLITE_STREETS = "mapbox://styles/mapbox/satellite-streets-v10"; - - /** - * Traffic Day: Color-coded roads based on live traffic congestion data. Traffic data is currently - * available in - * these select - * countries. Using this constant means your map style will always use the latest version and - * may change as we improve the style. - */ - public static final String TRAFFIC_DAY = "mapbox://styles/mapbox/traffic-day-v2"; - - /** - * Traffic Night: Color-coded roads based on live traffic congestion data, designed to maximize - * legibility in low-light situations. Traffic data is currently available in - * these select - * countries. Using this constant means your map style will always use the latest version and - * may change as we improve the style. - */ - public static final String TRAFFIC_NIGHT = "mapbox://styles/mapbox/traffic-night-v2"; -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java index fc9418c2d9..29235b899f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java @@ -28,7 +28,7 @@ import com.mapbox.mapboxsdk.annotations.Annotation; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.location.LocationComponent; import com.mapbox.mapboxsdk.maps.renderer.MapRenderer; import com.mapbox.mapboxsdk.maps.renderer.glsurfaceview.GLSurfaceViewMapRenderer; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java index 9c36343051..d9ee460ec1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java @@ -34,7 +34,7 @@ import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdate; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.geometry.LatLngBounds; import com.mapbox.mapboxsdk.location.LocationComponent; @@ -76,13 +76,13 @@ public final class MapboxMap { @Nullable private MapboxMap.OnFpsChangedListener onFpsChangedListener; - private com.mapbox.mapboxsdk.maps.Style style; + private Style style; MapboxMap(NativeMapView map, Transform transform, UiSettings ui, Projection projection, OnGesturesManagerInteractionListener listener, AnnotationManager annotations, CameraChangeDispatcher cameraChangeDispatcher, MapChangeReceiver mapChangeReceiver) { this.nativeMapView = map; - this.style = new com.mapbox.mapboxsdk.maps.Style(nativeMapView); + this.style = new Style(nativeMapView); this.uiSettings = ui; this.projection = projection; this.annotationManager = annotations.bind(this); @@ -104,7 +104,7 @@ public final class MapboxMap { setPrefetchesTiles(options); } - public com.mapbox.mapboxsdk.maps.Style getStyle(){ + public Style getStyle(){ return style; } @@ -212,48 +212,6 @@ public final class MapboxMap { // Style - /** - *

- * Get the animation duration for style changes. - *

- * The default value is zero, so any changes take effect without animation. - * - * @return Duration in milliseconds - */ - public long getTransitionDuration() { - return nativeMapView.getTransitionDuration(); - } - - /** - * Set the animation duration for style changes. - * - * @param durationMs Duration in milliseconds - */ - public void setTransitionDuration(long durationMs) { - nativeMapView.setTransitionDuration(durationMs); - } - - /** - *

- * Get the animation delay for style changes. - *

- * The default value is zero, so any changes begin to animate immediately. - * - * @return Delay in milliseconds - */ - public long getTransitionDelay() { - return nativeMapView.getTransitionDelay(); - } - - /** - * Set the animation delay for style changes. - * - * @param delayMs Delay in milliseconds - */ - public void setTransitionDelay(long delayMs) { - nativeMapView.setTransitionDelay(delayMs); - } - /** * Sets tile pre-fetching from MapboxOptions. * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java index 50192d8f8d..8a8a351db3 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java @@ -1,8 +1,12 @@ package com.mapbox.mapboxsdk.maps; +import android.support.annotation.StringDef; import com.mapbox.mapboxsdk.style.layers.Layer; +import com.mapbox.mapboxsdk.style.layers.TransitionOptions; import com.mapbox.mapboxsdk.style.sources.Source; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import java.util.HashMap; public class Style { @@ -15,7 +19,7 @@ public class Style { this.nativeMapView = nativeMapView; } - public void loadStyle(@com.mapbox.mapboxsdk.constants.Style.StyleUrl String styleUrl) { + public void loadStyle(@StyleUrl String styleUrl) { for (Source source : sources.values()) { if (source != null) { source.setDetached(); @@ -67,5 +71,105 @@ public class Style { return layer; } + // + // Transition + // + + + /** + *

+ * Set the transition duration for style changes. + *

+ * The default value for delay and duration is zero, so any changes take effect without animation. + * + * @param transitionOptions the transition options + */ + public void setTransition(TransitionOptions transitionOptions) { + nativeMapView.setTransitionDuration(transitionOptions.getDuration()); + nativeMapView.setTransitionDelay(transitionOptions.getDelay()); + } + + /** + *

+ * Get the transition for style changes. + *

+ * The default value for delay and transition is zero, so any changes take effect without animation. + * + * @return TransitionOptions the transition options + */ + public TransitionOptions getTransition() { + return new TransitionOptions(nativeMapView.getTransitionDuration(), nativeMapView.getTransitionDelay()); + } + + // + // Style constants + // + + /** + * Indicates the parameter accepts one of the values from Style. Using one of these + * constants means your map style will always use the latest version and may change as we + * improve the style + */ + @StringDef( {MAPBOX_STREETS, OUTDOORS, LIGHT, DARK, SATELLITE, SATELLITE_STREETS, TRAFFIC_DAY, TRAFFIC_NIGHT}) + @Retention(RetentionPolicy.SOURCE) + public @interface StyleUrl { + } + // IMPORTANT: If you change any of these you also need to edit them in strings.xml + + /** + * Mapbox Streets: A complete basemap, perfect for incorporating your own data. Using this + * constant means your map style will always use the latest version and may change as we + * improve the style. + */ + public static final String MAPBOX_STREETS = "mapbox://styles/mapbox/streets-v10"; + + /** + * Outdoors: A general-purpose style tailored to outdoor activities. Using this constant means + * your map style will always use the latest version and may change as we improve the style. + */ + public static final String OUTDOORS = "mapbox://styles/mapbox/outdoors-v10"; + + /** + * Light: Subtle light backdrop for data visualizations. Using this constant means your map + * style will always use the latest version and may change as we improve the style. + */ + public static final String LIGHT = "mapbox://styles/mapbox/light-v9"; + + /** + * Dark: Subtle dark backdrop for data visualizations. Using this constant means your map style + * will always use the latest version and may change as we improve the style. + */ + public static final String DARK = "mapbox://styles/mapbox/dark-v9"; + + /** + * Satellite: A beautiful global satellite and aerial imagery layer. Using this constant means + * your map style will always use the latest version and may change as we improve the style. + */ + public static final String SATELLITE = "mapbox://styles/mapbox/satellite-v9"; + + /** + * Satellite Streets: Global satellite and aerial imagery with unobtrusive labels. Using this + * constant means your map style will always use the latest version and may change as we + * improve the style. + */ + public static final String SATELLITE_STREETS = "mapbox://styles/mapbox/satellite-streets-v10"; + + /** + * Traffic Day: Color-coded roads based on live traffic congestion data. Traffic data is currently + * available in + * these select + * countries. Using this constant means your map style will always use the latest version and + * may change as we improve the style. + */ + public static final String TRAFFIC_DAY = "mapbox://styles/mapbox/traffic-day-v2"; + + /** + * Traffic Night: Color-coded roads based on live traffic congestion data, designed to maximize + * legibility in low-light situations. Traffic data is currently available in + * these select + * countries. Using this constant means your map style will always use the latest version and + * may change as we improve the style. + */ + public static final String TRAFFIC_NIGHT = "mapbox://styles/mapbox/traffic-night-v2"; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java index cd8cf6a85a..a1d84f1fd4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java @@ -25,7 +25,7 @@ import com.mapbox.mapboxsdk.attribution.AttributionLayout; import com.mapbox.mapboxsdk.attribution.AttributionMeasure; import com.mapbox.mapboxsdk.attribution.AttributionParser; import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLngBounds; import com.mapbox.mapboxsdk.log.Logger; import com.mapbox.mapboxsdk.maps.TelemetryDefinition; diff --git a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/MapboxMapOptionsTest.java b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/MapboxMapOptionsTest.java index 64edb885c3..b475eba5d9 100644 --- a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/MapboxMapOptionsTest.java +++ b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/MapboxMapOptionsTest.java @@ -5,7 +5,7 @@ import android.view.Gravity; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import org.junit.Test; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt index adb01241c4..edc0d5de4a 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt @@ -16,7 +16,7 @@ import android.support.test.runner.AndroidJUnit4 import android.support.v4.content.ContextCompat import com.mapbox.geojson.Point import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.constants.Style +import com.mapbox.mapboxsdk.maps.Style import com.mapbox.mapboxsdk.geometry.LatLng import com.mapbox.mapboxsdk.location.LocationComponentConstants.* import com.mapbox.mapboxsdk.location.modes.CameraMode diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationLayerControllerTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationLayerControllerTest.kt index 41a349b993..0554f924f2 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationLayerControllerTest.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationLayerControllerTest.kt @@ -14,7 +14,7 @@ import android.support.test.rule.GrantPermissionRule import android.support.test.rule.GrantPermissionRule.grant import android.support.test.runner.AndroidJUnit4 import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.constants.Style +import com.mapbox.mapboxsdk.maps.Style import com.mapbox.mapboxsdk.geometry.LatLng import com.mapbox.mapboxsdk.location.LocationComponentConstants.* import com.mapbox.mapboxsdk.location.modes.RenderMode diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/style/CustomGeometryTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/style/CustomGeometryTest.kt index dbbc590b9b..174173cd0d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/style/CustomGeometryTest.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/style/CustomGeometryTest.kt @@ -4,7 +4,7 @@ import android.support.test.espresso.UiController import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.constants.Style +import com.mapbox.mapboxsdk.maps.Style import com.mapbox.mapboxsdk.maps.MapboxMap import com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconImage import com.mapbox.mapboxsdk.style.layers.SymbolLayer diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java index b7a1466b42..0ca56da4f4 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java @@ -11,7 +11,7 @@ import android.widget.Toast; import com.mapbox.mapboxsdk.annotations.Polygon; import com.mapbox.mapboxsdk.annotations.PolygonOptions; import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java index 716d0463a5..375e4bb400 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java @@ -8,7 +8,7 @@ import android.view.MenuItem; import android.view.View; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.UiSettings; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/MaxMinZoomActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/MaxMinZoomActivity.java index 25f11cb4cc..eeabf38809 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/MaxMinZoomActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/MaxMinZoomActivity.java @@ -4,7 +4,7 @@ import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MapFragmentActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MapFragmentActivity.java index 64708d21c3..125f7bf539 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MapFragmentActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MapFragmentActivity.java @@ -6,7 +6,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapFragment; import com.mapbox.mapboxsdk.maps.MapView; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/SupportMapFragmentActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/SupportMapFragmentActivity.java index a5574a20d4..30e6fa0565 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/SupportMapFragmentActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/SupportMapFragmentActivity.java @@ -6,7 +6,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapFragment; import com.mapbox.mapboxsdk.maps.MapView; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/ViewPagerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/ViewPagerActivity.java index 26cf777ba9..826281554d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/ViewPagerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/ViewPagerActivity.java @@ -8,7 +8,7 @@ import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapboxMapOptions; import com.mapbox.mapboxsdk.maps.SupportMapFragment; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/SnapshotActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/SnapshotActivity.java index babb28c706..3a666d9078 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/SnapshotActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/SnapshotActivity.java @@ -10,7 +10,7 @@ import android.view.View; import android.widget.ImageView; import android.widget.Toast; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationModesActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationModesActivity.java index 25d87c32c7..009b738ff0 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationModesActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationModesActivity.java @@ -12,12 +12,9 @@ import android.view.MenuItem; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.Toast; - -import com.mapbox.android.core.location.LocationEngineRequest; import com.mapbox.android.core.permissions.PermissionsListener; import com.mapbox.android.core.permissions.PermissionsManager; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.constants.Style; import com.mapbox.mapboxsdk.location.LocationComponent; import com.mapbox.mapboxsdk.location.LocationComponentOptions; import com.mapbox.mapboxsdk.location.OnCameraTrackingChangedListener; @@ -27,6 +24,7 @@ import com.mapbox.mapboxsdk.location.modes.RenderMode; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.testapp.R; import java.util.ArrayList; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/Utils.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/Utils.java index 41c308c696..fdc2353f94 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/Utils.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/Utils.java @@ -2,7 +2,7 @@ package com.mapbox.mapboxsdk.testapp.activity.location; import android.location.Location; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLngBounds; import java.util.Random; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/BottomSheetActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/BottomSheetActivity.java index 0f5271abe5..81d56905fa 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/BottomSheetActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/BottomSheetActivity.java @@ -17,7 +17,7 @@ import android.view.ViewGroup; import android.widget.Toast; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java index f3ffedcd23..8e3bd8113b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java @@ -16,7 +16,7 @@ import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DoubleMapActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DoubleMapActivity.java index 6d56305dd2..df1f2ac384 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DoubleMapActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DoubleMapActivity.java @@ -13,7 +13,7 @@ import android.view.ViewGroup; import android.widget.Toast; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMapOptions; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/MergeOfflineRegionsActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/MergeOfflineRegionsActivity.kt index a3c29185f4..01fb8a6665 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/MergeOfflineRegionsActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/MergeOfflineRegionsActivity.kt @@ -4,7 +4,7 @@ import android.os.Bundle import android.support.v7.app.AppCompatActivity import android.widget.Toast import com.mapbox.mapboxsdk.Mapbox -import com.mapbox.mapboxsdk.constants.Style +import com.mapbox.mapboxsdk.maps.Style import com.mapbox.mapboxsdk.log.Logger import com.mapbox.mapboxsdk.offline.OfflineManager import com.mapbox.mapboxsdk.offline.OfflineRegion diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java index 79e76168d5..af72cdfd35 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java @@ -11,7 +11,7 @@ import android.widget.Toast; import com.mapbox.mapboxsdk.Mapbox; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.geometry.LatLngBounds; import com.mapbox.mapboxsdk.maps.MapView; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterActivity.java index f98cffecc9..55975440f1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterActivity.java @@ -7,7 +7,7 @@ import android.widget.GridLayout; import android.widget.ImageView; import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.geometry.LatLngBounds; import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterMarkerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterMarkerActivity.java index 3af343e946..d7ceda699e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterMarkerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterMarkerActivity.java @@ -12,7 +12,7 @@ import android.view.View; import android.view.ViewTreeObserver; import android.widget.ImageView; import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.snapshotter.MapSnapshot; import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterReuseActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterReuseActivity.java index 1191b47c11..901f364c88 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterReuseActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterReuseActivity.java @@ -6,7 +6,7 @@ import android.view.View; import android.widget.ImageView; import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.geometry.LatLngBounds; import com.mapbox.mapboxsdk.snapshotter.MapSnapshot; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CircleLayerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CircleLayerActivity.java index b070504ba3..6d2f698ffd 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CircleLayerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CircleLayerActivity.java @@ -8,7 +8,7 @@ import android.support.v4.content.res.ResourcesCompat; import android.support.v7.app.AppCompatActivity; import android.view.View; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.style.expressions.Expression; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleActivity.java index 20fa2e7d52..e3010c871b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleActivity.java @@ -93,8 +93,8 @@ public class RuntimeStyleActivity extends AppCompatActivity { // Center and Zoom (Amsterdam, zoomed to streets) mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(52.379189, 4.899431), 14)); - mapboxMap.setTransitionDuration(250); - mapboxMap.setTransitionDelay(50); + // set custom transition + mapboxMap.getStyle().setTransition(new TransitionOptions(250, 50)); }); } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewDebugModeActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewDebugModeActivity.java index 99c2fd3ae6..b47ed6cc41 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewDebugModeActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewDebugModeActivity.java @@ -17,7 +17,7 @@ import android.widget.ListView; import android.widget.TextView; import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; -- cgit v1.2.1