forked from organicmaps/organicmaps
Merge pull request #644 from igrechuhin/ig-master
[ios] Optimized showcase load.
This commit is contained in:
commit
143618ebc4
3 changed files with 11 additions and 4 deletions
|
@ -574,10 +574,7 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell)
|
|||
|
||||
- (NSUInteger)additionalButtonsCount
|
||||
{
|
||||
BOOL const haveAppWall = (self.controller.appWallAd != nil);
|
||||
BOOL const haveBanners = (self.controller.appWallAd.banners && self.controller.appWallAd.banners != 0);
|
||||
BOOL const adForbidden = (!haveAppWall || !haveBanners);
|
||||
return MWMBottomMenuViewCellCount - (adForbidden ? 1 : 0);
|
||||
return MWMBottomMenuViewCellCount - (self.controller.isAppWallAdActive ? 0 : 1);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -47,6 +47,7 @@ namespace search { struct AddressInfo; }
|
|||
- (void)openBookmarks;
|
||||
|
||||
@property (nonatomic) MTRGNativeAppwallAd * appWallAd;
|
||||
@property (nonatomic, readonly) BOOL isAppWallAdActive;
|
||||
|
||||
@property (nonatomic) UIPopoverController * popoverVC;
|
||||
@property (nonatomic) ShareActionSheet * shareActionSheet;
|
||||
|
|
|
@ -800,6 +800,8 @@ typedef NS_ENUM(NSUInteger, UserTouchesAction)
|
|||
self.appWallAd = nil;
|
||||
return;
|
||||
}
|
||||
if (self.isAppWallAdActive)
|
||||
return;
|
||||
self.appWallAd = [[MTRGNativeAppwallAd alloc]initWithSlotId:@(MY_TARGET_KEY)];
|
||||
self.appWallAd.handleLinksInApp = YES;
|
||||
self.appWallAd.closeButtonTitle = L(@"close");
|
||||
|
@ -965,4 +967,11 @@ NSInteger compareAddress(id l, id r, void * context)
|
|||
return _controlsManager;
|
||||
}
|
||||
|
||||
- (BOOL)isAppWallAdActive
|
||||
{
|
||||
BOOL const haveAppWall = (self.appWallAd != nil);
|
||||
BOOL const haveBanners = (self.appWallAd.banners && self.appWallAd.banners != 0);
|
||||
return haveAppWall && haveBanners;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Add table
Reference in a new issue