display number of recorded points in split analysis

This commit is contained in:
sonora 2019-05-14 02:20:45 +02:00
parent 3a06a78675
commit a5c894d73b
3 changed files with 13 additions and 0 deletions

View file

@ -71,6 +71,7 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
private long duration = 0;
private SelectedGpxFile currentTrack;
private int points;
private int trkPoints = 0;
public SavingTrackHelper(OsmandApplication ctx){
super(ctx, DATABASE_NAME, null, DATABASE_VERSION);
@ -250,6 +251,7 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
distance = 0;
points = 0;
duration = 0;
trkPoints = 0;
ctx.getSelectedGpxHelper().clearPoints(currentTrack.getModifiableGpxFile());
currentTrack.getModifiableGpxFile().tracks.clear();
currentTrack.getModifiablePointsToDisplay().clear();
@ -457,6 +459,7 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
lastTimeUpdated = time;
WptPt pt = new GPXUtilities.WptPt(lat, lon, time, alt, speed, hdop);
addTrackPoint(pt, newSegment, time);
trkPoints++;
}
private void addTrackPoint(WptPt pt, boolean newSegment, long time) {
@ -632,6 +635,7 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
distance = analysis.totalDistance;
points = analysis.wptPoints;
duration = analysis.timeSpan;
trkPoints = analysis.points;
}
private void prepareCurrentTrackForRecording() {
@ -666,6 +670,10 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
return points;
}
public int getTrkPoints() {
return trkPoints;
}
public long getLastTimeUpdated() {
return lastTimeUpdated;
}

View file

@ -446,6 +446,8 @@ public class SplitSegmentDialogFragment extends DialogFragment {
overviewTextView.setTextColor(defaultTextColor);
overviewTextView.setText(app.getString(R.string.shared_string_overview));
if (currentGpxDisplayItem != null) {
overviewTextView.setText(app.getString(R.string.shared_string_overview)
+ " (" + currentGpxDisplayItem.analysis.points + ")");
((TextView) convertView.findViewById(R.id.fragment_count_text)).setText(app.getString(R.string.shared_string_time_span) + ": " + Algorithms.formatDuration((int) (currentGpxDisplayItem.analysis.timeSpan / 1000), app.accessibilityEnabled()));
}
} else {
@ -458,6 +460,7 @@ public class SplitSegmentDialogFragment extends DialogFragment {
overviewTextView.append(OsmAndFormatter.getFormattedDistance((float) metricStart, app));
overviewTextView.append(" - ");
overviewTextView.append(OsmAndFormatter.getFormattedDistance((float) currentGpxDisplayItem.analysis.metricEnd, app));
overviewTextView.append(" (" + currentGpxDisplayItem.analysis.points + ")");
} else if (currentGpxDisplayItem.group.isSplitTime()) {
overviewImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_span_16, app.getSettings().isLightContent() ? R.color.gpx_split_overview_light : R.color.gpx_split_overview_dark));
overviewTextView.setText("");
@ -465,6 +468,7 @@ public class SplitSegmentDialogFragment extends DialogFragment {
overviewTextView.append(OsmAndFormatter.getFormattedDuration((int) metricStart, app));
overviewTextView.append(" - ");
overviewTextView.append(OsmAndFormatter.getFormattedDuration((int) currentGpxDisplayItem.analysis.metricEnd, app));
overviewTextView.append(" (" + currentGpxDisplayItem.analysis.points + ")");
}
((TextView) convertView.findViewById(R.id.fragment_count_text)).setText(app.getString(R.string.of, position, adapter.getCount() - 1));
}

View file

@ -136,6 +136,7 @@ public class GpxNotification extends OsmandNotification {
lastBuiltNoData = true;
}
}
notificationText = notificationText + " (" + app.getSavingTrackHelper().getTrkPoints() + ")";
if ((wasNoDataDismissed || !app.getSettings().SHOW_TRIP_REC_NOTIFICATION.get()) && !ongoing) {
return null;