From bb6099d41a4ef32654fe6a5d16a623386b47930e Mon Sep 17 00:00:00 2001 From: Skalii Date: Fri, 26 Feb 2021 01:38:45 +0200 Subject: [PATCH 1/2] fix legend text for night mode; fix duration time for route statistic --- .../measurementtool/graph/CustomGraphAdapter.java | 1 + .../cards/RouteStatisticCard.java | 14 ++++---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/graph/CustomGraphAdapter.java b/OsmAnd/src/net/osmand/plus/measurementtool/graph/CustomGraphAdapter.java index 32a1f6a654..fe7eff5261 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/graph/CustomGraphAdapter.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/graph/CustomGraphAdapter.java @@ -158,6 +158,7 @@ public class CustomGraphAdapter extends BaseGraphAdapter 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); From 4d4783b2ead6eda266bd5feca2223ec7805cda6f Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Sun, 28 Feb 2021 19:48:33 +0200 Subject: [PATCH 2/2] Small fix for inflater --- .../plus/measurementtool/graph/CustomGraphAdapter.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/graph/CustomGraphAdapter.java b/OsmAnd/src/net/osmand/plus/measurementtool/graph/CustomGraphAdapter.java index fe7eff5261..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(); @@ -158,7 +158,6 @@ public class CustomGraphAdapter extends BaseGraphAdapter