Search in sources :

Example 1 with DistanceUtils

use of com.mapbox.services.android.navigation.v5.utils.DistanceUtils in project mapbox-navigation-android by mapbox.

the class InstructionStepResources method formatStepDistance.

private void formatStepDistance(Context context, RouteProgress progress, Locale locale, @NavigationUnitType.UnitType int unitType) {
    if (distanceUtils == null || !this.locale.equals(locale) || this.unitType != unitType) {
        distanceUtils = new DistanceUtils(context, locale, unitType);
        this.locale = locale;
        this.unitType = unitType;
    }
    stepDistanceRemaining = distanceUtils.formatDistance(progress.currentLegProgress().currentStepProgress().distanceRemaining());
}
Also used : DistanceUtils(com.mapbox.services.android.navigation.v5.utils.DistanceUtils)

Example 2 with DistanceUtils

use of com.mapbox.services.android.navigation.v5.utils.DistanceUtils in project mapbox-navigation-android by mapbox.

the class InstructionListAdapter method updateSteps.

public void updateSteps(Context context, RouteProgress routeProgress, Locale locale, @NavigationUnitType.UnitType int unitType) {
    if (distanceUtils == null || !this.locale.equals(locale) || this.unitType != unitType) {
        distanceUtils = new DistanceUtils(context, locale, unitType);
        this.locale = locale;
        this.unitType = unitType;
    }
    addLegSteps(routeProgress);
    updateStepList(routeProgress);
}
Also used : DistanceUtils(com.mapbox.services.android.navigation.v5.utils.DistanceUtils)

Aggregations

DistanceUtils (com.mapbox.services.android.navigation.v5.utils.DistanceUtils)2