libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationEngine.java
private void checkNewRoute(DirectionsRoute directionsRoute) {
    if (RouteUtils.isNewRoute(previousRouteProgress, directionsRoute)) {
      // Decode the first steps geometry and hold onto the resulting Position objects till the users
      // on the next step. Indices are both 0 since the user just started on the new route.
      stepPoints = decodeStepPoints(directionsRoute, 0, 0);

      previousRouteProgress = RouteProgress.builder()
        .stepDistanceRemaining(directionsRoute.legs().get(0).steps().get(0).distance())
        .legDistanceRemaining(directionsRoute.legs().get(0).distance())
        .distanceRemaining(directionsRoute.distance())
        .directionsRoute(directionsRoute)
        .stepIndex(0)
        .legIndex(0)
        .build();

      indices = NavigationIndices.create(0, 0);
    }
  }
/**
   * Checks if the route provided is a new route.  If it is, all {@link RouteProgress}
   * data and {@link NavigationIndices} needs to be reset.
   *
   * @param directionsRoute to check against the current route
   */
Checks if the route provided is a new route.  If it is, all  RouteProgress
data and  NavigationIndices needs to be reset.

@param directionsRoute to check against the current route
Checks if the route provided is a new route . If it is all RouteProgress data and NavigationIndices needs to be reset . @param directionsRoute to check against the current route
private void checkNewRoute(DirectionsRoute directionsRoute) {
    if (RouteUtils.isNewRoute(previousRouteProgress, directionsRoute)) {
      stepPoints = decodeStepPoints(directionsRoute, 0, 0);
      previousRouteProgress = RouteProgress.builder()
        .stepDistanceRemaining(directionsRoute.legs().get(0).steps().get(0).distance())
        .legDistanceRemaining(directionsRoute.legs().get(0).distance())
        .distanceRemaining(directionsRoute.distance())
        .directionsRoute(directionsRoute)
        .stepIndex(0)
        .legIndex(0)
        .build();
      indices = NavigationIndices.create(0, 0);
    }
  }
private void checkNewRoute ( DirectionsRoute directionsRoute ) { if ( RouteUtils . isNewRoute ( previousRouteProgress , directionsRoute ) ) { stepPoints = decodeStepPoints ( directionsRoute , 0 , 0 ) ; previousRouteProgress = RouteProgress . builder ( ) . stepDistanceRemaining ( directionsRoute . legs ( ) . get ( 0 ) . steps ( ) . get ( 0 ) . distance ( ) ) . legDistanceRemaining ( directionsRoute . legs ( ) . get ( 0 ) . distance ( ) ) . distanceRemaining ( directionsRoute . distance ( ) ) . directionsRoute ( directionsRoute ) . stepIndex ( 0 ) . legIndex ( 0 ) . build ( ) ; indices = NavigationIndices . create ( 0 , 0 ) ; } }
Checks if the route provided is a new route.
Checks if the route provided is a new route .
// Decode the first steps geometry and hold onto the resulting Position objects till the users // on the next step. Indices are both 0 since the user just started on the new route.