summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorŁukasz Paczos <lukas.paczos@gmail.com>2017-06-06 21:09:20 +0200
committerTobrun <tobrun@mapbox.com>2017-06-06 21:09:20 +0200
commit45327b6ac46f8b574a767e20ee6a18ab23936db6 (patch)
tree18ea0d47c51f44eb7c71c6f3650eab59b1b06e2e /platform
parenta1f8de66794f665b69c35ed163b3e554dc5db348 (diff)
downloadqtlocation-mapboxgl-45327b6ac46f8b574a767e20ee6a18ab23936db6.tar.gz
[android] - keep location tracking mode after screen rotation (#9187)
* [android] - keep location tracking mode after screen rotation (#9186) * [android] - using easeCamera to keep location tracking instead of overloaded moveCamera (#9187) * [android] - checkstyle fix up
Diffstat (limited to 'platform')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java14
1 files changed, 11 insertions, 3 deletions
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 7a62f06ad2..8e50adb777 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
@@ -141,12 +141,20 @@ public final class MapboxMap {
*/
void onRestoreInstanceState(Bundle savedInstanceState) {
final CameraPosition cameraPosition = savedInstanceState.getParcelable(MapboxConstants.STATE_CAMERA_POSITION);
- if (cameraPosition != null) {
- moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition.Builder(cameraPosition).build()));
- }
uiSettings.onRestoreInstanceState(savedInstanceState);
trackingSettings.onRestoreInstanceState(savedInstanceState);
+
+ if (cameraPosition != null) {
+ easeCamera(CameraUpdateFactory.newCameraPosition(
+ new CameraPosition.Builder(cameraPosition).build()),
+ 0,
+ false,
+ null,
+ !trackingSettings.isLocationTrackingDisabled()
+ );
+ }
+
nativeMapView.setDebug(savedInstanceState.getBoolean(MapboxConstants.STATE_DEBUG_ACTIVE));
final String styleUrl = savedInstanceState.getString(MapboxConstants.STATE_STYLE_URL);