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

MWMSearchDownloadMapRequestView.m « SearchDownloadMapRequest « CustomViews « Classes « Maps « iphone - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 626cd5e193b4629a9bd4813992c968cfcfacc0d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
//  MWMSearchDownloadMapRequestView.m
//  Maps
//
//  Created by Ilya Grechuhin on 09.07.15.
//  Copyright (c) 2015 MapsWithMe. All rights reserved.
//

#import "Macros.h"
#import "MWMDownloadMapRequestView.h"
#import "MWMSearchDownloadMapRequestView.h"
#import "UIKitCategories.h"

@interface MWMSearchDownloadMapRequestView ()

@property (weak, nonatomic) IBOutlet UILabel * hint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint * hintTopOffset;

@end

@implementation MWMSearchDownloadMapRequestView

- (void)layoutSubviews
{
  [super layoutSubviews];
  UIView * superview = self.superview;
  self.frame = superview.bounds;
  // @TODO Remove on new search!
  CGFloat const someCrazyTopOfsetForCurrentSearchViewImplementation = 64.0;
  CGFloat const topOffset = (IPAD || superview.height > superview.width ? 40.0 : 12.0);
  self.hintTopOffset.constant = someCrazyTopOfsetForCurrentSearchViewImplementation + topOffset;
}

#pragma mark - Properties

- (void)setHintHidden:(BOOL)hintHidden
{
  if (self.hint.hidden == hintHidden)
    return;
  if (!hintHidden)
    self.hint.hidden = hintHidden;
  [UIView animateWithDuration:0.3 animations:^
  {
    self.hint.alpha = hintHidden ? 0.0 : 1.0;
  }
  completion:^(BOOL finished)
  {
    if (hintHidden)
      self.hint.hidden = hintHidden;
  }];
}

- (BOOL)hintHidden
{
  return self.hint.hidden;
}

@end