From ea3739c95f075d3ada43f12dcce7a57c2c4b2df2 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Wed, 11 Oct 2017 20:56:32 +0300 Subject: [PATCH 1/2] Fix #4571 --- .../other/DestinationReachedMenuFragment.java | 17 +++++++++++------ .../net/osmand/plus/routing/RoutingHelper.java | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/DestinationReachedMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/DestinationReachedMenuFragment.java index e92b72f047..401f6d6e3a 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/DestinationReachedMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/DestinationReachedMenuFragment.java @@ -16,6 +16,7 @@ import net.osmand.AndroidUtils; import net.osmand.data.LatLon; import net.osmand.plus.ApplicationMode; import net.osmand.plus.IconsCache; +import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.TargetPointsHelper; import net.osmand.plus.TargetPointsHelper.TargetPoint; @@ -50,7 +51,7 @@ public class DestinationReachedMenuFragment extends Fragment { view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - dismissMenu(); + dismissMenu(true); } }); @@ -61,7 +62,7 @@ public class DestinationReachedMenuFragment extends Fragment { closeImageButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - dismissMenu(); + dismissMenu(true); } }); @@ -81,7 +82,7 @@ public class DestinationReachedMenuFragment extends Fragment { getMapActivity().getContextMenu().close(); } } - dismissMenu(); + dismissMenu(true); } }); @@ -95,7 +96,7 @@ public class DestinationReachedMenuFragment extends Fragment { TargetPointsHelper helper = getMapActivity().getMyApplication().getTargetPointsHelper(); TargetPoint target = helper.getPointToNavigate(); - dismissMenu(); + dismissMenu(false); if (target != null) { helper.navigateToPoint(new LatLon(target.getLatitude(), target.getLongitude()), @@ -129,7 +130,7 @@ public class DestinationReachedMenuFragment extends Fragment { newIntent.putExtra(SearchActivity.SEARCH_NEARBY, true); startActivityForResult(newIntent, 0); } - dismissMenu(); + dismissMenu(false); } }); @@ -181,7 +182,11 @@ public class DestinationReachedMenuFragment extends Fragment { .addToBackStack(TAG).commitAllowingStateLoss(); } - public void dismissMenu() { + public void dismissMenu(boolean restoreAppMode) { + if (restoreAppMode) { + OsmandSettings settings = getMapActivity().getMyApplication().getSettings(); + settings.APPLICATION_MODE.set(settings.DEFAULT_APPLICATION_MODE.get()); + } getMapActivity().getMapActions().stopNavigationWithoutConfirm(); getMapActivity().getSupportFragmentManager().popBackStack(); } diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index cad742e399..0b7f5e4265 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -549,7 +549,7 @@ public class RoutingHelper { @Override public void run() { settings.LAST_ROUTING_APPLICATION_MODE = settings.APPLICATION_MODE.get(); - settings.APPLICATION_MODE.set(settings.DEFAULT_APPLICATION_MODE.get()); + //settings.APPLICATION_MODE.set(settings.DEFAULT_APPLICATION_MODE.get()); } }); finishCurrentRoute(); From 32505f9b6f5990a0c7db057200e2f2a3cefd3e43 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Wed, 11 Oct 2017 21:10:48 +0300 Subject: [PATCH 2/2] Fix #4272 --- .../net/osmand/plus/activities/FavoritesTreeFragment.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java index 481ba3154f..27538c97d0 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java @@ -114,7 +114,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment { } private void deleteFavorites() { - new AsyncTask() { + new AsyncTask() { @Override protected void onPreExecute() { @@ -122,17 +122,17 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment { } @Override - protected void onPostExecute(String result) { + protected void onPostExecute(Void result) { hideProgressBar(); favouritesAdapter.synchronizeGroups(); } @Override - protected String doInBackground(Void... params) { + protected Void doInBackground(Void... params) { helper.delete(groupsToDelete, getSelectedFavorites()); favoritesSelected.clear(); groupsToDelete.clear(); - return getString(R.string.favourites_delete_multiple_succesful); + return null; } }.execute();