forked from organicmaps/organicmaps
[android] Close routing on back press.
This commit is contained in:
parent
7e5614302a
commit
3baaa330b9
2 changed files with 9 additions and 3 deletions
|
@ -498,7 +498,8 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
@Override
|
||||
public void onCloseRouting()
|
||||
{
|
||||
closeRouting();
|
||||
mMainMenu.setNavigationMode(false);
|
||||
adjustZoomButtons(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1101,7 +1102,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
if (mSearchController.hide())
|
||||
return;
|
||||
|
||||
if (!closePlacePage() && !closeSidePanel())
|
||||
if (!closePlacePage() && !closeSidePanel() && !closeRouting())
|
||||
super.onBackPressed();
|
||||
}
|
||||
|
||||
|
@ -1314,11 +1315,15 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
}
|
||||
}
|
||||
|
||||
private void closeRouting()
|
||||
private boolean closeRouting()
|
||||
{
|
||||
if (mLayoutRouting.getState() == RoutingLayout.State.HIDDEN)
|
||||
return false;
|
||||
|
||||
mLayoutRouting.setState(RoutingLayout.State.HIDDEN, true);
|
||||
mMainMenu.setNavigationMode(false);
|
||||
adjustZoomButtons(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -180,6 +180,7 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
|
|||
AlohaHelper.logClick(AlohaHelper.ROUTING_VEHICLE_SET);
|
||||
Framework.setRouter(Framework.ROUTER_TYPE_VEHICLE);
|
||||
mListener.onRouteTypeChange(Framework.ROUTER_TYPE_VEHICLE);
|
||||
setState(State.PREPARING, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue