Repository navigation
Convert NavigationView to View - #346
Conversation
…droid into dan-nav-view
…e after rerouting
…droid into dan-nav-view
|
@tobrun @Guardiola31337 @zugaldia Working on a better way to aim the camera to always account for / be above the bottomsheet. If you have any immediate ideas, please let me know. Thank you! Issue visible in scenarios like: cc @ericrwolfe |
Could we address that as a follow up ticket/PR? That behavior was already present in the previous |
@zugaldia Yeah there was a bug with the puck being covered at the start of the UI. The |
| locationViewModel = ViewModelProviders.of(this).get(LocationViewModel.class); | ||
| routeViewModel = ViewModelProviders.of(this).get(RouteViewModel.class); | ||
| navigationViewModel = ViewModelProviders.of(this).get(NavigationViewModel.class); | ||
| if (getContext() instanceof FragmentActivity) { |
There was a problem hiding this comment.
Should we throw the ClassCastException here?
There was a problem hiding this comment.
| getLifecycle().addObserver(locationLayer); | ||
| getLifecycle().addObserver(locationViewModel); | ||
| getLifecycle().addObserver(navigationViewModel); | ||
| ((LifecycleOwner) getContext()).getLifecycle().addObserver(locationLayer); |
There was a problem hiding this comment.
Same here - we are assuming the context is a LifecycleOwner
There was a problem hiding this comment.
I think it makes sense to throw an exception because it's gonna crash anyway if this isn't a LifecycleOwner and also gives us the opportunity to provide a better error message ("make sure that the provided context is a valid LifecycleOwner").
* send an empty array when either locations before or after are empty arrays * send empty array even when locations before and after are null
…PI 19 and below (#343)
|
Combined with |
| } | ||
|
|
||
| /** | ||
| /**a |
There was a problem hiding this comment.
Looks like this a is accidental.
There was a problem hiding this comment.
Oops, good catch
| public void onSlide(@NonNull View bottomSheet, float slideOffset) { | ||
| navigationPresenter.onBottomSheetSlide(slideOffset, | ||
| sheetShadow.getVisibility() != View.VISIBLE); | ||
| sheetShadow.getVisibility() == View.VISIBLE); |
There was a problem hiding this comment.
Was this change of behavior intentional?
|
|
||
| private void addLegSteps(RouteProgress routeProgress) { | ||
| if (newLeg(routeProgress) && legHasSteps(routeProgress)) { | ||
| if ((newLeg(routeProgress) || legSteps.size() == 0) && legHasSteps(routeProgress)) { |
There was a problem hiding this comment.
intentional? were you trying to correct another issue?
There was a problem hiding this comment.
Yeah, we weren't repopulating the directions list during re-route scenarios (with the new legs) - the size will be zero because clear the list when we get an off-route
| getLifecycle().addObserver(locationLayer); | ||
| getLifecycle().addObserver(locationViewModel); | ||
| getLifecycle().addObserver(navigationViewModel); | ||
| ((LifecycleOwner) getContext()).getLifecycle().addObserver(locationLayer); |
There was a problem hiding this comment.
I think it makes sense to throw an exception because it's gonna crash anyway if this isn't a LifecycleOwner and also gives us the opportunity to provide a better error message ("make sure that the provided context is a valid LifecycleOwner").
| locationViewModel = ViewModelProviders.of(this).get(LocationViewModel.class); | ||
| routeViewModel = ViewModelProviders.of(this).get(RouteViewModel.class); | ||
| navigationViewModel = ViewModelProviders.of(this).get(NavigationViewModel.class); | ||
| if (getContext() instanceof FragmentActivity) { |
There was a problem hiding this comment.
* master: (36 commits) Add bearing for each waypoint (mapbox#408) Adjust (port / land) Top Banners and add secondary text view (mapbox#404) Release 0.6.3 (mapbox#386) Add feedback method (mapbox#392) Project clean up (mapbox#397) limit routeline GeoJSON to maxzoom 16 to avoid creating more clipping mask for high zoom levels (mapbox#391) API Voice instructions (mapbox#394) MAS 3.0 (mapbox#373) Convert NavigationView to View (mapbox#346) only raw location in metrics (mapbox#349) only reroute once users traveled past 50 meters (mapbox#347) Account for different landscape view when adjusting drawable colors API 19 and below (mapbox#343) Send empty arrays properly (mapbox#354) send feedback identifier when the event happens (mapbox#359) Add Null check on the notification manager (mapbox#332) fix hardcoded feedback id generating a new one on each navigation session (mapbox#352) fixed broken link to test app in documentation (mapbox#357) adjusted readme to 0.6.2 (mapbox#333) Release v0.6.2 (mapbox#324) reroute metric (mapbox#296) ... # Conflicts: # app/src/main/java/com/mapbox/services/android/navigation/testapp/activity/MockNavigationActivity.java # navigation/libandroid-navigation/build.gradle # navigation/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/DefaultMilestones.java # navigation/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/offroute/OffRouteDetector.java # scripts/release.py



Converting
NavigationViewto a plainViewwill allow us to inflate from either anActivityorFragment/ in set portions of the layouts being inflated.Todo:
Contextthat isn't aLifecycleOwnerNavigationLauncherto launch newActivitythat inflatesNavigationViewcc @ericrwolfe