fix after merge

This commit is contained in:
Skalii 2021-03-27 12:29:38 +02:00
commit b114d4956e
2 changed files with 14 additions and 6 deletions

View file

@ -369,8 +369,10 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
settings.MAP_OVERLAY_PREVIOUS.set(null); settings.MAP_OVERLAY_PREVIOUS.set(null);
} }
if (underlayLayer.getMap() == null) { if (underlayLayer.getMap() == null) {
settings.MAP_UNDERLAY.removeListener(underlayListener);
settings.MAP_UNDERLAY.set(null); settings.MAP_UNDERLAY.set(null);
settings.MAP_UNDERLAY_PREVIOUS.set(null); settings.MAP_UNDERLAY_PREVIOUS.set(null);
settings.MAP_UNDERLAY.addListener(underlayListener);
} }
String overlayMapDescr = settings.MAP_OVERLAY.get(); String overlayMapDescr = settings.MAP_OVERLAY.get();
if (overlayMapDescr!=null && overlayMapDescr.contains(".sqlitedb")) { if (overlayMapDescr!=null && overlayMapDescr.contains(".sqlitedb")) {

View file

@ -45,6 +45,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import static net.osmand.plus.liveupdates.LiveUpdatesFragmentNew.getDefaultIconColorId; import static net.osmand.plus.liveupdates.LiveUpdatesFragmentNew.getDefaultIconColorId;
import static net.osmand.plus.myplaces.GPXTabItemType.GPX_TAB_ITEM_SPEED;
public class GpxBlockStatisticsBuilder { public class GpxBlockStatisticsBuilder {
@ -155,15 +156,20 @@ public class GpxBlockStatisticsBuilder {
float totalDistance = withoutGaps ? analysis.totalDistanceWithoutGaps : analysis.totalDistance; float totalDistance = withoutGaps ? analysis.totalDistanceWithoutGaps : analysis.totalDistance;
String asc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationUp, app); String asc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationUp, app);
String desc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationDown, app); String desc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationDown, app);
String minElevation = OsmAndFormatter.getFormattedAlt(analysis.minElevation, app);
String maxElevation = OsmAndFormatter.getFormattedAlt(analysis.maxElevation, app);
String avg = OsmAndFormatter.getFormattedSpeed(analysis.avgSpeed, app); String avg = OsmAndFormatter.getFormattedSpeed(analysis.avgSpeed, app);
String max = OsmAndFormatter.getFormattedSpeed(analysis.maxSpeed, app); String maxSpeed = OsmAndFormatter.getFormattedSpeed(analysis.maxSpeed, app);
float timeSpan = withoutGaps ? analysis.timeSpanWithoutGaps : analysis.timeSpan; float timeSpan = withoutGaps ? analysis.timeSpanWithoutGaps : analysis.timeSpan;
long timeMoving = withoutGaps ? analysis.timeMovingWithoutGaps : analysis.timeMoving;
prepareDataDistance(totalDistance); prepareDataDistance(totalDistance);
prepareDataAscent(asc); prepareDataAscent(asc);
prepareDataDescent(desc); prepareDataDescent(desc);
prepareDataAltitudeRange(minElevation, maxElevation);
prepareDataAverageSpeed(avg); prepareDataAverageSpeed(avg);
prepareDataMaximumSpeed(max); prepareDataMaximumSpeed(maxSpeed);
prepareDataTimeSpan(timeSpan); prepareDataTimeSpan(timeSpan);
prepareDataTimeMoving(timeMoving);
} else { } else {
switch (tabItem) { switch (tabItem) {
case GPX_TAB_ITEM_GENERAL: { case GPX_TAB_ITEM_GENERAL: {
@ -215,8 +221,7 @@ public class GpxBlockStatisticsBuilder {
} }
public void prepareDataAltitudeRange(String min, String max) { public void prepareDataAltitudeRange(String min, String max) {
String pattern = app.getString(R.string.ltr_or_rtl_combine_via_dash); prepareData(app.getString(R.string.altitude_range), min + " - " + max,
prepareData(app.getString(R.string.altitude_range), String.format(pattern, min, max),
R.drawable.ic_action_altitude_range_16, GPXDataSetType.ALTITUDE, null, ItemType.ITEM_ALTITUDE); R.drawable.ic_action_altitude_range_16, GPXDataSetType.ALTITUDE, null, ItemType.ITEM_ALTITUDE);
} }
@ -243,9 +248,10 @@ public class GpxBlockStatisticsBuilder {
} }
public void prepareDataTimeMoving(long timeMoving) { public void prepareDataTimeMoving(long timeMoving) {
prepareData(app.getString(R.string.shared_string_time_moving), prepareData(app.getString(tabItem == GPX_TAB_ITEM_SPEED ? R.string.shared_string_time_moving : R.string.moving_time),
Algorithms.formatDuration((int) (timeMoving / 1000), app.accessibilityEnabled()), Algorithms.formatDuration((int) (timeMoving / 1000), app.accessibilityEnabled()),
R.drawable.ic_action_time_span_16, GPXDataSetType.SPEED, null, ItemType.ITEM_TIME_MOVING); tabItem == GPX_TAB_ITEM_SPEED ? R.drawable.ic_action_time_span_16 : R.drawable.ic_action_time_moving_16,
GPXDataSetType.SPEED, null, ItemType.ITEM_TIME_MOVING);
} }
public void prepareDataDistanceCorrected(float totalDistanceMoving) { public void prepareDataDistanceCorrected(float totalDistanceMoving) {