diff --git a/android/src/com/mapswithme/maps/bookmarks/data/MapObject.java b/android/src/com/mapswithme/maps/bookmarks/data/MapObject.java index 9ee1b7c246..3216b82ac4 100644 --- a/android/src/com/mapswithme/maps/bookmarks/data/MapObject.java +++ b/android/src/com/mapswithme/maps/bookmarks/data/MapObject.java @@ -213,7 +213,7 @@ public class MapObject implements Parcelable, PopularityProvider * MapObject does not participate in any sets or other collections that need {@code hashCode()}. * So {@code sameAs()} serves as {@code equals()} but does not break the equals+hashCode contract. */ - public boolean sameAs(MapObject other) + public boolean sameAs(@Nullable MapObject other) { if (other == null) return false; @@ -225,13 +225,14 @@ public class MapObject implements Parcelable, PopularityProvider if (getClass() != other.getClass()) return false; + if (mFeatureId != FeatureId.EMPTY && other.getFeatureId() != FeatureId.EMPTY) + return mFeatureId.equals(other.getFeatureId()); + return Double.doubleToLongBits(mLon) == Double.doubleToLongBits(other.mLon) && - Double.doubleToLongBits(mLat) == Double.doubleToLongBits(other.mLat) && - TextUtils.equals(mTitle, other.mTitle) && - TextUtils.equals(mSubtitle, other.mSubtitle); + Double.doubleToLongBits(mLat) == Double.doubleToLongBits(other.mLat); } - public static boolean same(MapObject one, MapObject another) + public static boolean same(@Nullable MapObject one, @Nullable MapObject another) { //noinspection SimplifiableIfStatement if (one == null && another == null) diff --git a/android/src/com/mapswithme/maps/widget/placepage/BottomSheetPlacePageController.java b/android/src/com/mapswithme/maps/widget/placepage/BottomSheetPlacePageController.java index 30288dc4cf..75e2f213f4 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/BottomSheetPlacePageController.java +++ b/android/src/com/mapswithme/maps/widget/placepage/BottomSheetPlacePageController.java @@ -235,9 +235,12 @@ public class BottomSheetPlacePageController implements PlacePageController, Loca return; } + mPlacePage.resetScroll(); + mPlacePage.resetWebView(); + if (object.isExtendedView()) { - mPlacePageBehavior.setState(AnchorBottomSheetBehavior.STATE_EXPANDED); + mPlacePageBehavior.setState(AnchorBottomSheetBehavior.STATE_ANCHORED); return; } diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index 297f2aa918..8aba9a5289 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -982,11 +982,6 @@ public class PlacePageView extends NestedScrollView return mIsFloating; } - private void clearBookmarkWebView() - { - mWvBookmarkNote.loadUrl("about:blank"); - } - @Nullable public MapObject getMapObject() { @@ -1821,11 +1816,21 @@ public class PlacePageView extends NestedScrollView void reset() { - scrollTo(0, 0); - clearBookmarkWebView(); + resetScroll(); + resetWebView(); detachCountry(); } + void resetScroll() + { + scrollTo(0, 0); + } + + void resetWebView() + { + mWvBookmarkNote.loadUrl("about:blank"); + } + private static boolean isInvalidDownloaderStatus(int status) { return (status != CountryItem.STATUS_DOWNLOADABLE &&