diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/graph/CustomGraphAdapter.java b/OsmAnd/src/net/osmand/plus/measurementtool/graph/CustomGraphAdapter.java index 32a1f6a654..75ba2a5204 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/graph/CustomGraphAdapter.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/graph/CustomGraphAdapter.java @@ -22,10 +22,10 @@ import net.osmand.AndroidUtils; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; +import net.osmand.plus.UiUtilities; import net.osmand.plus.helpers.CustomBarChartRenderer; -import net.osmand.router.RouteStatisticsHelper; -import net.osmand.router.RouteStatisticsHelper.RouteStatistics; import net.osmand.router.RouteStatisticsHelper.RouteSegmentAttribute; +import net.osmand.router.RouteStatisticsHelper.RouteStatistics; import net.osmand.util.Algorithms; import java.util.ArrayList; @@ -140,7 +140,7 @@ public class CustomGraphAdapter extends BaseGraphAdapter list, String propertyNameToFullSpan) { OsmandApplication app = getMyApplication(); - LayoutInflater inflater = LayoutInflater.from(app); + LayoutInflater inflater = UiUtilities.getInflater(app, isNightMode()); for (RouteSegmentAttribute segment : list) { View view = inflater.inflate(R.layout.route_details_legend, legendContainer, false); int segmentColor = segment.getColor(); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/RouteStatisticCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/RouteStatisticCard.java index e25c242469..7b433bc226 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/RouteStatisticCard.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/RouteStatisticCard.java @@ -79,24 +79,18 @@ public class RouteStatisticCard extends BaseCard { ((ImageView) view.findViewById(R.id.time_icon)).setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_time_span)); int dist = routingHelper.getLeftDistance(); - int time = routingHelper.getLeftTime(); - int hours = time / (60 * 60); - int minutes = (time / 60) % 60; - TextView distanceTv = (TextView) view.findViewById(R.id.distance); String text = OsmAndFormatter.getFormattedDistance(dist, app); SpannableStringBuilder distanceStr = new SpannableStringBuilder(text); int spaceIndex = text.indexOf(" "); if (spaceIndex != -1) { distanceStr.setSpan(new ForegroundColorSpan(getMainFontColor()), 0, spaceIndex, 0); } + TextView distanceTv = (TextView) view.findViewById(R.id.distance); distanceTv.setText(distanceStr); + + int time = routingHelper.getLeftTime(); SpannableStringBuilder timeStr = new SpannableStringBuilder(); - if (hours > 0) { - timeStr.append(String.valueOf(hours)).append(" ").append(app.getString(R.string.osmand_parking_hour)).append(" "); - } - if (minutes > 0) { - timeStr.append(String.valueOf(minutes)).append(" ").append(app.getString(R.string.osmand_parking_minute)); - } + timeStr.append(OsmAndFormatter.getFormattedDuration(time, app)); spaceIndex = timeStr.toString().lastIndexOf(" "); if (spaceIndex != -1) { timeStr.setSpan(new ForegroundColorSpan(getMainFontColor()), 0, spaceIndex, 0);