Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…android into fix-build

* 'master' of https://github.com/mapbox/mapbox-navigation-android:
  Fixes issue with bearing values not matching the amount of coordinates passed with the new route request (mapbox#435)
  Feedback for Drop-In UI (mapbox#383)
  Directions List Dropdown (mapbox#415)
  fixed location object in snapToRoute (mapbox#434)
  add location engine class name as parameter of the different nav events builder methods (mapbox#401)
  Dynamic reroute tolerance method (mapbox#428)
  Replace maneuver arrows and lanes (mapbox#362)

# Conflicts:
#	libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationMetricsWrapper.java
  • Loading branch information
Adrien Grsmto committed Oct 30, 2017
2 parents 9338368 + 3cfa682 commit b433567
Show file tree
Hide file tree
Showing 114 changed files with 2,476 additions and 5,463 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ dex-count:
navigation-fixtures:
# Navigation: Taylor street to Page street
curl "https://api.mapbox.com/directions/v5/mapbox/driving/-122.413165,37.795042;-122.433378,37.7727?geometries=polyline6&overview=full&steps=true&access_token=$(MAPBOX_ACCESS_TOKEN)" \
-o libandroid-navigation/src/test/res/navigation.json
-o libandroid-navigation/src/test/resources/navigation.json

# Directions: polyline geometry with precision 5
curl "https://api.mapbox.com/directions/v5/mapbox/driving/-122.416667,37.783333;-121.900000,37.333333?geometries=polyline&steps=true&access_token=$(MAPBOX_ACCESS_TOKEN)" \
-o libandroid-navigation/src/test/res/directions_v5.json
-o libandroid-navigation/src/test/resources/directions_v5.json

# Intersection:
curl "https://api.mapbox.com/directions/v5/mapbox/driving/-101.70939001157072,33.62145406099651;-101.68721910152767,33.6213852194939?geometries=polyline6&steps=true&access_token=$(MAPBOX_ACCESS_TOKEN)" \
-o libandroid-navigation/src/test/resources/single_intersection.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<solid android:color="@color/md_grey_200" />
<solid android:color="#EEEEEE"/>

<corners android:radius="8dp"/>

Expand Down
5 changes: 3 additions & 2 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ ext {
]

version = [
mapboxMapSdk : '5.1.4',
mapboxServices : '2.2.6',
mapboxMapSdk : '5.2.0-beta.3',
// TODO Fix mapboxServices version when releasing next version of MAS (2.2.7)
mapboxServices : '2.3.0-SNAPSHOT',
locationLayerPlugin: '0.1.0',
autoValue : '1.4.1',
autoValueParcel : '0.2.5',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
import android.preference.PreferenceManager;

import com.mapbox.directions.v5.models.DirectionsRoute;
import com.mapbox.mapboxsdk.location.LocationSource;
import com.mapbox.services.android.navigation.v5.location.MockLocationEngine;
import com.mapbox.services.android.navigation.v5.navigation.NavigationConstants;
import com.mapbox.services.android.navigation.v5.navigation.NavigationRoute;
import com.mapbox.services.android.telemetry.location.LocationEngine;
import com.mapbox.services.android.telemetry.location.LocationEngineListener;
import com.mapbox.services.android.telemetry.location.LocationEnginePriority;
import com.mapbox.services.android.telemetry.location.LostLocationEngine;

public class LocationViewModel extends AndroidViewModel implements LifecycleObserver, LocationEngineListener {

Expand Down Expand Up @@ -91,7 +91,7 @@ void updateRoute(DirectionsRoute route) {
@SuppressWarnings( {"MissingPermission"})
private void initLocation(Application application) {
if (!shouldSimulateRoute()) {
modelLocationEngine = new LocationSource(application.getApplicationContext());
modelLocationEngine = new LostLocationEngine(application.getApplicationContext());
modelLocationEngine.setPriority(LocationEnginePriority.HIGH_ACCURACY);
modelLocationEngine.setFastestInterval(1000);
modelLocationEngine.setInterval(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ protected void onDestroy() {
navigationView.onDestroy();
}

@Override
public void onBackPressed() {
// If the navigation view didn't need to do anything, call super
if (!navigationView.onBackPressed()) {
super.onBackPressed();
}
}

@Override
protected void onSaveInstanceState(Bundle outState) {
navigationView.onSaveInstanceState(outState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ interface View {

void setSummaryBehaviorHideable(boolean isHideable);

void setSummaryOptionsVisibility(boolean isVisible);

void setSummaryDirectionsVisibility(boolean isVisible);

boolean isSummaryDirectionsVisible();

void setSheetShadowVisibility(boolean isVisible);

void setCameraTrackingEnabled(boolean isEnabled);

void resetCameraPosition();
Expand All @@ -27,8 +19,6 @@ interface View {

void hideRecenterBtn();

void showInstructionView();

void drawRoute(DirectionsRoute directionsRoute);

void addMarker(Point point);
Expand All @@ -37,20 +27,6 @@ interface View {

void setMuted(boolean isMuted);

void setCancelBtnClickable(boolean isClickable);

void animateCancelBtnAlpha(float value);

void animateExpandArrowRotation(float value);

void animateInstructionViewAlpha(float value);

int getBottomSheetHeight();

int getBottomSheetPeekHeight();

int[] getMapPadding();

void setMapPadding(int left, int top, int right, int bottom);
void showFeedbackBottomSheet();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,68 +19,25 @@ void onMuteClick(boolean isMuted) {

void onRecenterClick() {
view.setSummaryBehaviorHideable(false);
view.setSummaryBehaviorState(BottomSheetBehavior.STATE_COLLAPSED);
view.setSummaryBehaviorState(BottomSheetBehavior.STATE_EXPANDED);
view.resetCameraPosition();
view.hideRecenterBtn();
}

void onExpandArrowClick(int summaryBehaviorState) {
view.setSummaryBehaviorState(summaryBehaviorState == BottomSheetBehavior.STATE_COLLAPSED
? BottomSheetBehavior.STATE_EXPANDED : BottomSheetBehavior.STATE_COLLAPSED);
}

void onCancelBtnClick() {
view.finishNavigationView();
}

void onDirectionsOptionClick() {
view.setSheetShadowVisibility(false);
view.setSummaryOptionsVisibility(false);
view.setSummaryDirectionsVisibility(true);
}

void onMapScroll() {
view.setSummaryBehaviorHideable(true);
view.setSummaryBehaviorState(BottomSheetBehavior.STATE_HIDDEN);
view.setCameraTrackingEnabled(false);
}

void onSummaryBottomSheetExpanded() {
view.setCancelBtnClickable(false);

if (view.isSummaryDirectionsVisible()) {
view.setSheetShadowVisibility(false);
} else {
view.setMapPadding(0, 0, 0, view.getBottomSheetHeight());
}
}

void onSummaryBottomSheetCollapsed() {
view.setCancelBtnClickable(true);
view.setSummaryOptionsVisibility(true);
view.setSummaryDirectionsVisibility(false);

int bottomPadding = view.getMapPadding()[3];
if (bottomPadding != view.getBottomSheetPeekHeight()) {
view.setMapPadding(0, 0, 0, view.getBottomSheetPeekHeight());
}
}

void onSummaryBottomSheetHidden() {
view.showRecenterBtn();
}

void onBottomSheetSlide(float slideOffset, boolean sheetShadowVisible) {
if (slideOffset < 1f && !sheetShadowVisible) {
view.setSheetShadowVisibility(true);
}
if (view.isSummaryDirectionsVisible()) {
view.animateInstructionViewAlpha(1 - slideOffset);
}
view.animateCancelBtnAlpha(1 - slideOffset);
view.animateExpandArrowRotation(180 * slideOffset);
}

void onRouteUpdate(DirectionsRoute directionsRoute) {
view.drawRoute(directionsRoute);
}
Expand All @@ -89,7 +46,7 @@ void onDestinationUpdate(Point point) {
view.addMarker(point);
}

void onNavigationRunning() {
view.showInstructionView();
void onFeedbackClick() {
view.showFeedbackBottomSheet();
}
}
Loading

0 comments on commit b433567

Please sign in to comment.