diff --git a/android/app/src/main/cpp/app/organicmaps/bookmarks/data/BookmarkManager.cpp b/android/app/src/main/cpp/app/organicmaps/bookmarks/data/BookmarkManager.cpp index 29c4d55614..d1cea0b1aa 100644 --- a/android/app/src/main/cpp/app/organicmaps/bookmarks/data/BookmarkManager.cpp +++ b/android/app/src/main/cpp/app/organicmaps/bookmarks/data/BookmarkManager.cpp @@ -879,4 +879,10 @@ Java_app_organicmaps_bookmarks_data_BookmarkManager_nativeRemoveElevationActiveC { frm()->GetBookmarkManager().SetElevationActivePointChangedCallback(nullptr); } -} // extern "C" + +JNIEXPORT jboolean JNICALL +Java_app_organicmaps_widget_placepage_PlacePageButtonFactory_nativeHasRecentlyDeletedBookmark(JNIEnv *, jclass) +{ + return frm()->GetBookmarkManager().HasRecentlyDeletedBookmark(); +} +} // extern "C" \ No newline at end of file diff --git a/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageButtonFactory.java b/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageButtonFactory.java index 7a7e984cc4..5168ad5dff 100644 --- a/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageButtonFactory.java +++ b/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageButtonFactory.java @@ -23,7 +23,7 @@ public class PlacePageButtonFactory } case BOOKMARK_SAVE -> { - titleId = R.string.save; + titleId = nativeHasRecentlyDeletedBookmark() ? R.string.restore : R.string.save; yield R.drawable.ic_bookmarks_off; } case BOOKMARK_DELETE -> @@ -74,4 +74,6 @@ public class PlacePageButtonFactory }; return new PlacePageButton(titleId, iconId, buttonType); } + + private native static boolean nativeHasRecentlyDeletedBookmark(); } diff --git a/data/strings/strings.txt b/data/strings/strings.txt index 6b16d56235..2638f60af0 100644 --- a/data/strings/strings.txt +++ b/data/strings/strings.txt @@ -22286,7 +22286,7 @@ zh-Hant = 出現未知錯誤 [restore] - tags = ios + tags = android,ios en = Restore af = Stel terug ar = استعادة