forked from organicmaps/organicmaps
[android] Fixed orientation changing for elevation profile place page
This commit is contained in:
parent
d326ceb490
commit
9f2a8183bf
7 changed files with 13 additions and 13 deletions
|
@ -11,7 +11,7 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class ElevationInfo implements Parcelable, UserMarkInterface
|
||||
public class ElevationInfo implements UserMarkInterface
|
||||
{
|
||||
private final long mId;
|
||||
@NonNull
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.mapswithme.maps.bookmarks.data;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.IntDef;
|
||||
|
@ -27,7 +26,7 @@ import java.util.List;
|
|||
|
||||
// TODO(yunikkk): Refactor. Displayed information is different from edited information, and it's better to
|
||||
// separate them. Simple getters from jni place_page::Info and osm::EditableFeature should be enough.
|
||||
public class MapObject implements Parcelable, PopularityProvider, ShareableInfoProvider,
|
||||
public class MapObject implements PopularityProvider, ShareableInfoProvider,
|
||||
UserMarkInterface
|
||||
{
|
||||
// Order must correspond indexer/map_object.hpp
|
||||
|
|
|
@ -17,7 +17,6 @@ import java.util.Objects;
|
|||
|
||||
public class ElevationProfileViewRenderer implements PlacePageViewRenderer<UserMarkInterface>
|
||||
{
|
||||
private static final String EXTRA_ELEVATION_INFO = "extra_elevation_info";
|
||||
private static final int MAX_DIFFICULTY_LEVEL = 3;
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
|
@ -100,13 +99,13 @@ public class ElevationProfileViewRenderer implements PlacePageViewRenderer<UserM
|
|||
@Override
|
||||
public void onSave(@NonNull Bundle outState)
|
||||
{
|
||||
outState.putParcelable(EXTRA_ELEVATION_INFO, mElevationInfo);
|
||||
outState.putParcelable(PlacePageUtils.EXTRA_USER_MARK, mElevationInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestore(@NonNull Bundle inState)
|
||||
{
|
||||
mElevationInfo = inState.getParcelable(EXTRA_ELEVATION_INFO);
|
||||
mElevationInfo = inState.getParcelable(PlacePageUtils.EXTRA_USER_MARK);
|
||||
if (mElevationInfo != null)
|
||||
render(mElevationInfo);
|
||||
}
|
||||
|
|
|
@ -148,10 +148,10 @@ class PlacePageControllerComposite implements PlacePageController
|
|||
@Override
|
||||
public void onRestore(@NonNull Bundle inState)
|
||||
{
|
||||
MapObject object = inState.getParcelable(PlacePageUtils.EXTRA_MAP_OBJECT);
|
||||
if (object != null)
|
||||
UserMarkInterface userMark = inState.getParcelable(PlacePageUtils.EXTRA_USER_MARK);
|
||||
if (userMark != null)
|
||||
{
|
||||
PlacePageController controller = findControllerFor(object);
|
||||
PlacePageController controller = findControllerFor(userMark);
|
||||
if (controller != null)
|
||||
mActiveController = controller;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ import com.trafi.anchorbottomsheetbehavior.AnchorBottomSheetBehavior;
|
|||
|
||||
class PlacePageUtils
|
||||
{
|
||||
static final String EXTRA_MAP_OBJECT = "extra_map_object";
|
||||
static final String EXTRA_USER_MARK = "extra_user_mark";
|
||||
|
||||
static void moveViewportUp(@NonNull View placePageView, int viewportMinHeight)
|
||||
{
|
||||
|
|
|
@ -448,7 +448,7 @@ public class RichPlacePageController implements PlacePageController, LocationLis
|
|||
public void onSave(@NonNull Bundle outState)
|
||||
{
|
||||
mPlacePageTracker.onSave(outState);
|
||||
outState.putParcelable(PlacePageUtils.EXTRA_MAP_OBJECT, mPlacePage.getMapObject());
|
||||
outState.putParcelable(PlacePageUtils.EXTRA_USER_MARK, mPlacePage.getMapObject());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -464,7 +464,7 @@ public class RichPlacePageController implements PlacePageController, LocationLis
|
|||
return;
|
||||
}
|
||||
|
||||
MapObject object = inState.getParcelable(PlacePageUtils.EXTRA_MAP_OBJECT);
|
||||
MapObject object = inState.getParcelable(PlacePageUtils.EXTRA_USER_MARK);
|
||||
if (object == null)
|
||||
return;
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.mapswithme.maps.widget.placepage;
|
||||
|
||||
public interface UserMarkInterface
|
||||
import android.os.Parcelable;
|
||||
|
||||
public interface UserMarkInterface extends Parcelable
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue