Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
@objc(MWMDownloaderNoResultsEmbedViewController)
|
||||
final class DownloaderNoResultsEmbed: UINavigationController {
|
||||
|
||||
@objc(MWMDownloaderNoResultsScreen)
|
||||
enum Screen: Int {
|
||||
|
||||
case noMaps
|
||||
case noSearchResults
|
||||
}
|
||||
|
||||
@objc var screen = Screen.noMaps {
|
||||
didSet {
|
||||
let controller: MWMViewController
|
||||
switch screen {
|
||||
case .noMaps: controller = MWMNoMapsViewController.controller()
|
||||
case .noSearchResults: controller = SearchNoResultsViewController.controller
|
||||
}
|
||||
setViewControllers([controller], animated: false)
|
||||
}
|
||||
}
|
||||
}
|
||||
3
iphone/Maps/UI/Downloader/NoMaps/MWMNoMapsView.h
Normal file
3
iphone/Maps/UI/Downloader/NoMaps/MWMNoMapsView.h
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
@interface MWMNoMapsView : SolidTouchView
|
||||
|
||||
@end
|
||||
81
iphone/Maps/UI/Downloader/NoMaps/MWMNoMapsView.m
Normal file
81
iphone/Maps/UI/Downloader/NoMaps/MWMNoMapsView.m
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
#import "MWMNoMapsView.h"
|
||||
#import "MWMKeyboard.h"
|
||||
|
||||
@interface MWMNoMapsView ()<MWMKeyboardObserver>
|
||||
|
||||
@property(weak, nonatomic) IBOutlet UIImageView * image;
|
||||
@property(weak, nonatomic) IBOutlet UILabel * title;
|
||||
@property(weak, nonatomic) IBOutlet UILabel * text;
|
||||
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * containerWidth;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * containerHeight;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * containerTopOffset;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * containerBottomOffset;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * imageMinHeight;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * imageHeight;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * titleImageOffset;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * titleTopOffset;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * textTopOffset;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMNoMapsView
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[super awakeFromNib];
|
||||
if (!IPAD)
|
||||
{
|
||||
self.containerWidth.active = NO;
|
||||
self.containerHeight.active = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.containerTopOffset.active = NO;
|
||||
}
|
||||
[MWMKeyboard addObserver:self];
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
[self configForSize:self.frame.size];
|
||||
}
|
||||
|
||||
- (void)configForSize:(CGSize)size
|
||||
{
|
||||
CGSize iPadSize = CGSizeMake(520, 600);
|
||||
CGSize newSize = IPAD ? iPadSize : size;
|
||||
CGFloat width = newSize.width;
|
||||
CGFloat height = newSize.height;
|
||||
BOOL hideImage = (self.imageHeight.multiplier * height <= self.imageMinHeight.constant);
|
||||
if (hideImage)
|
||||
{
|
||||
self.titleImageOffset.priority = UILayoutPriorityDefaultLow;
|
||||
self.title.hidden = self.title.minY < self.titleTopOffset.constant;
|
||||
self.text.hidden = self.text.minY < self.textTopOffset.constant;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.titleImageOffset.priority = UILayoutPriorityDefaultHigh;
|
||||
self.title.hidden = NO;
|
||||
self.text.hidden = NO;
|
||||
}
|
||||
self.image.hidden = hideImage;
|
||||
if (IPAD)
|
||||
{
|
||||
self.containerWidth.constant = width;
|
||||
self.containerHeight.constant = height;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - MWMKeyboard
|
||||
|
||||
- (void)onKeyboardAnimation
|
||||
{
|
||||
self.containerBottomOffset.constant = [MWMKeyboard keyboardHeight];
|
||||
[self.superview layoutIfNeeded];
|
||||
}
|
||||
|
||||
- (void)onKeyboardWillAnimate { [self.superview layoutIfNeeded]; }
|
||||
@end
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#import "MWMViewController.h"
|
||||
|
||||
@interface MWMNoMapsViewController : MWMViewController
|
||||
|
||||
+ (MWMNoMapsViewController *)controller NS_SWIFT_NAME(controller());
|
||||
|
||||
@end
|
||||
19
iphone/Maps/UI/Downloader/NoMaps/MWMNoMapsViewController.mm
Normal file
19
iphone/Maps/UI/Downloader/NoMaps/MWMNoMapsViewController.mm
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#import "MWMNoMapsViewController.h"
|
||||
#import "MWMMapDownloaderMode.h"
|
||||
#import "MWMMapViewControlsManager.h"
|
||||
#import "SwiftBridge.h"
|
||||
|
||||
@implementation MWMNoMapsViewController
|
||||
|
||||
+ (MWMNoMapsViewController *)controller
|
||||
{
|
||||
auto storyboard = [UIStoryboard instance:MWMStoryboardMain];
|
||||
return [storyboard instantiateViewControllerWithIdentifier:[self className]];
|
||||
}
|
||||
|
||||
- (IBAction)downloadMaps
|
||||
{
|
||||
[[MWMMapViewControlsManager manager] actionDownloadMaps:MWMMapDownloaderModeAvailable];
|
||||
}
|
||||
|
||||
@end
|
||||
Loading…
Add table
Add a link
Reference in a new issue