diff options
-rw-r--r-- | android/src/com/mapswithme/maps/routing/RoutingController.java | 2 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/routing/RoutingPlanController.java | 20 |
2 files changed, 17 insertions, 5 deletions
diff --git a/android/src/com/mapswithme/maps/routing/RoutingController.java b/android/src/com/mapswithme/maps/routing/RoutingController.java index 27d1682885..4dc809cfd4 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingController.java @@ -92,6 +92,7 @@ public class RoutingController private boolean mContainsCachedResult; private int mLastResultCode; private String[] mLastMissingMaps; + @Nullable private RoutingInfo mCachedRoutingInfo; @SuppressWarnings("FieldCanBeLocal") @@ -525,6 +526,7 @@ public class RoutingController return mEndPoint; } + @Nullable RoutingInfo getCachedRoutingInfo() { return mCachedRoutingInfo; diff --git a/android/src/com/mapswithme/maps/routing/RoutingPlanController.java b/android/src/com/mapswithme/maps/routing/RoutingPlanController.java index 4d136618e1..46b354457a 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingPlanController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingPlanController.java @@ -178,11 +178,24 @@ public class RoutingPlanController extends ToolbarController private void showAltitudeChartAndRoutingDetails() { + UiUtils.show(mAltitudeChartFrame); + mAltitudeChartShown = true; + showRoutingDetails(); + } + + private void showRoutingDetails() + { final View numbersFrame = mAltitudeChartFrame.findViewById(R.id.numbers); + final RoutingInfo rinfo = RoutingController.get().getCachedRoutingInfo(); + if (rinfo == null) + { + UiUtils.hide(numbersFrame); + return; + } + TextView numbersTime = (TextView) numbersFrame.findViewById(R.id.time); TextView numbersDistance = (TextView) numbersFrame.findViewById(R.id.distance); TextView numbersArrival = (TextView) numbersFrame.findViewById(R.id.arrival); - RoutingInfo rinfo = RoutingController.get().getCachedRoutingInfo(); numbersTime.setText(RoutingController.formatRoutingTime(mFrame.getContext(), rinfo.totalTimeInSeconds, R.dimen.text_size_routing_number)); numbersDistance.setText(rinfo.distToTarget + " " + rinfo.targetUnits); @@ -192,11 +205,8 @@ public class RoutingPlanController extends ToolbarController String arrivalTime = RoutingController.formatArrivalTime(rinfo.totalTimeInSeconds); numbersArrival.setText(arrivalTime); } - - UiUtils.show(mAltitudeChartFrame); - mAltitudeChartShown = true; } - + private void hideAltitudeChartAndRoutingDetails() { if (UiUtils.isHidden(mAltitudeChartFrame)) |