Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Yunitsky <yunik@mapswithme.com>2015-09-07 14:40:00 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 03:03:56 +0300
commit3faaf13ba792eafe0bfbcea8a88562631202ab86 (patch)
tree3d5b1c3cddfe72f3fea82e4c56e0cb90c23dcdaf /android
parent446bb5c8ccbebddee8ccdaf0b60f534d36911000 (diff)
[android] Display next street and routing progress.
Diffstat (limited to 'android')
-rw-r--r--android/jni/com/mapswithme/maps/Framework.cpp4
-rw-r--r--android/src/com/mapswithme/maps/routing/RoutingInfo.java4
-rw-r--r--android/src/com/mapswithme/maps/widget/RoutingLayout.java7
3 files changed, 11 insertions, 4 deletions
diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp
index bab42c41eb..7e9eb9177a 100644
--- a/android/jni/com/mapswithme/maps/Framework.cpp
+++ b/android/jni/com/mapswithme/maps/Framework.cpp
@@ -1383,7 +1383,7 @@ extern "C"
env->GetMethodID(klass, "<init>",
"(Ljava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;"
- "Ljava/lang/String;Ljava/lang/String;IIDDII"
+ "Ljava/lang/String;Ljava/lang/String;DIIDDII"
"[Lcom/mapswithme/maps/routing/SingleLaneInfo;)V");
ASSERT(ctorRouteInfoID, (jni::DescribeException()));
@@ -1425,7 +1425,7 @@ extern "C"
klass, ctorRouteInfoID, jni::ToJavaString(env, info.m_distToTarget),
jni::ToJavaString(env, info.m_targetUnitsSuffix), jni::ToJavaString(env, info.m_distToTurn),
jni::ToJavaString(env, info.m_turnUnitsSuffix), jni::ToJavaString(env, info.m_sourceName),
- jni::ToJavaString(env, info.m_targetName), info.m_turn, info.m_pedestrianTurn,
+ jni::ToJavaString(env, info.m_targetName), info.m_completionPercent ,info.m_turn, info.m_pedestrianTurn,
info.m_pedestrianDirectionPos.lat, info.m_pedestrianDirectionPos.lon, info.m_exitNum, info.m_time, jLanes);
ASSERT(result, (jni::DescribeException()));
return result;
diff --git a/android/src/com/mapswithme/maps/routing/RoutingInfo.java b/android/src/com/mapswithme/maps/routing/RoutingInfo.java
index 3cc76bcef1..dff1142745 100644
--- a/android/src/com/mapswithme/maps/routing/RoutingInfo.java
+++ b/android/src/com/mapswithme/maps/routing/RoutingInfo.java
@@ -22,6 +22,7 @@ public class RoutingInfo
public final String currentStreet;
// The next street name.
public final String nextStreet;
+ public final double completionPercent;
// For vehicle routing.
public final VehicleTurnDirection vehicleTurnDirection;
public final int exitNum;
@@ -118,7 +119,7 @@ public class RoutingInfo
SHARP_RIGHT
}
- public RoutingInfo(String distToTarget, String units, String distTurn, String turnSuffix, String currentStreet, String nextStreet,
+ public RoutingInfo(String distToTarget, String units, String distTurn, String turnSuffix, String currentStreet, String nextStreet, double completionPercent,
int vehicleTurnOrdinal, int pedestrianTurnOrdinal, double pedestrianDirectionLat, double pedestrianDirectionLon, int exitNum,
int totalTime, SingleLaneInfo[] lanes)
{
@@ -129,6 +130,7 @@ public class RoutingInfo
this.currentStreet = currentStreet;
this.nextStreet = nextStreet;
this.totalTimeInSeconds = totalTime;
+ this.completionPercent = completionPercent;
this.vehicleTurnDirection = VehicleTurnDirection.values()[vehicleTurnOrdinal];
this.lanes = lanes;
this.exitNum = exitNum;
diff --git a/android/src/com/mapswithme/maps/widget/RoutingLayout.java b/android/src/com/mapswithme/maps/widget/RoutingLayout.java
index 84a8161f38..3c2920aeee 100644
--- a/android/src/com/mapswithme/maps/widget/RoutingLayout.java
+++ b/android/src/com/mapswithme/maps/widget/RoutingLayout.java
@@ -54,8 +54,10 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
private View mLayoutTurnInstructions;
private View mBtnStart;
private FlatProgressView mFpRouteProgress;
- private double mNorth;
private RadioGroup mRgRouterType;
+ private TextView mTvNextStreen;
+
+ private double mNorth;
public enum State
{
@@ -142,6 +144,7 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
mTvTurnDistance = (android.widget.TextView) mLayoutTurnInstructions.findViewById(R.id.tv__turn_distance);
mLayoutTurnInstructions.findViewById(R.id.btn__close).setOnClickListener(this);
mFpRouteProgress = (FlatProgressView) mLayoutTurnInstructions.findViewById(R.id.fp__route_progress);
+ mTvNextStreen = (TextView) mLayoutTurnInstructions.findViewById(R.id.tv__next_street);
}
@Override
@@ -288,6 +291,8 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
mTvTotalTime.setText(formatTime(info.totalTimeInSeconds));
mTvTotalDistance.setText(info.distToTarget + " " + info.targetUnits);
+ UiUtils.setTextAndHideIfEmpty(mTvNextStreen, info.nextStreet);
+ mFpRouteProgress.setProgress((int) info.completionPercent);
}
private void refreshPedestrianAzimutAndDistance(RoutingInfo info)