forked from organicmaps/organicmaps
[place-page] [ios] Optimized place page layout routine.
This commit is contained in:
parent
96558e0bdc
commit
bace567f8f
2 changed files with 23 additions and 20 deletions
|
@ -141,18 +141,20 @@ map<MetainfoRows, Class> const kMetaInfoCells = {
|
|||
if (_buttonsSectionEnabled == buttonsSectionEnabled)
|
||||
return;
|
||||
_buttonsSectionEnabled = buttonsSectionEnabled;
|
||||
auto data = self.data;
|
||||
auto tv = self.placePageView.tableView;
|
||||
if (!data || !tv)
|
||||
return;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
auto data = self.data;
|
||||
auto tv = self.placePageView.tableView;
|
||||
if (!data || !tv)
|
||||
return;
|
||||
|
||||
auto const & sections = data.sections;
|
||||
auto const it = find(sections.begin(), sections.end(), place_page::Sections::Buttons);
|
||||
if (it == sections.end())
|
||||
return;
|
||||
NSInteger const sectionNumber = distance(sections.begin(), it);
|
||||
[tv reloadSections:[NSIndexSet indexSetWithIndex:sectionNumber]
|
||||
withRowAnimation:UITableViewRowAnimationNone];
|
||||
auto const & sections = data.sections;
|
||||
auto const it = find(sections.begin(), sections.end(), place_page::Sections::Buttons);
|
||||
if (it == sections.end())
|
||||
return;
|
||||
NSInteger const sectionNumber = distance(sections.begin(), it);
|
||||
[tv reloadSections:[NSIndexSet indexSetWithIndex:sectionNumber]
|
||||
withRowAnimation:UITableViewRowAnimationNone];
|
||||
});
|
||||
}
|
||||
|
||||
- (MWMPlacePageActionBar *)actionBar
|
||||
|
|
|
@ -357,17 +357,18 @@ array<Class, 8> const kPreviewCells = {{[_MWMPPPTitle class],
|
|||
{
|
||||
if (IPAD)
|
||||
return;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
auto data = self.data;
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
auto data = self.data;
|
||||
if (!data)
|
||||
return;
|
||||
CLS_LOG(@"layoutInOpenState\tisOpen:%@\tLatitude:%@\tLongitude:%@", @(isOpen),
|
||||
@(data.latLon.lat), @(data.latLon.lon));
|
||||
|
||||
CLS_LOG(@"layoutInOpenState\tisOpen:%@\tLatitude:%@\tLongitude:%@", @(isOpen), @(data.latLon.lat),
|
||||
@(data.latLon.lon));
|
||||
|
||||
[self.tableView update:^{
|
||||
self.cachedBannerCell.state = isOpen ? MWMAdBannerStateDetailed : MWMAdBannerStateCompact;
|
||||
}];
|
||||
[self.tableView update:^{
|
||||
self.cachedBannerCell.state = isOpen ? MWMAdBannerStateDetailed : MWMAdBannerStateCompact;
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
||||
- (MWMDirectionView *)directionView
|
||||
|
|
Loading…
Add table
Reference in a new issue