Skip to content

Conversation

RingerJK
Copy link
Contributor

Description

  • Changed experimental extension NavigationRoute#hasUnexpectedClosures -> RouteProgress#hasUnexpectedUpcomingClosures: the algorithm checks upcoming closures only, ignoring closures where the puck is already at.

Screenshots or Gifs

…es` -> `RouteProgress#hasUnexpectedUpcomingClosures`: the algorithm is checking upcoming closures only, ignoring closures where puck already at.
@RingerJK RingerJK requested a review from LukasPaczos January 16, 2023 13:42
@RingerJK RingerJK self-assigned this Jan 16, 2023
@github-actions
Copy link

github-actions bot commented Jan 16, 2023

Changelog

Features

  • Introduced ViewStyleCustomization.infoPanelGuidelineMaxPosPercent that allows customization of the NavigationView InfoPanel bottom guideline maximum position. Increased default value to 50%. #6792

Bug fixes and improvements

  • Fixed an issue with NavigationView that caused info panel to shrink in landscape mode with a full screen theme. #6780

  • ⚠️ Updated the NavigationView default navigation puck asset. #6678

    Previous puck can be restored by injecting LocationPuck2D with the bearingImage set to com.mapbox.navigation.ui.maps.R.drawable.mapbox_navigation_puck_icon drawable:

    navigationView.customizeViewStyles {
        locationPuckOptions = LocationPuckOptions.Builder(context)
            .defaultPuck(
                LocationPuck2D(
                    bearingImage = ContextCompat.getDrawable(
                        context,
                        com.mapbox.navigation.ui.maps.R.drawable.mapbox_navigation_puck_icon,
                    )
                )
            )
            .idlePuck(regularPuck(context))
            .build()
    }
  • Fixed an issue where the first voice instruction might have been played twice. #6766

  • Added guarantees that route progress with RouteProgress#currentState == OFF_ROUTE arrives earlier than NavigationRerouteController#reroute is called. #6764

  • Improved MapboxNavigation#startReplayTripSession and ReplayRouteSession so that the previous trip session does not need to be stopped. ⚠️ ReplayRouteSession#onDetached removed the call to stopTripSession. #6817

  • Removed NavigationRoute#hasUnexpectedClosures and added RouteProgress#hasUnexpectedUpcomingClosures instead that checks whether route has upcoming unexpected closures (the algorithm does not take into account closures that the puck has already been on) #6841

  • Introduced NavigationViewListener.onSpeedInfoClicked that would be triggered when MapboxSpeedInfoView is clicked upon. #6770

  • Each newly instantiated MapboxRouteArrowView class will initialize the layers with the provided options on the first render call. Previously this would only be done if the layers hadn't already been initialized. #6466

  • Fixed a rare java.lang.NullPointerException: Attempt to read from field 'SpeechAnnouncement PlayCallback.announcement' on a null object reference crash in PlayCallback.getAnnouncement. #6760

  • Fixed standalone MapboxManeuverView appearance when the app also integrates Drop-In UI. #6774

Known issues ⚠️

Other changes

Android Auto Changelog

Features

Bug fixes and improvements

@codecov
Copy link

codecov bot commented Jan 16, 2023

Codecov Report

Merging #6841 (2ec6591) into main (d8eeb04) will increase coverage by 0.01%.
The diff coverage is 92.59%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #6841      +/-   ##
============================================
+ Coverage     72.63%   72.64%   +0.01%     
  Complexity     5568     5568              
============================================
  Files           780      780              
  Lines         30101    30117      +16     
  Branches       3556     3560       +4     
============================================
+ Hits          21864    21879      +15     
  Misses         6809     6809              
- Partials       1428     1429       +1     
Impacted Files Coverage Δ
...box/navigation/base/utils/route/RouteProgressEx.kt 87.37% <92.59%> (ø)


/**
* This function checks whether the [NavigationRoute] has unexpected closures, which could be a reason to re-route.
* This function checks whether the [NavigationRoute] has unexpected upcoming closures, which could be a reason to re-route.
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the difference between unexpected and expected closure? Is the unexpected the one we receive after route refresh?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the difference is in snapping options (see com.mapbox.api.directions.v5.models.RouteOptions).

Whenever snapping is not allowed, that means the closure is unexpected

val snappingResultList = navigationRoute.directionsRoute.getSnappingResultList()

val routeProgressData = ifNonNull(
currentLegProgress,
Copy link
Contributor

Choose a reason for hiding this comment

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

Question which is outside of the scope of this PR.
Hm, interesting why current leg progress is nullable. As I see we always create it, don't we?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose it's in the scope actually. I had the same doubts, found that RouteLegProgress and RouteStepProgress are not null, so we should be good.

@RingerJK
Copy link
Contributor Author

kudos @VysotskiVadim, he caught a nice issue: the RouteStepProgress#stepIndex cannot be compared with geometry indexes and they must be compared with RouteLegProgress#geometryIndex, as they represent geometry index in leg bound. Addressed in the PR

@RingerJK RingerJK merged commit 4ea8475 into main Jan 18, 2023
@RingerJK RingerJK deleted the kyv-NAVAND-1060-check-upcoming-route-closures branch January 18, 2023 13:30
RingerJK added a commit that referenced this pull request Jan 18, 2023
…es` -> `RouteProgress#hasUnexpectedUpcomingClosures` (#6841)

* - Changed experimental extension `NavigationRoute#hasUnexpectedClosures` -> `RouteProgress#hasUnexpectedUpcomingClosures`: the algorithm is checking upcoming closures only, ignoring closures where the puck is already at.
RingerJK added a commit that referenced this pull request Jan 18, 2023
…es` -> `RouteProgress#hasUnexpectedUpcomingClosures` (#6841) (#6846)

* - Changed experimental extension `NavigationRoute#hasUnexpectedClosures` -> `RouteProgress#hasUnexpectedUpcomingClosures`: the algorithm is checking upcoming closures only, ignoring closures where the puck is already at.
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