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:
  Bumped version number to 0.7.0 in readme (mapbox#496)
  Release 0.7.0  (mapbox#497)
  Portrait / landscape layouts are different. Only cast to View (mapbox#494)
  Add missing javadoc for feedback methods in MapboxNavigation (mapbox#493)
  Update lane stylekit and then maneuver bias (mapbox#492)
  Fix bug with bottom sheet behavior null onConfigChange (mapbox#490)
  Fix issue where new route was not being detected (mapbox#478)
  Add telem absolute distance to destination track support (mapbox#427)
  Adjust Instruction Content Layout XML (mapbox#465)
  Fix bug with bottomsheet not hiding in night mode (mapbox#483)
  Cleanup / javadoc (mapbox#479)
  Initialize click listeners after presenter / viewmodel is set (mapbox#481)
  Create SpanUtil and SpanItem to more easily format Strings for our views (mapbox#477)
  Check for null or empty String speechUrl before playing (mapbox#475)
  Update location layer to 0.2.0 and re-add as lifecycle observer (mapbox#473)
  Check for null raw location before setting bearing (mapbox#476)

# Conflicts:
#	libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationMetricsWrapper.java
  • Loading branch information
Adrien Denat committed Nov 14, 2017
2 parents 9687cff + db673a3 commit 4fb1f0b
Show file tree
Hide file tree
Showing 36 changed files with 858 additions and 594 deletions.
46 changes: 44 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,55 @@

Mapbox welcomes participation and contributions from everyone.

### v0.7.0 - TBD
### v0.7.0 - November 13, 2017

* Updated to Mapbox Java 3.0 [#373](https://github.com/mapbox/mapbox-navigation-android/pull/373)
* Update InstructionView with secondary TextView [#404](https://github.com/mapbox/mapbox-navigation-android/pull/404)
* Fixed issue with bearing values in route requests [#408](https://github.com/mapbox/mapbox-navigation-android/pull/408)
* Updates and docs for NavigationRoute [#413](https://github.com/mapbox/mapbox-navigation-android/pull/413)
* Fixed native crash with initialization of navigation UI [#423](https://github.com/mapbox/mapbox-navigation-android/pull/423)
* Add validation utils class [#424](https://github.com/mapbox/mapbox-navigation-android/pull/424)
* Cancel notification when service is destroyed [#409](https://github.com/mapbox/mapbox-navigation-android/pull/409)
* Adjust API Milestone to handle new routes [#425](https://github.com/mapbox/mapbox-navigation-android/pull/425)
* Replaced maneuver arrows with custom StyleKit [#362](https://github.com/mapbox/mapbox-navigation-android/pull/362)
* Dynamic reroute tolerance [#428](https://github.com/mapbox/mapbox-navigation-android/pull/428)
* Add Telem location engine class name [#401](https://github.com/mapbox/mapbox-navigation-android/pull/401)
* Fixed snap to route object for snapped location [#434](https://github.com/mapbox/mapbox-navigation-android/pull/434)
* Directions list as dropdown [#415](https://github.com/mapbox/mapbox-navigation-android/pull/415)
* Feedback UI [#383](https://github.com/mapbox/mapbox-navigation-android/pull/383)
* Fixed bearing values not matching number of coordinates [#435](https://github.com/mapbox/mapbox-navigation-android/pull/435)
* Updated to new TurfConversion class [#440](https://github.com/mapbox/mapbox-navigation-android/pull/440)
* Removes duplicate check and adds test for new route [#443](https://github.com/mapbox/mapbox-navigation-android/pull/443)
* Show / hide recenter button when direction list is showing / hiding [#441](https://github.com/mapbox/mapbox-navigation-android/pull/441)
* Current step removed from instruction list [#444](https://github.com/mapbox/mapbox-navigation-android/pull/444)
* Change feedback timing [#442](https://github.com/mapbox/mapbox-navigation-android/pull/442)
* Updated Maneuver Icons [#445](https://github.com/mapbox/mapbox-navigation-android/pull/445)
* Fixed ordering of the bearings [#455](https://github.com/mapbox/mapbox-navigation-android/pull/455)
* "Then" Banner Instruction [#456](https://github.com/mapbox/mapbox-navigation-android/pull/456)
* NavigationQueueContainer Class to manage reroute and feedback queues [#457](https://github.com/mapbox/mapbox-navigation-android/pull/457)
* Update Turn lane Views to use StyleKit [#466](https://github.com/mapbox/mapbox-navigation-android/pull/466)
* Upgraded to Gradle 3.0 [#453](https://github.com/mapbox/mapbox-navigation-android/pull/453)
* Fixed up a few issues preventing all direction routes from working [#469](https://github.com/mapbox/mapbox-navigation-android/pull/469)
* AlertView integrated with post-reroute feedback [#470](https://github.com/mapbox/mapbox-navigation-android/pull/470)
* Fix leak when closing app with bottomsheet showing [#472](https://github.com/mapbox/mapbox-navigation-android/pull/472)
* Added issue template [#418](https://github.com/mapbox/mapbox-navigation-android/pull/418)
* Check for null raw location before setting bearing [#476](https://github.com/mapbox/mapbox-navigation-android/pull/476)
* Update location layer to 0.2.0 and re-add as lifecycle observe [#473](https://github.com/mapbox/mapbox-navigation-android/pull/473)
* Check for null or empty String speechUrl before playing [#475](https://github.com/mapbox/mapbox-navigation-android/pull/475)
* Create SpanUtil and SpanItem to more easily format Strings [#477](https://github.com/mapbox/mapbox-navigation-android/pull/477)
* Initialize click listeners after presenter / viewmodel is set [#481](https://github.com/mapbox/mapbox-navigation-android/pull/481)
* Fix bug with bottomsheet not hiding in night mode [#483](https://github.com/mapbox/mapbox-navigation-android/pull/483)
* Adjust Instruction Content Layout XML [#465](https://github.com/mapbox/mapbox-navigation-android/pull/465)
* Add telem absolute distance to destination track support [#427](https://github.com/mapbox/mapbox-navigation-android/pull/427)
* Fix issue where new route was not being detected [#478](https://github.com/mapbox/mapbox-navigation-android/pull/478)
* Fix bug with bottom sheet behavior null onConfigChange [#490](https://github.com/mapbox/mapbox-navigation-android/pull/490)
* Update lane stylekit and then maneuver bias [#492](https://github.com/mapbox/mapbox-navigation-android/pull/492)
* Add missing javadoc for feedback methods in MapboxNavigation [#493](https://github.com/mapbox/mapbox-navigation-android/pull/493)
* Portrait / landscape instruction layouts are different - only cast to View [#494](https://github.com/mapbox/mapbox-navigation-android/pull/494)

### v0.6.3 -October 18, 2017

* significant reroute metric fixes [#348](https://github.com/mapbox/mapbox-navigation-android/pull/348)
* Significant reroute metric fixes [#348](https://github.com/mapbox/mapbox-navigation-android/pull/348)
* Avoid index out of bounds when drawing route line traffic [#384](https://github.com/mapbox/mapbox-navigation-android/pull/384)

### v0.6.2 - October 7, 2017
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The snippet to add to your `build.gradle` file to use this SDK is the following:
```
// Mapbox Navigation SDK for Android
compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.6.3'
compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.7.0'
```

Expand All @@ -53,7 +53,7 @@ repositories {
}
dependencies {
compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.7.0-SNAPSHOT'
compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.7.1-SNAPSHOT'
}
```

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Project-wide Gradle settings.
VERSION_NAME=0.7.0-SNAPSHOT
VERSION_NAME=0.7.1-SNAPSHOT
GROUP=com.mapbox.mapboxsdk

POM_URL=https://github.com/mapbox/mapbox-navigation-android
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ext {
version = [
mapboxMapSdk : '5.2.0-beta.4',
mapboxServices : '2.2.8',
locationLayerPlugin: '0.1.0',
locationLayerPlugin: '0.2.0',
autoValue : '1.5',
autoValueParcel : '0.2.5',
junit : '4.12',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

/**
* Serves as a launching point for the custom drop-in UI, {@link NavigationView}.
* <p>
* Demonstrates the proper setup and usage of the view, including all lifecycle methods.
*/
public class NavigationActivity extends AppCompatActivity implements NavigationViewListener {

private NavigationView navigationView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@
/**
* View that creates the drop-in UI.
* <p>
* Once started, this view will check if launched with a {@link DirectionsRoute}.
* Or, if not found, this activity will look for a set of {@link Point} coordinates.
* Once started, this view will check if the {@link Activity} that inflated
* it was launched with a {@link DirectionsRoute}.
* <p>
* Or, if not found, this view will look for a set of {@link Point} coordinates.
* In the latter case, a new {@link DirectionsRoute} will be retrieved from {@link NavigationRoute}.
* </p><p>
* <p>
* Once valid data is obtained, this activity will immediately begin navigation
* with {@link MapboxNavigation}.
* <p>
* If launched with the simulation boolean set to true, a {@link MockLocationEngine}
* will be initialized and begin pushing updates.
* <p>
Expand All @@ -54,8 +57,7 @@
* <p>
* A Mapbox access token must also be set by the developer (to initialize navigation).
*
* @since 0.6.0
* </p>
* @since 0.7.0
*/
public class NavigationView extends CoordinatorLayout implements OnMapReadyCallback, MapboxMap.OnScrollListener,
NavigationContract.View {
Expand Down Expand Up @@ -98,12 +100,9 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
mapView.onCreate(savedInstanceState);
}

@SuppressWarnings({"MissingPermission"})
@SuppressWarnings( {"MissingPermission"})
public void onStart() {
mapView.onStart();
if (locationLayer != null) {
locationLayer.onStart();
}
}

public void onResume() {
Expand All @@ -120,9 +119,6 @@ public void onLowMemory() {

public void onStop() {
mapView.onStop();
if (locationLayer != null) {
locationLayer.onStop();
}
}

public void onDestroy() {
Expand Down Expand Up @@ -180,6 +176,7 @@ public void onStyleLoaded(String style) {
initLocationLayer();
initLifecycleObservers();
initNavigationPresenter();
initClickListeners();
subscribeViews();
navigationListener.onNavigationReady();
}
Expand All @@ -196,7 +193,7 @@ public void onStyleLoaded(String style) {
*/
@Override
public void onScroll() {
if (!summaryBehavior.isHideable()) {
if (summaryBehavior.getState() != BottomSheetBehavior.STATE_HIDDEN) {
navigationPresenter.onMapScroll();
}
}
Expand Down Expand Up @@ -253,15 +250,32 @@ public void addMarker(Point position) {
.icon(ThemeSwitcher.retrieveMapMarker(getContext())));
}

/**
* Called when the navigation session is finished.
* Can either be from a cancel event or if the user has arrived at their destination.
*/
@Override
public void finishNavigationView() {
navigationListener.onNavigationFinished();
}

/**
* Should be called when this view is completely initialized.
*
* @param activity with {@link android.content.Intent} containing route / coordinate data
*/
public void startNavigation(Activity activity) {
routeViewModel.extractLaunchData(activity);
}

/**
* Should be called after {@link NavigationView#onCreate(Bundle)}.
* <p>
* This method adds the {@link NavigationViewListener},
* which will fire ready / cancel events for this view.
*
* @param navigationViewListener to be set to this view
*/
public void getNavigationAsync(NavigationViewListener navigationViewListener) {
this.navigationListener = navigationViewListener;
mapView.getMapAsync(this);
Expand Down Expand Up @@ -298,7 +312,6 @@ private void init() {
inflate(getContext(), R.layout.navigation_view_layout, this);
bind();
initViewModels();
initClickListeners();
initSummaryBottomSheet();
}

Expand All @@ -323,44 +336,6 @@ private void initViewModels() {
}
}

/**
* Sets click listeners to all views that need them.
*/
private void initClickListeners() {
cancelBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
navigationPresenter.onCancelBtnClick();
}
});
recenterBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
navigationPresenter.onRecenterClick();
}
});
}

/**
* Initializes the {@link BottomSheetBehavior} for {@link SummaryBottomSheet}.
*/
private void initSummaryBottomSheet() {
summaryBehavior = BottomSheetBehavior.from(summaryBottomSheet);
summaryBehavior.setHideable(false);
summaryBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_HIDDEN) {
navigationPresenter.onSummaryBottomSheetHidden();
}
}

@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
}
});
}

/**
* Sets the {@link BottomSheetBehavior} based on the last state stored
* in {@link Bundle} savedInstanceState.
Expand Down Expand Up @@ -405,6 +380,7 @@ private void initLocationLayer() {
*/
private void initLifecycleObservers() {
try {
((LifecycleOwner) getContext()).getLifecycle().addObserver(locationLayer);
((LifecycleOwner) getContext()).getLifecycle().addObserver(locationViewModel);
((LifecycleOwner) getContext()).getLifecycle().addObserver(navigationViewModel);
} catch (ClassCastException exception) {
Expand All @@ -419,6 +395,44 @@ private void initNavigationPresenter() {
navigationPresenter = new NavigationPresenter(this);
}

/**
* Sets click listeners to all views that need them.
*/
private void initClickListeners() {
cancelBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
navigationPresenter.onCancelBtnClick();
}
});
recenterBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
navigationPresenter.onRecenterClick();
}
});
}

/**
* Initializes the {@link BottomSheetBehavior} for {@link SummaryBottomSheet}.
*/
private void initSummaryBottomSheet() {
summaryBehavior = BottomSheetBehavior.from(summaryBottomSheet);
summaryBehavior.setHideable(false);
summaryBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_HIDDEN && navigationPresenter != null) {
navigationPresenter.onSummaryBottomSheetHidden();
}
}

@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
}
});
}

/**
* Initiate observing of ViewModels by Views.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ public void onDestroy() {
}

/**
* Listener used to update the TODO.
* Listener used to update the location on screen
* and the data in the top / bottom views of the drop-in UI.
* <p>
* Added to {@link com.mapbox.services.android.navigation.v5.navigation.MapboxNavigation}.
*
* @param location given to the TODO to show our current location
* @param routeProgress ignored in this scenario
* @param location modified to snap to the route being driven
* @param routeProgress used to create new models for our top / bottom views
* @since 0.6.0
*/
@Override
Expand All @@ -84,11 +85,14 @@ public void onProgressChange(Location location, RouteProgress routeProgress) {
}

/**
* Listener used to update the TODO.
* Listener used to update when a user has gone off-route.
* <p>
* This is being used as a cue for a re-route UX / to fetch a new route to
* keep the user on course.
* <p>
* Added to {@link com.mapbox.services.android.navigation.v5.navigation.MapboxNavigation}.
*
* @param location given to the TODO to show our current location
* @param location given to create a new origin
* @since 0.6.0
*/
@Override
Expand Down Expand Up @@ -160,7 +164,6 @@ public void updateFeedback(FeedbackItem feedbackItem) {
* <p>
* Uses cached feedbackId to ensure the proper item is cancelled.
*
* @param feedbackItem item to be updated
* @since 0.7.0
*/
public void cancelFeedback() {
Expand All @@ -173,7 +176,6 @@ public void cancelFeedback() {
/**
* Returns the current instance of {@link MapboxNavigation}.
*
* @param feedbackItem item to be updated
* @since 0.6.1
*/
public MapboxNavigation getNavigation() {
Expand Down
Loading

0 comments on commit 4fb1f0b

Please sign in to comment.