[ios] Fixed wrong place page layout on iPad.

This commit is contained in:
v.mikhaylenko 2015-06-19 14:24:41 +03:00 committed by Alex Zolotarev
parent f074299ef0
commit 244958943e
15 changed files with 16 additions and 86 deletions

View file

@ -91,9 +91,9 @@ static CGFloat const kTitleBottomOffset = 2.;
[super layoutSubviews];
MWMPlacePageEntity * entity = self.entity;
MWMPlacePageEntityType const type = entity.type;
CGSize const size = [UIScreen mainScreen].bounds.size;
CGFloat const maximumWidth = 360.;
CGFloat const placePageWidth = size.width > size.height ? (size.height > maximumWidth ? maximumWidth : size.height) : size.width;
CGSize const size = [UIScreen mainScreen].bounds.size;
CGFloat const placePageWidth = IPAD ? maximumWidth : size.width > size.height ? MIN(maximumWidth, size.height) : size.width;
CGFloat const maximumTitleWidth = kPlacePageTitleKoefficient * placePageWidth;
BOOL const isExtendedType = type == MWMPlacePageEntityTypeEle || type == MWMPlacePageEntityTypeHotel;
CGFloat const topOffset = (self.typeLabel.text.length > 0 || isExtendedType) ? 0 : 4.;
@ -117,7 +117,7 @@ static CGFloat const kTitleBottomOffset = 2.;
self.featureTable.minY = typeMinY + typeHeight + typeBottomOffset;
self.separatorView.minY = self.featureTable.minY - 1;
self.featureTable.height = self.featureTable.contentSize.height;
self.height = typeBottomOffset + kTitleBottomOffset + typeHeight + self.titleLabel.height + self.typeLabel.height + self.featureTable.height;
self.height = typeBottomOffset + kTitleBottomOffset + self.titleLabel.height + self.typeLabel.height + self.featureTable.height;
}
- (void)layoutTypeDescription

View file

@ -60,6 +60,7 @@ typedef NS_ENUM(NSUInteger, BookmarkDescriptionState)
self.state = BookmarkDescriptionStateEditText;
if (self.iPadOwnerNavigationController)
return;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShown:)
name:UIKeyboardWillShowNotification object:nil];

View file

@ -74,27 +74,25 @@ extern CGFloat kBookmarkCellHeight;
[self.navigationController removeFromParentViewController];
self.navigationController = [[MWMiPadNavigationController alloc] initWithRootViewController:self.viewController];
UIView const * view = self.manager.ownerViewController.view;
UIView * view = self.manager.ownerViewController.view;
CGFloat const topOffset = 36.;
CGFloat const leftOffset = 12.;
CGFloat const defaultWidth = 360.;
CGFloat const actionBarHeight = 58.;
CGFloat const defaultHeight = self.basePlacePageView.height + self.anchorImageView.height + actionBarHeight;
CGFloat const actionBarHeight = self.actionBar.height;
CGFloat const height = self.basePlacePageView.height + self.anchorImageView.height + actionBarHeight - 1;
self.navigationController.view.frame = CGRectMake(leftOffset, topOffset, defaultWidth, height);
self.viewController.view.frame = self.navigationController.view.frame;
[self.manager.ownerViewController addChildViewController:self.navigationController];
self.navigationController.view.frame = CGRectMake(leftOffset, topOffset, defaultWidth, defaultHeight);
self.viewController.view.frame = CGRectMake(leftOffset, topOffset, defaultWidth, defaultHeight);
self.extendedPlacePageView.frame = CGRectMake(0., 0., defaultWidth, defaultHeight - 1);
[view addSubview:self.navigationController.view];
[self.viewController.view addSubview:self.extendedPlacePageView];
self.extendedPlacePageView.size = self.navigationController.view.size;
[self.viewController.view addSubview:self.extendedPlacePageView];
self.extendedPlacePageView.origin = CGPointZero;
self.anchorImageView.image = nil;
self.anchorImageView.backgroundColor = [UIColor whiteColor];
self.actionBar.width = defaultWidth;
self.actionBar.origin = CGPointMake(0., defaultHeight - actionBarHeight - 1);
[self.viewController.view addSubview:self.extendedPlacePageView];
[self.viewController.view addSubview:self.actionBar];
[view addSubview:self.navigationController.view];
[self.extendedPlacePageView addSubview:self.actionBar];
self.actionBar.frame = CGRectMake(0., self.extendedPlacePageView.maxY - actionBarHeight, defaultWidth, actionBarHeight);
}
- (void)dismiss

View file

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 B

View file

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 B

View file

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB