Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the arrows #64

Merged
merged 1 commit into from
Dec 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 19 additions & 36 deletions app/src/main/java/nl/ags/picum/UI/MapActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,11 @@ public void setPointsInMap(List<PointWithInstructions> points) {
nodeMarker.setSnippet(InstructionConverter.getInstruction(this, node.getManeuverType(), node.getStreetName(), node.getInstructions()));
//nodeMarker.setSubDescription(Road.getLengthDurationText(this, node.mLength, node.mDuration));
nodeMarker.setTitle(getApplicationContext().getString(R.string.step) + " " + actualSteps);
Drawable icon = AppCompatResources.getDrawable(this,getDirectionIcon(node.getManeuverType()));
nodeMarker.setImage(icon);
int resource = getDirectionIcon(node.getManeuverType());
if(resource != 0) {
Drawable icon = AppCompatResources.getDrawable(this, resource);
nodeMarker.setImage(icon);
}
actualSteps++;
lastInstruction = node.getInstructions();
mMap.getOverlays().add(0, nodeMarker);
Expand All @@ -302,44 +305,24 @@ public void setPointsInMap(List<PointWithInstructions> points) {

public int getDirectionIcon(int instruction) {
switch (instruction) {
case 1:
case 11:
return R.drawable.ic_continue;
case 0:
return R.drawable.arrow_left;
case 1:
return R.drawable.arrow_right;
case 2:
default:
return R.drawable.ic_empty;
case 27:
case 28:
case 29:
case 30:
case 31:
case 32:
case 33:
case 34:
return R.drawable.ic_roundabout;
case 5:
return R.drawable.ic_sharp_left;
case 8:
return R.drawable.ic_sharp_right;
return R.drawable.arrow_left;
case 3:
case 9:
case 17:
case 20:
return R.drawable.ic_slight_left;
case 6:
case 10:
case 18:
case 21:
return R.drawable.ic_slight_right;
return R.drawable.arrow_right;
case 4:
return R.drawable.ic_turn_left;
case 7:
return R.drawable.ic_turn_right;
case 12:
case 13:
case 14:
return R.drawable.ic_u_turn;
return R.drawable.arrow_half_left;
case 5:
return R.drawable.arrow_half_right;
case 6:
return R.drawable.arrow_top;
case 9:
return R.drawable.arrow_turnaround;
default:
return 0;
}
}

Expand Down