Merge pull request #950 from Zahnstocher/onresumer1.9-patch

fix route recalculation and screen update issue on MapActivity resume
This commit is contained in:
vshcherb 2014-11-17 10:22:54 +01:00
commit 274796d5c3
2 changed files with 12 additions and 6 deletions

View file

@ -124,7 +124,15 @@ public class TargetPointsHelper {
return intermediatePoints; return intermediatePoints;
} }
public List<LatLon> getIntermediatePointsLatLon() {
List<LatLon> intermediatePointsLatLon = new ArrayList<LatLon>();
for (TargetPoint t : intermediatePoints) {
intermediatePointsLatLon.add(t.point);
}
return intermediatePointsLatLon;
}
public List<TargetPoint> getIntermediatePointsWithTarget() { public List<TargetPoint> getIntermediatePointsWithTarget() {
List<TargetPoint> res = new ArrayList<TargetPoint>(); List<TargetPoint> res = new ArrayList<TargetPoint>();

View file

@ -292,9 +292,7 @@ public class MapActivity extends AccessibleActivity implements
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if ((wakeLock != null) || (keyguardLock != null)) {
return;
}
cancelNotification(); cancelNotification();
//fixing bug with action bar appearing on android 2.3.3 //fixing bug with action bar appearing on android 2.3.3
if (getSupportActionBar() != null){ if (getSupportActionBar() != null){
@ -334,8 +332,8 @@ public class MapActivity extends AccessibleActivity implements
TargetPointsHelper targets = app.getTargetPointsHelper(); TargetPointsHelper targets = app.getTargetPointsHelper();
RoutingHelper routingHelper = app.getRoutingHelper(); RoutingHelper routingHelper = app.getRoutingHelper();
if (routingHelper.isFollowingMode() && ( if (routingHelper.isFollowingMode() && (
!Algorithms.objectEquals(targets.getPointToNavigate(), routingHelper.getFinalLocation() )|| !Algorithms.objectEquals(targets.getPointToNavigate().point, routingHelper.getFinalLocation() )||
!Algorithms.objectEquals(targets.getIntermediatePoints(), routingHelper.getIntermediatePoints()) !Algorithms.objectEquals(targets.getIntermediatePointsLatLon(), routingHelper.getIntermediatePoints())
)) { )) {
targets.updateRouteAndReferesh(true); targets.updateRouteAndReferesh(true);
} }