public float fractionTraveled() {
    float fractionTraveled = 1;

    if (routeLeg().distance() > 0) {
      fractionTraveled = (float) (distanceTraveled() / routeLeg().distance());
      if (fractionTraveled < 0) {
        fractionTraveled = 0;
      }
    }
    return fractionTraveled;
  }
public float fractionTraveled ( ) { float fractionTraveled = 1 ; if ( routeLeg ( ) . distance ( ) > 0 ) { fractionTraveled = ( float ) ( distanceTraveled ( ) / routeLeg ( ) . distance ( ) ) ; if ( fractionTraveled < 0 ) { fractionTraveled = 0 ; } } return fractionTraveled ; }
Get the fraction traveled along the current leg, this is a float value between 0 and 1 and
isn't guaranteed to reach 1 before the user reaches the next waypoint.

@return a float value between 0 and 1 representing the fraction the user has traveled along the
current leg
@since 0.1.0