Skip to content

Commit

Permalink
us followonstep inside routeprogress for instruction (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Mace authored Aug 30, 2017
1 parent dc67c5c commit d74617c
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ public String buildInstruction(RouteProgress routeProgress) {
.setInstruction(new Instruction() {
@Override
public String buildInstruction(RouteProgress routeProgress) {
int legIndex = routeProgress.legIndex();
int followUpStepIndex = routeProgress.currentLegProgress().stepIndex() + 2;
if (routeProgress.currentLegProgress().followOnStep() == null) {
return getInstructionString(routeProgress);
}
return String.format(Locale.US, "%s then %s",
getInstructionString(routeProgress),
convertFirstCharLowercase(routeProgress.directionsRoute().getLegs().get(legIndex)
.getSteps().get(followUpStepIndex).getManeuver().getInstruction())
);// TODO fix this
convertFirstCharLowercase(routeProgress.currentLegProgress()
.followOnStep().getManeuver().getInstruction())
);
}
})
.setTrigger(
Expand Down

0 comments on commit d74617c

Please sign in to comment.