-
Notifications
You must be signed in to change notification settings - Fork 319
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
Conversation
07f069c
to
4509e0a
Compare
Will this close #1285 @devotaaabel? |
@mcwhittemore yes, I updated the comment |
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
f8d8833
to
d3d0156
Compare
d3d0156
to
57f1f07
Compare
952f250
to
81571d9
Compare
I'm closing this until |
Closes #1285
This PR adds
NavigationView
APIs that will allow initialization of offline data + aboolean
toggle for switching between online / offlineDirectionsRoute
requests.