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

Commit

Permalink
[android] - keep location tracking mode after screen rotation (#9187)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
LukasPaczos authored and tobrun committed Jun 6, 2017
1 parent a1f8de6 commit 45327b6
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,20 @@ void onSaveInstanceState(Bundle outState) {
*/
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);
Expand Down

0 comments on commit 45327b6

Please sign in to comment.