[ios] Fixed onEnterBackground/Foreground invocations

This commit is contained in:
r.kuznetsov 2016-03-21 12:42:12 +03:00 committed by Sergey Yershov
parent 3d46289714
commit 9c9271881e
2 changed files with 2 additions and 8 deletions

View file

@ -561,6 +561,7 @@ using namespace osm_auth_ios;
{
[self.mapViewController.appWallAd close];
[RouteState save];
GetFramework().SetRenderingEnabled(false);
}
- (void)applicationWillEnterForeground:(UIApplication *)application
@ -587,6 +588,7 @@ using namespace osm_auth_ios;
[self handleURLs];
[self restoreRouteState];
[[Statistics instance] applicationDidBecomeActive];
GetFramework().SetRenderingEnabled(true);
}
- (void)dealloc

View file

@ -1067,7 +1067,6 @@ void Framework::MemoryWarning()
void Framework::EnterBackground()
{
SetRenderingEnabled(false);
SaveViewport();
ms::LatLon const ll = MercatorBounds::ToLatLon(GetViewportCenter());
@ -1086,13 +1085,6 @@ void Framework::EnterBackground()
void Framework::EnterForeground()
{
m_startForegroundTime = my::Timer::LocalTime();
// Drape can be not initialized here in case of the first launch
// TODO(AlexZ): Why it can't be initialized here? Is it because we call EnterForeground in Android for every
// time when activity is created? If yes, then this code should be refactored:
// EnterForeground and EnterBackground should be called only when user opens the app and
// when user completely leaves the app (and is not just switching between app's activities).
SetRenderingEnabled(true);
}
bool Framework::GetCurrentPosition(double & lat, double & lon) const