Merge pull request #1205 from igrechuhin/ig-showcase

[ios] Updated showcase.
This commit is contained in:
Vlad Mihaylenko 2016-01-04 10:57:21 +03:00
commit 416cdd7ab9
10 changed files with 58 additions and 13 deletions

View file

@ -11,21 +11,22 @@
{
UICollectionViewLayoutAttributes * attr =
[UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath];
CGSize const size = self.collectionView.frame.size;
CGPoint origin = {};
CGSize size = self.collectionView.frame.size;
CGFloat const position = (CGFloat)indexPath.item / self.buttonsCount;
attr.hidden = (size.width == 0.0 || size.height == 0.0);
if (size.width > self.layoutThreshold)
{
CGFloat const xPos = nearbyint(position * size.width);
CGFloat const width = nearbyint(size.width / self.buttonsCount);
attr.frame = {{xPos, 0.0}, {width, size.height}};
origin = {nearbyint(position * size.width), 0.0};
size.width = nearbyint(size.width / self.buttonsCount);
}
else
{
CGFloat const yPos = nearbyint(position * size.height);
CGFloat const height = nearbyint(size.height / self.buttonsCount);
attr.frame = {{0.0, yPos}, {size.width, height}};
origin = {0.0, nearbyint(position * size.height)};
size.height = nearbyint(size.height / self.buttonsCount);
}
NSAssert(!CGSizeEqualToSize(size, CGSizeZero), @"Invalid cell size");
attr.frame = {origin, size};
return attr;
}

View file

@ -286,10 +286,7 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell)
{
MTRGNativeAppwallBanner * banner = [self.controller.appWallAd.banners firstObject];
[self.controller.appWallAd handleShow:banner];
UIImage * image = banner.icon.image;
UIImage * highlightedImage = banner.itemHighlightIcon.image;
NSString * title = banner.title;
[cell configureWithImage:image highlightedImage:highlightedImage label:title badgeCount:0];
[cell configureWithImageName:@"ic_menu_showcase" label:L(@"showcase_more_apps") badgeCount:0];
}
break;
case MWMBottomMenuViewCellCount:
@ -381,10 +378,11 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell)
- (void)menuActionOpenAd
{
NSAssert(self.controller.appWallAd.banners.count != 0, @"Banners collection can not be empty!");
NSArray<MTRGNativeAppwallBanner *> * banners = self.controller.appWallAd.banners;
NSAssert(banners.count != 0, @"Banners collection can not be empty!");
[[Statistics instance] logEvent:kStatMenu withParameters:@{kStatButton : kStatMoreApps}];
self.state = self.restoreState;
[self.controller.appWallAd handleClick:[self.controller.appWallAd.banners firstObject]
[self.controller.appWallAd handleClick:[banners firstObject]
withController:self.controller];
}

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_menu_showcase.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_menu_showcase@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_menu_showcase@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_menu_showcase_press.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_menu_showcase_press@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_menu_showcase_press@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B