forked from organicmaps/organicmaps
[android] Update PedestrianTurnDirection according to the C++ enum.
This commit is contained in:
parent
3d36e1f673
commit
39abaf3c65
1 changed files with 29 additions and 9 deletions
|
@ -95,17 +95,37 @@ public class RoutingInfo
|
|||
|
||||
enum PedestrianTurnDirection
|
||||
{
|
||||
NONE,
|
||||
UPSTAIRS,
|
||||
DOWNSTAIRS,
|
||||
LIFT_GATE,
|
||||
GATE,
|
||||
REACHED_YOUR_DESTINATION;
|
||||
NO_TURN(R.drawable.ic_turn_straight, 0),
|
||||
GO_STRAIGHT(R.drawable.ic_turn_straight, 0),
|
||||
|
||||
public static void setTurnDrawable(ImageView view, DistanceAndAzimut distanceAndAzimut)
|
||||
TURN_RIGHT(R.drawable.ic_turn_right, R.drawable.ic_then_right),
|
||||
TURN_LEFT(R.drawable.ic_turn_left, R.drawable.ic_then_left),
|
||||
|
||||
REACHED_YOUR_DESTINATION(R.drawable.ic_turn_finish, R.drawable.ic_then_finish);
|
||||
|
||||
private final int mTurnRes;
|
||||
private final int mNextTurnRes;
|
||||
|
||||
PedestrianTurnDirection(@DrawableRes int mainResId, @DrawableRes int nextResId)
|
||||
{
|
||||
view.setImageResource(R.drawable.ic_turn_direction);
|
||||
view.setRotation((float) Math.toDegrees(distanceAndAzimut.getAzimuth()));
|
||||
mTurnRes = mainResId;
|
||||
mNextTurnRes = nextResId;
|
||||
}
|
||||
|
||||
public void setTurnDrawable(ImageView imageView)
|
||||
{
|
||||
imageView.setImageResource(mTurnRes);
|
||||
imageView.setRotation(0.0f);
|
||||
}
|
||||
|
||||
public void setNextTurnDrawable(ImageView imageView)
|
||||
{
|
||||
imageView.setImageResource(mNextTurnRes);
|
||||
}
|
||||
|
||||
public boolean containsNextTurn()
|
||||
{
|
||||
return mNextTurnRes != 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue