use of com.mapbox.services.android.navigation.testapp.activity.notification.CustomNavigationNotification in project mapbox-navigation-android by mapbox.
the class MockNavigationActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mock_navigation);
ButterKnife.bind(this);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(this);
// Use a custom notification
CustomNavigationNotification customNavigationNotification = new CustomNavigationNotification(this);
MapboxNavigationOptions options = MapboxNavigationOptions.builder().navigationNotification(customNavigationNotification).build();
navigation = new MapboxNavigation(this, Mapbox.getAccessToken(), options);
navigation.addMilestone(new RouteMilestone.Builder().setIdentifier(BEGIN_ROUTE_MILESTONE).setInstruction(new BeginRouteInstruction()).setTrigger(Trigger.all(Trigger.lt(TriggerProperty.STEP_INDEX, 3), Trigger.gt(TriggerProperty.STEP_DISTANCE_TOTAL_METERS, 200), Trigger.gte(TriggerProperty.STEP_DISTANCE_TRAVELED_METERS, 75))).build());
}
Aggregations