Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class MapWayname {
private MapPaddingAdjustor paddingAdjustor;
private List<Point> currentStepPoints = new ArrayList<>();
private Location currentLocation = null;
private MapboxNavigation navigation;
private final MapWaynameProgressChangeListener progressChangeListener = new MapWaynameProgressChangeListener(this);
private boolean isAutoQueryEnabled;
private boolean isVisible;
Expand Down Expand Up @@ -95,13 +96,23 @@ String retrieveWayname() {
}

void addProgressChangeListener(MapboxNavigation navigation) {
this.navigation = navigation;
navigation.addProgressChangeListener(progressChangeListener);
}

void onStart() {
if (navigation != null) {
navigation.addProgressChangeListener(progressChangeListener);
}
}

void onStop() {
if (isTaskRunning()) {
filterTask.cancel(true);
}
if (navigation != null) {
navigation.removeProgressChangeListener(progressChangeListener);
}
}

private List<Feature> findRoadLabelFeatures(PointF point) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ public void onStart() {
locationLayer.onStart();
mapCamera.onStart();
mapRoute.onStart();
mapWayname.onStart();
}

/**
Expand Down