Skip to content

Commit

Permalink
Delay menu invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Sep 19, 2023
1 parent 382c0ea commit f39edb0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/de/blau/android/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2159,19 +2159,22 @@ public void onError(String message) {
if (prefs.getEgmFile() == null && getString(R.string.gps_source_internal).equals(prefs.getGpsSource())) {
tipKeys.add(R.string.tip_gpx_no_elevation_key);
tipMessageIds.add(R.string.tip_gpx_no_elevation);
}
}
if (haveTracker && haveLocationProvider(getEnabledLocationProviders(), LocationManager.GPS_PROVIDER)) {
getTracker().startTracking();
setFollowGPS(true);
}
addGpxLayer();
mapLayout.post(()->Tip.showDialog(Main.this, tipKeys, tipMessageIds));
mapLayout.post(() -> {
triggerMenuInvalidation();
Tip.showDialog(Main.this, tipKeys, tipMessageIds);
});
return true;
case R.id.menu_gps_pause:
if (haveTracker && haveLocationProvider(getEnabledLocationProviders(), LocationManager.GPS_PROVIDER)) {
getTracker().stopTracking(false);
}
triggerMenuInvalidation();
mapLayout.post(() -> triggerMenuInvalidation());
return true;
case R.id.menu_gps_clear:
if (haveTracker) {
Expand Down Expand Up @@ -2746,7 +2749,6 @@ private void addGpxLayer() {
} else {
Log.e(DEBUG_TAG, "addGpxLayer tracker not available");
}
triggerMenuInvalidation();
}

/**
Expand Down

0 comments on commit f39edb0

Please sign in to comment.