From dc08505990c57ec1a038f31682fc9d7273cef202 Mon Sep 17 00:00:00 2001 From: Dmitry Yunitsky Date: Mon, 15 Jun 2015 12:10:46 +0300 Subject: [PATCH] Save bookmark name correctly. --- .../maps/widget/placepage/PlacePageView.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index 2a03f8dd51..f58e7979d3 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -261,6 +261,7 @@ public class PlacePageView extends RelativeLayout implements View.OnClickListene public MapObject getMapObject() { + saveBookmarkNameIfUpdated(); return mMapObject; } @@ -269,6 +270,7 @@ public class PlacePageView extends RelativeLayout implements View.OnClickListene if (hasMapObject(mapObject)) return; + saveBookmarkNameIfUpdated(); mMapObject = mapObject; refreshViews(); } @@ -585,12 +587,23 @@ public class PlacePageView extends RelativeLayout implements View.OnClickListene } } + private void saveBookmarkNameIfUpdated() + { + if (mMapObject == null || !(mMapObject instanceof Bookmark)) + return; + + final Bookmark bookmark = (Bookmark) mMapObject; + final String name = mEtBookmarkName.getText().toString(); + bookmark.setParams(name, null, bookmark.getBookmarkDescription()); + } + @Override public void onClick(View v) { switch (v.getId()) { case R.id.iv__bookmark_color: + saveBookmarkNameIfUpdated(); selectBookmarkColor(); break; case R.id.rl__bookmark: @@ -639,6 +652,7 @@ public class PlacePageView extends RelativeLayout implements View.OnClickListene getContext().startActivity(intent); break; case R.id.tv__bookmark_group: + saveBookmarkNameIfUpdated(); selectBookmarkSet(); break; case R.id.av__direction: