<commit_before>#import "MWMiPadPlacePageLayoutImpl.h"
#import "MWMPlacePageLayout.h"
#import "SwiftBridge.h"

namespace
{
CGFloat const kPlacePageWidth = 360;
CGFloat const kLeftOffset = 12;
CGFloat const kTopOffset = 36;
CGFloat const kBottomOffset = 60;
}  // namespace

@interface MWMiPadPlacePageLayoutImpl ()<UITableViewDelegate>

@property(nonatomic) CGFloat topBound;
@property(nonatomic) CGFloat leftBound;

@end

@implementation MWMiPadPlacePageLayoutImpl

@synthesize ownerView = _ownerView;
@synthesize placePageView = _placePageView;
@synthesize delegate = _delegate;
@synthesize actionBar = _actionBar;

- (instancetype)initOwnerView:(UIView *)ownerView
                placePageView:(MWMPPView *)placePageView
                     delegate:(id<MWMPlacePageLayoutDelegate>)delegate
{
  self = [super init];
  if (self)
  {
    _ownerView = ownerView;
    self.placePageView = placePageView;
    placePageView.tableView.delegate = self;
    _delegate = delegate;
    [self addShadow];
  }
  return self;
}

- (void)addShadow
{
  CALayer * layer = self.placePageView.layer;
  layer.masksToBounds = NO;
  layer.shadowColor = UIColor.blackColor.CGColor;
  layer.shadowRadius = 4.;
  layer.shadowOpacity = 0.24f;
  layer.shadowOffset = {0, -2};
  layer.shouldRasterize = YES;
  layer.rasterizationScale = [[UIScreen mainScreen] scale];
}

- (void)onShow
{
  auto ppView = self.placePageView;
  auto actionBar = self.actionBar;
  ppView.tableView.scrollEnabled = NO;
  actionBar.alpha = 0;
  ppView.alpha = 0;
  ppView.origin = {- kPlacePageWidth, self.topBound};
  [self.ownerView insertSubview:ppView atIndex:0];

  place_page_layout::animate(^{
    ppView.alpha = 1;
    actionBar.alpha = 1;
    ppView.minX = self.leftBound;
  });
}

- (void)onClose
{
  auto ppView = self.placePageView;
  place_page_layout::animate(
      ^{
        ppView.maxX = 0;
        ppView.alpha = 0;
      },
      ^{
        self.placePageView = nil;<commit_msg>[MAPSME-4917] [ios] Revert for invalid iPad place page display logic fix.<commit_after>#import "MWMiPadPlacePageLayoutImpl.h"
#import "MWMPlacePageLayout.h"
#import "SwiftBridge.h"

namespace
{
CGFloat const kPlacePageWidth = 360;
CGFloat const kLeftOffset = 12;
CGFloat const kTopOffset = 36;
CGFloat const kBottomOffset = 60;
}  // namespace

@interface MWMiPadPlacePageLayoutImpl ()<UITableViewDelegate>

@property(nonatomic) CGFloat topBound;
@property(nonatomic) CGFloat leftBound;

@end

@implementation MWMiPadPlacePageLayoutImpl

@synthesize ownerView = _ownerView;
@synthesize placePageView = _placePageView;
@synthesize delegate = _delegate;
@synthesize actionBar = _actionBar;

- (instancetype)initOwnerView:(UIView *)ownerView
                placePageView:(MWMPPView *)placePageView
                     delegate:(id<MWMPlacePageLayoutDelegate>)delegate
{
  self = [super init];
  if (self)
  {
    _ownerView = ownerView;
    self.placePageView = placePageView;
    placePageView.tableView.delegate = self;
    _delegate = delegate;
    [self addShadow];
  }
  return self;
}

- (void)addShadow
{
  CALayer * layer = self.placePageView.layer;
  layer.masksToBounds = NO;
  layer.shadowColor = UIColor.blackColor.CGColor;
  layer.shadowRadius = 4.;
  layer.shadowOpacity = 0.24f;
  layer.shadowOffset = {0, -2};
  layer.shouldRasterize = YES;
  layer.rasterizationScale = [[UIScreen mainScreen] scale];
}

- (void)onShow
{
  auto ppView = self.placePageView;
  auto actionBar = self.actionBar;
  ppView.tableView.scrollEnabled = NO;
  actionBar.alpha = 0;
  ppView.alpha = 0;
  ppView.origin = {- kPlacePageWidth, self.topBound};
  [self.ownerView addSubview:ppView];

  place_page_layout::animate(^{
    ppView.alpha = 1;
    actionBar.alpha = 1;
    ppView.minX = self.leftBound;
  });
}

- (void)onClose
{
  auto ppView = self.placePageView;
  place_page_layout::animate(
      ^{
        ppView.maxX = 0;
        ppView.alpha = 0;
      },
      ^{
        self.placePageView = nil;
{'fraction_non_alphanumeric': 0.11060491014932929, 'fraction_numerical': 0.011895722601872943, 'mean_word_length': 3.891089108910891, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4941299', 'n_tokens_mistral': 1425, 'n_tokens_neox': 1335, 'n_words': 264}