From a274773b42261597cc2471025a2a8ed3f73b5d30 Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Wed, 25 Aug 2021 19:32:32 +0200 Subject: [PATCH] [android] Bookmark button now shows "Save" and "Delete" instead of just "Bookmark" The behavior was fixed to represent the current iOS implementation and to avoid accidental delete (now it's very clear for the user). Signed-off-by: Alexander Borsuk --- .../maps/widget/placepage/PlacePageButtons.java | 9 +++++++-- .../mapswithme/maps/widget/placepage/PlacePageView.java | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageButtons.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageButtons.java index ed7690afea..10b641eab2 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageButtons.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageButtons.java @@ -171,8 +171,13 @@ public final class PlacePageButtons }, ButtonType.BACK), - BOOKMARK( - R.string.bookmark, + BOOKMARK_SAVE( + R.string.save, + new ImageResources(R.drawable.ic_bookmarks_on), + ButtonType.BOOKMARK), + + BOOKMARK_DELETE( + R.string.delete, new ImageResources(R.drawable.ic_bookmarks_off), ButtonType.BOOKMARK), diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index 15009831ac..6f9946cc81 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -1000,7 +1000,8 @@ public class PlacePageView extends NestedScrollViewClickFixed if (needToShowRoutingButtons && !hasNumber) buttons.add(PlacePageButtons.Item.ROUTE_FROM); - buttons.add(PlacePageButtons.Item.BOOKMARK); + buttons.add(mapObject.getMapObjectType() == MapObject.BOOKMARK ? PlacePageButtons.Item.BOOKMARK_DELETE + : PlacePageButtons.Item.BOOKMARK_SAVE); if (needToShowRoutingButtons) {