Remove unnecessary changes
This commit is contained in:
parent
86bee14939
commit
06b6ca80b0
1 changed files with 16 additions and 0 deletions
|
@ -27,6 +27,9 @@ public class GpxNotification extends OsmandNotification {
|
|||
public final static String OSMAND_STOP_GPX_SERVICE_ACTION = "OSMAND_STOP_GPX_SERVICE_ACTION";
|
||||
public final static String GROUP_NAME = "GPX";
|
||||
|
||||
private boolean wasNoDataDismissed;
|
||||
private boolean lastBuiltNoData;
|
||||
|
||||
public GpxNotification(OsmandApplication app) {
|
||||
super(app, GROUP_NAME);
|
||||
}
|
||||
|
@ -105,6 +108,13 @@ public class GpxNotification extends OsmandNotification {
|
|||
return app.getSettings().MAP_ACTIVITY_ENABLED.get() && !app.getSettings().SHOW_TRIP_REC_NOTIFICATION.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotificationDismissed() {
|
||||
if (!wasNoDataDismissed) {
|
||||
wasNoDataDismissed = lastBuiltNoData;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Builder buildNotification(boolean wearable) {
|
||||
if (!isEnabled()) {
|
||||
|
@ -117,6 +127,7 @@ public class GpxNotification extends OsmandNotification {
|
|||
boolean isGpxRecording = app.getSavingTrackHelper().getIsRecording();
|
||||
float recordedDistance = app.getSavingTrackHelper().getDistance();
|
||||
ongoing = true;
|
||||
lastBuiltNoData = false;
|
||||
if (isGpxRecording) {
|
||||
color = app.getResources().getColor(R.color.osmand_orange);
|
||||
notificationTitle = app.getString(R.string.shared_string_trip) + " • "
|
||||
|
@ -133,10 +144,15 @@ public class GpxNotification extends OsmandNotification {
|
|||
ongoing = false;
|
||||
notificationTitle = app.getString(R.string.shared_string_trip_recording);
|
||||
notificationText = app.getString(R.string.gpx_logging_no_data);
|
||||
lastBuiltNoData = true;
|
||||
}
|
||||
}
|
||||
notificationText = notificationText + " (" + Integer.toString(app.getSavingTrackHelper().getTrkPoints()) + ")";
|
||||
|
||||
if ((wasNoDataDismissed || !app.getSettings().SHOW_TRIP_REC_NOTIFICATION.get()) && !ongoing) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final Builder notificationBuilder = createBuilder(wearable)
|
||||
.setContentTitle(notificationTitle)
|
||||
.setStyle(new BigTextStyle().bigText(notificationText));
|
||||
|
|
Loading…
Reference in a new issue