From ea168480b3bf27a619d7ee2aaa62a6f2a98a0b64 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 15 Nov 2015 20:39:57 +0100 Subject: [PATCH 1/2] Fix small issues --- OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java | 5 +---- OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLocalUtil.java | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java index c1505c7e9f..01f7b41996 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java @@ -456,13 +456,10 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider private Dialog createBugDialog(final Bundle args) { AlertDialog.Builder builder = new AlertDialog.Builder(activity); - - builder.setTitle(""); + builder.setTitle(R.string.shared_string_commit); final View view = activity.getLayoutInflater().inflate(R.layout.open_bug, null); view.setId(R.id.layout); builder.setView(view); - - builder.setNegativeButton(R.string.shared_string_cancel, null); builder.setPositiveButton(R.string.shared_string_commit, null); return builder.create(); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLocalUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLocalUtil.java index 8bcfe4debd..68fabc7942 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLocalUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLocalUtil.java @@ -32,7 +32,7 @@ public class OsmBugsLocalUtil implements OsmBugsUtil { OsmBugResult s = new OsmBugResult(); s.local = p; s.warning = success ? null : ""; - return null; + return s; } @Override From 0251252f7e66956c6b9f350d6d550e3d2ffe3fa6 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 15 Nov 2015 20:48:27 +0100 Subject: [PATCH 2/2] Fix small issues --- OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java | 5 +++-- OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLocalUtil.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java index 01f7b41996..b8012c26c7 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java @@ -416,7 +416,7 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider } else { title = R.string.osn_add_dialog_title; } - AlertDialog dlg = (AlertDialog) dialog; + final AlertDialog dlg = (AlertDialog) dialog; dlg.setTitle(title); final View view = dlg.findViewById(R.id.layout); Button btn = dlg.getButton(DialogInterface.BUTTON_POSITIVE); @@ -447,8 +447,9 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider // AccessibleToast.makeText(activity, activity.getString(R.string.osb_author_or_password_not_specified), // Toast.LENGTH_SHORT).show(); // } - asyncActionTask(bug, text, action); activity.getContextMenu().close(); + asyncActionTask(bug, text, action); + dlg.dismiss(); } } }); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLocalUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLocalUtil.java index 68fabc7942..91f67fc774 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLocalUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLocalUtil.java @@ -38,7 +38,7 @@ public class OsmBugsLocalUtil implements OsmBugsUtil { @Override public OsmBugResult reopenBug(double latitude, double longitude, long id, String text){ OsmNotesPoint p = new OsmNotesPoint(); - p.setId(Math.min(-2, db.getMinID() -1)); + p.setId(id); p.setText(text); p.setLatitude(latitude); p.setLongitude(longitude);