From 3afd8fc3bd7d62fc17e76e138cee61918429c4d6 Mon Sep 17 00:00:00 2001 From: cepprice Date: Wed, 27 Jan 2021 10:43:34 +0500 Subject: [PATCH 1/2] Fix #10658 --- OsmAnd/res/values/strings.xml | 1 + OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 79d3a211b4..439678fcac 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -12,6 +12,7 @@ --> + Select edits for upload Copy to favorites Copy to map markers Delete waypoints diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java index e61520188d..56c49c4219 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java @@ -295,8 +295,13 @@ public class OsmEditsFragment extends OsmAndListFragment implements ProgressDial item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { - uploadItems(osmEditsSelected.toArray(new OsmPoint[0])); - mode.finish(); + if (Algorithms.isEmpty(osmEditsSelected)) { + Toast.makeText(requireContext(), + R.string.toast_select_edits_for_upload, Toast.LENGTH_LONG).show(); + } else { + uploadItems(osmEditsSelected.toArray(new OsmPoint[0])); + mode.finish(); + } return true; } }); From 943eaa6b7d5ccf69b27de8ebcc5422d9ae8591f4 Mon Sep 17 00:00:00 2001 From: cepprice Date: Wed, 27 Jan 2021 14:05:53 +0500 Subject: [PATCH 2/2] Small edit to prevent Exception --- OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java index 56c49c4219..cacc1ed125 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java @@ -296,8 +296,7 @@ public class OsmEditsFragment extends OsmAndListFragment implements ProgressDial @Override public boolean onMenuItemClick(MenuItem item) { if (Algorithms.isEmpty(osmEditsSelected)) { - Toast.makeText(requireContext(), - R.string.toast_select_edits_for_upload, Toast.LENGTH_LONG).show(); + app.showToastMessage(R.string.toast_select_edits_for_upload); } else { uploadItems(osmEditsSelected.toArray(new OsmPoint[0])); mode.finish();