forked from organicmaps/organicmaps
[android] fix: PlacePage disappears only when is not floating and not docked.
This commit is contained in:
parent
043c7088f6
commit
6cc2c17303
4 changed files with 32 additions and 22 deletions
|
@ -562,7 +562,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
if (mPlacePage.getState() == State.HIDDEN)
|
||||
return false;
|
||||
|
||||
hidePlacePage();
|
||||
mPlacePage.hide();
|
||||
Framework.deactivatePopup();
|
||||
return true;
|
||||
}
|
||||
|
@ -599,6 +599,9 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
mLayoutRouting.setEndPoint(mPlacePage.getMapObject());
|
||||
mLayoutRouting.setState(RoutingLayout.State.PREPARING, true);
|
||||
|
||||
if (mPlacePage.isDocked() || !mPlacePage.isFloating())
|
||||
closePlacePage();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1241,12 +1244,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
}
|
||||
}
|
||||
|
||||
private void hidePlacePage()
|
||||
{
|
||||
mPlacePage.setState(State.HIDDEN);
|
||||
mPlacePage.setMapObject(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss()
|
||||
{
|
||||
|
@ -1257,7 +1254,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
@Override
|
||||
public void run()
|
||||
{
|
||||
hidePlacePage();
|
||||
mPlacePage.hide();
|
||||
Framework.deactivatePopup();
|
||||
}
|
||||
});
|
||||
|
@ -1348,15 +1345,8 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
@Override
|
||||
public boolean onTouch(View view, MotionEvent event)
|
||||
{
|
||||
boolean result = false;
|
||||
if (mPlacePage.getState() == State.DETAILS || mPlacePage.getState() == State.BOOKMARK)
|
||||
{
|
||||
Framework.deactivatePopup();
|
||||
hidePlacePage();
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result || mMapFragment.onTouch(view, event);
|
||||
return mPlacePage.hideOnTouch() ||
|
||||
mMapFragment.onTouch(view, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -108,8 +108,8 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle
|
|||
{
|
||||
mGestureDetector = new GestureDetectorCompat(mPlacePage.getContext(), new GestureDetector.SimpleOnGestureListener()
|
||||
{
|
||||
private final int Y_MIN = UiUtils.dp(50);
|
||||
private final int Y_MAX = UiUtils.dp(150);
|
||||
private final int Y_MIN = UiUtils.dp(10);
|
||||
private final int Y_MAX = UiUtils.dp(50);
|
||||
private static final int X_TO_Y_SCROLL_RATIO = 2;
|
||||
|
||||
@Override
|
||||
|
|
|
@ -62,8 +62,8 @@ class PlacePageLeftAnimationController extends BasePlacePageAnimationController
|
|||
{
|
||||
mGestureDetector = new GestureDetectorCompat(mPlacePage.getContext(), new GestureDetector.SimpleOnGestureListener()
|
||||
{
|
||||
private final int X_MIN = UiUtils.dp(80);
|
||||
private final int X_MAX = UiUtils.dp(200);
|
||||
private final int X_MIN = UiUtils.dp(30);
|
||||
private final int X_MAX = UiUtils.dp(100);
|
||||
private static final int X_TO_Y_SCROLL_RATIO = 2;
|
||||
|
||||
@Override
|
||||
|
@ -77,7 +77,7 @@ class PlacePageLeftAnimationController extends BasePlacePageAnimationController
|
|||
if (!mIsGestureHandled)
|
||||
{
|
||||
if (distanceX > 0)
|
||||
mPlacePage.setState(State.HIDDEN);
|
||||
mPlacePage.hide();
|
||||
|
||||
mIsGestureHandled = true;
|
||||
}
|
||||
|
|
|
@ -864,4 +864,24 @@ public class PlacePageView extends RelativeLayout implements View.OnClickListene
|
|||
{
|
||||
mLeftAnimationTrackListener = listener;
|
||||
}
|
||||
|
||||
public void hide()
|
||||
{
|
||||
setState(State.HIDDEN);
|
||||
}
|
||||
|
||||
@SuppressWarnings("SimplifiableIfStatement")
|
||||
public boolean hideOnTouch()
|
||||
{
|
||||
if (mIsDocked || mIsFloating)
|
||||
return false;
|
||||
|
||||
if (getState() == State.BOOKMARK || getState() == State.DETAILS)
|
||||
{
|
||||
hide();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue