diff options
Diffstat (limited to 'android/src')
4 files changed, 14 insertions, 3 deletions
diff --git a/android/src/com/mapswithme/maps/Framework.java b/android/src/com/mapswithme/maps/Framework.java index c8a1c334bd..f50022e57e 100644 --- a/android/src/com/mapswithme/maps/Framework.java +++ b/android/src/com/mapswithme/maps/Framework.java @@ -18,6 +18,7 @@ import com.mapswithme.maps.api.ParsedUrlMwmRequest; import com.mapswithme.maps.auth.AuthorizationListener; import com.mapswithme.maps.background.NotificationCandidate; import com.mapswithme.maps.bookmarks.data.DistanceAndAzimut; +import com.mapswithme.maps.bookmarks.data.FeatureId; import com.mapswithme.maps.bookmarks.data.MapObject; import com.mapswithme.maps.downloader.DownloaderPromoBanner; import com.mapswithme.maps.gdpr.UserBindingListener; @@ -493,7 +494,7 @@ public class Framework @NonNull public static native String nativeGetTermsOfUseLink(); - public static native void nativeShowFeatureByLatLon(double lat, double lon); + public static native void nativeShowFeature(@NonNull FeatureId featureId); public static native void nativeShowBookmarkCategory(long cat); private static native int nativeGetFilterRating(float rawRating); diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java index 4011706396..54d6720c8e 100644 --- a/android/src/com/mapswithme/maps/MwmActivity.java +++ b/android/src/com/mapswithme/maps/MwmActivity.java @@ -1158,7 +1158,7 @@ public class MwmActivity extends BaseMwmFragmentActivity @Override public boolean run(@NonNull MwmActivity target) { - Framework.nativeShowFeatureByLatLon(object.getLat(), object.getLon()); + Framework.nativeShowFeature(object.getFeatureId()); return false; } }); diff --git a/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java b/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java index ee6b15ba03..eb34eabd3f 100644 --- a/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java +++ b/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java @@ -399,7 +399,7 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove String title = TextUtils.isEmpty(item.getTitle()) ? subtitle : item.getTitle(); - return MapObject.createMapObject(FeatureId.EMPTY, MapObject.SEARCH, title, subtitle, + return MapObject.createMapObject(item.getFeatureId(), MapObject.SEARCH, title, subtitle, item.getLat(), item.getLon()); } diff --git a/android/src/com/mapswithme/maps/gallery/Items.java b/android/src/com/mapswithme/maps/gallery/Items.java index 54e78e3065..128a8a5a3e 100644 --- a/android/src/com/mapswithme/maps/gallery/Items.java +++ b/android/src/com/mapswithme/maps/gallery/Items.java @@ -5,6 +5,7 @@ import androidx.annotation.Nullable; import com.mapswithme.maps.MwmApplication; import com.mapswithme.maps.R; +import com.mapswithme.maps.bookmarks.data.FeatureId; import com.mapswithme.maps.search.Popularity; import com.mapswithme.maps.search.SearchResult; @@ -136,6 +137,15 @@ public class Items } @NonNull + public FeatureId getFeatureId() + { + if (mResult.description == null) + return FeatureId.EMPTY; + + return mResult.description.featureId == null ? FeatureId.EMPTY : mResult.description.featureId; + } + + @NonNull public Popularity getPopularity() { return mResult.getPopularity(); |