Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladiMihaylenko <vxmihaylenko@gmail.com>2016-12-05 14:33:59 +0300
committerИлья Гречухин <i.grechuhin@gmail.com>2016-12-05 14:41:27 +0300
commit861f34bff32b1381537911175caca16d13a1d111 (patch)
tree14fa90b5e78c1f2c356651677a0767bc2e585e1c /iphone/Maps
parentef36502a74d2d1ce688500e605a1581b2200e040 (diff)
[ios] Returned default behavior of place page.
Diffstat (limited to 'iphone/Maps')
-rw-r--r--iphone/Maps/Classes/MWMPlacePageData.mm2
-rw-r--r--iphone/Maps/Classes/MWMPlacePageLayout.mm5
-rw-r--r--iphone/Maps/Classes/MWMiPhonePlacePageLayoutImpl.mm32
3 files changed, 19 insertions, 20 deletions
diff --git a/iphone/Maps/Classes/MWMPlacePageData.mm b/iphone/Maps/Classes/MWMPlacePageData.mm
index 28d73cf56f..a2eba023f4 100644
--- a/iphone/Maps/Classes/MWMPlacePageData.mm
+++ b/iphone/Maps/Classes/MWMPlacePageData.mm
@@ -75,7 +75,7 @@ using namespace place_page;
NSAssert(!m_previewRows.empty(), @"Preview row's can't be empty!");
m_previewRows.push_back(PreviewRows::Space);
-// Uncomment when implementation will not dummy.
+// Uncomment when implementation will be not dummy.
// if (m_info.HasBanner()) m_previewRows.push_back(PreviewRows::Banner);
}
diff --git a/iphone/Maps/Classes/MWMPlacePageLayout.mm b/iphone/Maps/Classes/MWMPlacePageLayout.mm
index e64f098f40..6bf3470505 100644
--- a/iphone/Maps/Classes/MWMPlacePageLayout.mm
+++ b/iphone/Maps/Classes/MWMPlacePageLayout.mm
@@ -130,10 +130,7 @@ array<NSString *, 1> const kButtonsCells = {{@"MWMPlacePageButtonCell"}};
[self.layoutImpl setPreviewLayoutHelper:self.previewLayoutHelper];
[self.placePageView.tableView reloadData];
-
- dispatch_async(dispatch_get_main_queue(), ^{
- [self.layoutImpl onShow];
- });
+ [self.layoutImpl onShow];
}
- (void)rotateDirectionArrowToAngle:(CGFloat)angle
diff --git a/iphone/Maps/Classes/MWMiPhonePlacePageLayoutImpl.mm b/iphone/Maps/Classes/MWMiPhonePlacePageLayoutImpl.mm
index 034e0c91bf..87ae6135e1 100644
--- a/iphone/Maps/Classes/MWMiPhonePlacePageLayoutImpl.mm
+++ b/iphone/Maps/Classes/MWMiPhonePlacePageLayoutImpl.mm
@@ -18,6 +18,9 @@ enum class State
CGFloat const kOpenPlacePageStopValue = 0.7;
CGFloat const kLuftDraggingOffset = 30;
+
+// Minimal offset for collapse. If place page offset is below this value we should hide place page.
+CGFloat const kMinOffset = 1;
} // namespace
@interface MWMiPhonePlacePageLayoutImpl () <UIScrollViewDelegate, UITableViewDelegate>
@@ -65,24 +68,23 @@ CGFloat const kLuftDraggingOffset = 30;
- (void)onShow
{
self.state = State::Bottom;
-
auto scrollView = self.scrollView;
+
scrollView.scrollEnabled = NO;
+ [scrollView setContentOffset:{ 0., kMinOffset }];
- place_page_layout::animate(
- ^{
- auto actionBar = self.actionBar;
- actionBar.maxY = actionBar.superview.height;
-
- self.expandedContentOffset =
- self.previewLayoutHelper.height + actionBar.height - self.placePageView.top.height;
- auto const targetOffset =
- self.state == State::Bottom ? self.expandedContentOffset : self.topContentOffset;
- [scrollView setContentOffset:{ 0, targetOffset } animated:YES];
- },
- ^{
- scrollView.scrollEnabled = YES;
- });
+ dispatch_async(dispatch_get_main_queue(), ^{
+ place_page_layout::animate(^{
+ scrollView.scrollEnabled = YES;
+ auto actionBar = self.actionBar;
+ actionBar.maxY = actionBar.superview.height;
+ self.expandedContentOffset =
+ self.previewLayoutHelper.height + actionBar.height - self.placePageView.top.height;
+ auto const targetOffset =
+ self.state == State::Bottom ? self.expandedContentOffset : self.topContentOffset;
+ [scrollView setContentOffset:{ 0, targetOffset } animated:YES];
+ });
+ });
}
- (void)onClose