From f4d00eefa2d9b63d61374089a31226041f603a41 Mon Sep 17 00:00:00 2001 From: Zoia Pribytkova Date: Fri, 9 Aug 2019 11:51:07 +0300 Subject: [PATCH] [iOS] Fixed downloading banner show/hide behavior --- iphone/Maps/Classes/Widgets/MWMMapDownloadDialog.mm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/iphone/Maps/Classes/Widgets/MWMMapDownloadDialog.mm b/iphone/Maps/Classes/Widgets/MWMMapDownloadDialog.mm index 146c95f65b..931c46c6db 100644 --- a/iphone/Maps/Classes/Widgets/MWMMapDownloadDialog.mm +++ b/iphone/Maps/Classes/Widgets/MWMMapDownloadDialog.mm @@ -101,6 +101,7 @@ using namespace storage; } - (void)configDialog { + [self removePreviousBunnerIfNeeded]; auto &f = GetFramework(); auto const &s = f.GetStorage(); auto const &p = f.GetDownloadingPolicy(); @@ -347,6 +348,18 @@ using namespace storage; }]; } +- (void)removePreviousBunnerIfNeeded { + if (!self.bannerViewController) { + return; + } + self.bannerVisibleConstraintV.priority = UILayoutPriorityDefaultLow; + self.bannerVisibleConstraintH.priority = UILayoutPriorityDefaultLow; + [self.bannerViewController.view removeFromSuperview]; + self.bannerViewController = nil; + self.bannerView.hidden = YES; + [self layoutIfNeeded]; +} + #pragma mark - MWMFrameworkStorageObserver - (void)processCountryEvent:(CountryId const &)countryId {