Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added API to set offline in NavigationView #1292

Closed
wants to merge 13 commits into from

Conversation

devotaaabel
Copy link
Contributor

@devotaaabel devotaaabel commented Sep 13, 2018

Closes #1285

This PR adds NavigationView APIs that will allow initialization of offline data + a boolean toggle for switching between online / offline DirectionsRoute requests.

@mcwhittemore
Copy link
Contributor

Will this close #1285 @devotaaabel?

@danesfeder
Copy link
Contributor

@mcwhittemore yes, I updated the comment

Copy link
Contributor

@danesfeder danesfeder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devotaaabel this is a great first pass - left some comments, let me know if you have any questions 🚀

@@ -477,6 +478,10 @@ private FixLocation buildFixLocationFrom(Point point) {
);
}

public void setOffline(String tileFilePath, String translationsDirPath) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this API being used?

@@ -35,6 +35,7 @@
import com.mapbox.services.android.navigation.v5.route.FasterRouteListener;
import com.mapbox.services.android.navigation.v5.routeprogress.ProgressChangeListener;
import com.mapbox.services.android.navigation.v5.snap.Snap;
import com.mapbox.services.android.navigation.v5.utils.ValidationUtils;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import added


if (isOffline) {
ArrayList<Point> locations = viewRouteFetcher.calculateRemainingCoordinates(event);
navigation.findOfflineRouteFor(location, locations);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we are finding the route here, but not updating the DirectionsRoute with updateRoute(DirectionsRoute route) (we do this when we get a route back with ViewRouteFetcher. So the route found will never propagate here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danesfeder thanks! I was worried I was missing something like that

@@ -65,7 +66,7 @@
final MutableLiveData<Boolean> shouldRecordScreenshot = new MutableLiveData<>();

private MapboxNavigation navigation;
private ViewRouteFetcher navigationViewRouteEngine;
private ViewRouteFetcher viewRouteFetcher;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for updating this naming 👍

@@ -415,6 +415,14 @@ public MapboxNavigation retrieveMapboxNavigation() {
return navigationViewModel.retrieveNavigation();
}

public void initializeOfflineData(String tileFilePath, String translationsDirPath) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add javadoc for these new methods here - I added some javadoc in nav-native-offline that you can take a look at after rebasing.

@danesfeder danesfeder force-pushed the nav-native-offline branch 3 times, most recently from 952f250 to 81571d9 Compare September 18, 2018 16:09
@devotaaabel devotaaabel changed the base branch from nav-native-offline to navigation-native September 18, 2018 17:00
@devotaaabel
Copy link
Contributor Author

I'm closing this until nav-native-offline is merged into navigation-native

@devotaaabel devotaaabel deleted the nav-native-offline-ui branch January 30, 2019 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants