Skip to content

0.34.0 Migration Guide

Pablo Guardiola edited this page Apr 2, 2019 · 1 revision

SEMVER breaks:

  • In this PR, we removed the NavigationContract#updateCameraTrackingMode(@NavigationCamera.TrackingMode int trackingMode) and, as a result was also removed from NavigationView.

Following you can find the new APIs added and how to use them 👀

New APIs:

NavigationCamera#update(NavigationCameraUpdate)
NavigationCamera#update(NavigationCameraUpdate, int durationMs)
NavigationCamera#update(NavigationCameraUpdate, int durationMs, Callback)
new NavigationCameraUpdate(CameraUpdate)
  • #setMode(CameraUpdateMode) - determines behavior with tracking
enum CameraUpdateMode
  • DEFAULT - if tracking or resetting, provided animation will be ignored
  • OVERRIDE - if tracking or retting, LocationComponent will be set to tracking NONE and animation will fire

Example usage:

NavigationCamera camera = ...;
camera.updateCameraTrackingMode(NAVIGATION_TRACKING_MODE_GPS);

CameraUpdate cameraUpdate = ...;
NavigationCameraUpdate navCameraUpdate = new NavigationCameraUpdate(cameraUpdate);
navCameraUpdate.setMode(CameraUpdateMode.DEFAULT);

camera.update(navCameraUpdate); // Ignored
camera.updateCameraTrackingMode(NAVIGATION_TRACKING_MODE_NONE);
camera.update(navCameraUpdate); // Fires animation

camera.updateCameraTrackingMode(NAVIGATION_TRACKING_MODE_GPS);
navCameraUpdate.setMode(CameraUpdateMode.OVERRIDE);
camera.update(navCameraUpdate); // Fires animation