forked from organicmaps/organicmaps
[android] More back press handler simplifications
Signed-off-by: Arnaud Vergnet <arnaud.vergnet@mailo.com>
This commit is contained in:
parent
25964f41ef
commit
00a4bb46e0
2 changed files with 16 additions and 18 deletions
|
@ -1135,20 +1135,10 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
return;
|
||||
}
|
||||
|
||||
if (closeMenu() || closePlacePage() || closeSearchToolbar(true, true) ||
|
||||
closeBookmarkCategoryToolbar() || closeSidePanel() || closePositionChooser())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RoutingController routingController = RoutingController.get();
|
||||
if (routingController.isNavigating())
|
||||
{
|
||||
routingController.resetToPlanningState();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!routingController.cancel())
|
||||
if (!closeMenu() && !closePlacePage() && !closeSearchToolbar(true, true) &&
|
||||
!closeBookmarkCategoryToolbar() && !closeSidePanel() && !closePositionChooser() &&
|
||||
!routingController.resetToPlanningStateIfNavigating() && !routingController.cancel())
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -514,12 +514,20 @@ public class RoutingController implements Initializable<Void>
|
|||
backToPlaningStateIfNavigating();
|
||||
}
|
||||
|
||||
public void resetToPlanningState()
|
||||
/**
|
||||
* @return False if not navigating, true otherwise
|
||||
*/
|
||||
public boolean resetToPlanningStateIfNavigating()
|
||||
{
|
||||
build();
|
||||
if (mContainer != null)
|
||||
mContainer.onResetToPlanningState();
|
||||
backToPlaningStateIfNavigating();
|
||||
if (isNavigating())
|
||||
{
|
||||
build();
|
||||
if (mContainer != null)
|
||||
mContainer.onResetToPlanningState();
|
||||
backToPlaningStateIfNavigating();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void backToPlaningStateIfNavigating()
|
||||
|
|
Loading…
Add table
Reference in a new issue