diff options
Diffstat (limited to 'iphone/Maps/Classes/CustomViews/SearchDownloadMapRequest/MWMSearchDownloadMapRequestView.m')
-rw-r--r-- | iphone/Maps/Classes/CustomViews/SearchDownloadMapRequest/MWMSearchDownloadMapRequestView.m | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/iphone/Maps/Classes/CustomViews/SearchDownloadMapRequest/MWMSearchDownloadMapRequestView.m b/iphone/Maps/Classes/CustomViews/SearchDownloadMapRequest/MWMSearchDownloadMapRequestView.m new file mode 100644 index 0000000000..626cd5e193 --- /dev/null +++ b/iphone/Maps/Classes/CustomViews/SearchDownloadMapRequest/MWMSearchDownloadMapRequestView.m @@ -0,0 +1,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 |