Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArsentiy Milchakov <milcars@mapswithme.com>2016-10-19 17:57:03 +0300
committerGitHub <noreply@github.com>2016-10-19 17:57:03 +0300
commitf8dc64fe5328426275d9c1f69551b3a37d4de62d (patch)
tree8116c3d558d0a1a4d93c3784e7223d96c38d1e57
parent93f051f434a8f82e46fb36e38c495c919fd38d6c (diff)
parent11c521f98ffdcb1533cd81feb6f1bd7af07b9ce3 (diff)
Merge pull request #4525 from alexzatsepin/MAPSME-2680-save-uber-panel-during-rotation
[android] Added saving the Uber panel during rotation
-rw-r--r--android/src/com/mapswithme/maps/MwmActivity.java8
-rw-r--r--android/src/com/mapswithme/maps/routing/RoutingController.java13
2 files changed, 16 insertions, 5 deletions
diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java
index 9d35ed55e8..0b8fd531d5 100644
--- a/android/src/com/mapswithme/maps/MwmActivity.java
+++ b/android/src/com/mapswithme/maps/MwmActivity.java
@@ -1332,14 +1332,15 @@ public class MwmActivity extends BaseMwmFragmentActivity
private void adjustMenuLineFrameVisibility()
{
- if (RoutingController.get().isBuilt())
+ final RoutingController controller = RoutingController.get();
+
+ if (controller.isBuilt() || controller.isUberInfoObtained())
{
mMainMenu.showLineFrame(true);
return;
}
- if (RoutingController.get().isPlanning() || RoutingController.get().isBuilding()
- || RoutingController.get().isErrorEncountered())
+ if (controller.isPlanning() || controller.isBuilding() || controller.isErrorEncountered())
{
mMainMenu.showLineFrame(false);
return;
@@ -1431,7 +1432,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
else
{
mRoutingPlanInplaceController.showUberInfo(info);
- mMainMenu.showLineFrame(true);
}
}
diff --git a/android/src/com/mapswithme/maps/routing/RoutingController.java b/android/src/com/mapswithme/maps/routing/RoutingController.java
index 4895d280a7..8362f77f1c 100644
--- a/android/src/com/mapswithme/maps/routing/RoutingController.java
+++ b/android/src/com/mapswithme/maps/routing/RoutingController.java
@@ -97,6 +97,7 @@ public class RoutingController
private String[] mLastMissingMaps;
@Nullable
private RoutingInfo mCachedRoutingInfo;
+ private boolean mUberInfoObtained;
@SuppressWarnings("FieldCanBeLocal")
private final Framework.RoutingListener mRoutingListener = new Framework.RoutingListener()
@@ -250,7 +251,7 @@ public class RoutingController
private void build()
{
mLogger.d("build");
-
+ mUberInfoObtained = false;
mLastBuildProgress = 0;
setBuildState(BuildState.BUILDING);
updatePlan();
@@ -259,6 +260,7 @@ public class RoutingController
org.alohalytics.Statistics.logEvent(AlohaHelper.ROUTING_BUILD, new String[] {Statistics.EventParam.FROM, Statistics.getPointType(mStartPoint),
Statistics.EventParam.TO, Statistics.getPointType(mEndPoint)});
Framework.nativeBuildRoute(mStartPoint.getLat(), mStartPoint.getLon(), mEndPoint.getLat(), mEndPoint.getLon());
+
if (mLastRouterType == Framework.ROUTER_TYPE_TAXI)
requestUberInfo();
}
@@ -494,6 +496,11 @@ public class RoutingController
return (mWaitingPoiPickSlot != NO_SLOT);
}
+ public boolean isUberInfoObtained()
+ {
+ return mUberInfoObtained;
+ }
+
BuildState getBuildState()
{
return mBuildState;
@@ -771,6 +778,10 @@ public class RoutingController
{
mLogger.d("onUberInfoReceived uberInfo = " + info);
if (mLastRouterType == Framework.ROUTER_TYPE_TAXI && mContainer != null)
+ {
mContainer.onUberInfoReceived(info);
+ mUberInfoObtained = true;
+ mContainer.updateMenu();
+ }
}
}