Skip to content

Add feedback method - #392

Merged
cammace merged 11 commits into
masterfrom
aa-add-feedback-reroute-events
Oct 18, 2017
Merged

cammace merged 11 commits into
masterfrom
aa-add-feedback-reroute-events

Conversation

@electrostat

Copy link
Copy Markdown
Contributor
  • add feedback creation method that references existing buildFeedbackEvent from telemetry library

- add feedback creation method that references existing buildFeedbackEvent from telemetry library

static void feedbackEvent(SessionState sessionState, RouteProgress routeProgress, Location location,
String description, String feedbackType, String screenshot) {
String upcomingInstruction = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code from L129 to L156 is the same exact code implemented in rerouteEvent 👀

String upcomingInstruction = null;
String previousInstruction = null;
String upcomingModifier = null;
String previousModifier = null;
String upcomingType = null;
String upcomingName = null;
String previousType = null;
if (routeProgress.currentLegProgress().upComingStep() != null) {
upcomingName = routeProgress.currentLegProgress().upComingStep().getName();
if (routeProgress.currentLegProgress().upComingStep().getManeuver() != null) {
upcomingInstruction = routeProgress.currentLegProgress().upComingStep().getManeuver().getInstruction();
upcomingType = routeProgress.currentLegProgress().upComingStep().getManeuver().getType();
upcomingModifier = routeProgress.currentLegProgress().upComingStep().getManeuver().getModifier();
}
}
if (routeProgress.currentLegProgress().currentStep().getManeuver() != null) {
previousInstruction = routeProgress.currentLegProgress().currentStep().getManeuver().getInstruction();
previousType = routeProgress.currentLegProgress().currentStep().getManeuver().getType();
previousModifier = routeProgress.currentLegProgress().currentStep().getManeuver().getModifier();
}
Location[] beforeLocations = obtainLocations(sessionState.beforeRerouteLocations());
Location[] afterLocations = obtainLocations(sessionState.afterRerouteLocations());
String previousName = routeProgress.currentLegProgress().currentStep().getName();

What about avoiding duplicate code extracting that block into a shared method?


String previousName = routeProgress.currentLegProgress().currentStep().getName();

MapboxNavigationEvent.buildFeedbackEvent(sdkIdentifier, BuildConfig.MAPBOX_NAVIGATION_VERSION_NAME,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is currently doing nothing. We're missing pushing the event:

MapboxTelemetry.getInstance().pushEvent(...);

- fixed missing pushevent to push created feedback event to system
- added in separate method and local variables to reduce duplicate code in feedback + reroute methods
- local checkstyle missed line longer that 120 char
@danesfeder

Copy link
Copy Markdown
Contributor

@electrostat looks like the build is failing from the MAS 3.0 changes - you just need to adjust those methods in NavigationMetricsWrapper

@electrostat

Copy link
Copy Markdown
Contributor Author

@danesfeder yep, working on it right now.

electrostat and others added 6 commits October 18, 2017 14:39
- Changes need to handle MAS 3.0 updates
- added in profile, original request identifier, and request identifier, now that they are available.
- take care of small checkstyle fixes
@danesfeder danesfeder mentioned this pull request Oct 18, 2017
5 of 6 tasks
@electrostat electrostat added ⚠️ DO NOT MERGE PR should not be merged! and removed ✓ ready for review labels Oct 18, 2017
@electrostat

Copy link
Copy Markdown
Contributor Author

Need to review Feedback Event spec to compensate for changes.

@cammace

cammace commented Oct 18, 2017

Copy link
Copy Markdown

Going ahead and merging this to unblock the feedback UI work. Any fixes needed can be made in a different branch.

@cammace
cammace merged commit 583523c into master Oct 18, 2017
@cammace
cammace deleted the aa-add-feedback-reroute-events branch October 18, 2017 21:51
Grsmto pushed a commit to Grsmto/mapbox-navigation-android that referenced this pull request Oct 23, 2017
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ DO NOT MERGE PR should not be merged!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants