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

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Yershov <syershov@maps.me>2016-11-29 18:29:24 +0300
committerGitHub <noreply@github.com>2016-11-29 18:29:24 +0300
commit70871724edcb0a50dde550512310fda1a370566f (patch)
tree030fdc036cd54529371f353721e7502defe876db
parentb629151b2588085b0df5d851c878e7beb7679605 (diff)
parent74978ec8692daceabf43437614b945a3f7d86011 (diff)
Merge pull request #4834 from igrechuhin/cleanupbeta-506
[ios] Fixed traffic button offset.
-rw-r--r--iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm4
-rw-r--r--iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm5
-rw-r--r--iphone/Maps/Classes/Search/MWMSearch.mm3
-rw-r--r--iphone/Maps/Classes/ToastView.h9
-rw-r--r--iphone/Maps/Classes/ToastView.mm90
-rw-r--r--iphone/Maps/Maps.xcodeproj/project.pbxproj7
6 files changed, 6 insertions, 112 deletions
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm
index 23c31a1238..271b635111 100644
--- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm
+++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm
@@ -493,7 +493,9 @@ typedef NS_ENUM(NSUInteger, MWMSearchManagerActionBarState) {
[parentView addSubview:actionBarView];
[parentView addSubview:contentView];
[self layoutTopViews];
- [[MWMMapViewControlsManager manager] searchFrameUpdated:self.searchBarView.frame];
+ CGRect searchAndStatusBarFrame = self.searchBarView.frame;
+ searchAndStatusBarFrame.size.height += statusBarHeight();
+ [[MWMMapViewControlsManager manager] searchFrameUpdated:searchAndStatusBarFrame];
}
[UIView animateWithDuration:kDefaultAnimationDuration
animations:^{
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm
index 30bf0dd260..a58b593570 100644
--- a/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm
+++ b/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm
@@ -14,7 +14,8 @@ typedef NS_ENUM(NSUInteger, MWMTrafficButtonState) {
namespace
{
-CGFloat const kTopOffset = 16;
+CGFloat const kTopOffset = 26;
+CGFloat const kTopShiftedOffset = 6;
} // namespace
@interface MWMMapViewControlsManager ()
@@ -118,7 +119,7 @@ CGFloat const kTopOffset = 16;
- (void)refreshLayout
{
runAsyncOnMainQueue(^{
- CGFloat const topOffset = self.topBound + kTopOffset;
+ CGFloat const topOffset = self.topBound > 0 ? self.topBound + kTopShiftedOffset : kTopOffset;
CGFloat const leftOffset =
self.hidden ? -self.view.width : self.leftBound + kViewControlsOffsetToBounds;
UIView * ov = self.view.superview;
diff --git a/iphone/Maps/Classes/Search/MWMSearch.mm b/iphone/Maps/Classes/Search/MWMSearch.mm
index c75e6d432e..c32d8ac5cb 100644
--- a/iphone/Maps/Classes/Search/MWMSearch.mm
+++ b/iphone/Maps/Classes/Search/MWMSearch.mm
@@ -4,7 +4,6 @@
#import "MWMAlertViewController.h"
#import "MWMLocationManager.h"
#import "MWMSearchHotelsFilterViewController.h"
-#import "ToastView.h"
#include "Framework.h"
@@ -275,8 +274,6 @@ using TObservers = NSHashTable<__kindof TObserver>;
- (void)onSearchCompleted
{
- if (self.searchOnMap && m_results.GetCount() == 0)
- [[[ToastView alloc] initWithMessage:L(@"search_not_found_query")] show];
for (TObserver observer in self.observers)
{
if ([observer respondsToSelector:@selector(onSearchCompleted)])
diff --git a/iphone/Maps/Classes/ToastView.h b/iphone/Maps/Classes/ToastView.h
deleted file mode 100644
index 5377c7d772..0000000000
--- a/iphone/Maps/Classes/ToastView.h
+++ /dev/null
@@ -1,9 +0,0 @@
-
-#import <UIKit/UIKit.h>
-
-@interface ToastView : UIView
-
-- (instancetype)initWithMessage:(NSString *)message;
-- (void)show;
-
-@end
diff --git a/iphone/Maps/Classes/ToastView.mm b/iphone/Maps/Classes/ToastView.mm
deleted file mode 100644
index d883618afe..0000000000
--- a/iphone/Maps/Classes/ToastView.mm
+++ /dev/null
@@ -1,90 +0,0 @@
-#import "NSString+Categories.h"
-#import "ToastView.h"
-#import "UIColor+MapsMeColor.h"
-
-@interface ToastView ()
-
-@property (nonatomic) UILabel * messageLabel;
-@property (nonatomic) NSTimer * timer;
-
-@end
-
-@implementation ToastView
-
-- (id)initWithMessage:(NSString *)message
-{
- CGFloat const xOffset = 18;
- CGFloat const yOffset = 12;
- CGSize textSize = [message sizeWithDrawSize:CGSizeMake(245 - 2 * xOffset, 1000) font:self.messageLabel.font];
-
- self = [super initWithFrame:CGRectMake(0, 0, textSize.width + 2 * xOffset, textSize.height + 2 * yOffset)];
- self.backgroundColor = [UIColor pressBackground];
- self.layer.cornerRadius = 4;
- self.layer.masksToBounds = NO;
- self.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin;
-
- [self addSubview:self.messageLabel];
- self.messageLabel.frame = CGRectMake(xOffset, yOffset - 1, textSize.width, textSize.height);
- self.messageLabel.text = message;
-
- UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)];
- [self addGestureRecognizer:tap];
-
- return self;
-}
-
-- (UILabel *)messageLabel
-{
- if (!_messageLabel)
- {
- _messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
- _messageLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:12.5];
- _messageLabel.textAlignment = NSTextAlignmentCenter;
- _messageLabel.textColor = [UIColor blackPrimaryText];
- _messageLabel.numberOfLines = 0;
- _messageLabel.lineBreakMode = NSLineBreakByWordWrapping;
- }
- return _messageLabel;
-}
-
-- (void)tap:(UITapGestureRecognizer *)sender
-{
- [self hide];
-}
-
-- (void)timerSel:(id)sender
-{
- [self hide];
-}
-
-- (void)hide
-{
- [UIView animateWithDuration:0.3 animations:^{
- self.alpha = 0;
- } completion:^(BOOL finished){
- [self removeFromSuperview];
- }];
-}
-
-- (void)show
-{
- UIWindow * mainWindow = [[UIApplication sharedApplication].windows firstObject];
- UIWindow * window = [[mainWindow subviews] firstObject];
- [window addSubview:self];
-
- self.midX = window.width / 2;
- self.maxY = window.height - 68;
- self.alpha = 0;
- [UIView animateWithDuration:0.3 animations:^{
- self.alpha = 1;
- }];
-
- self.timer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(timerSel:) userInfo:nil repeats:NO];
-}
-
-- (void)dealloc
-{
- [self.timer invalidate];
-}
-
-@end
diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj
index 4bb8837e34..9771dae305 100644
--- a/iphone/Maps/Maps.xcodeproj/project.pbxproj
+++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj
@@ -534,7 +534,6 @@
6741A9C01BF340DE002C974C /* MWMTextView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6588E2B1B15C26700EE1E58 /* MWMTextView.mm */; };
6741A9C31BF340DE002C974C /* MWMPlacePageActionBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6CB21671AEFC6AA00FB8963 /* MWMPlacePageActionBar.mm */; };
6741A9C61BF340DE002C974C /* MWMSearchCommonCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B82ADC1B84A4A000180497 /* MWMSearchCommonCell.mm */; };
- 6741A9C91BF340DE002C974C /* ToastView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 974386DC19373EA400FD5659 /* ToastView.mm */; };
6741A9CB1BF340DE002C974C /* MWMSearchContentView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3438CDFB1B862F5C0051AA78 /* MWMSearchContentView.mm */; };
6741A9CC1BF340DE002C974C /* MWMSearchTableViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3485C0101B85C20E00F7712D /* MWMSearchTableViewController.mm */; };
6741A9CE1BF340DE002C974C /* MWMSearchManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34CFFE8A1B7DE6FD009D0C9F /* MWMSearchManager.mm */; };
@@ -1900,8 +1899,6 @@
84DBC4C21D81B1B100CC1804 /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Localizable.strings"; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* MAPSME.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = MAPSME.plist; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
972CDCC51887F1B7006641CA /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
- 974386DB19373EA400FD5659 /* ToastView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToastView.h; sourceTree = "<group>"; };
- 974386DC19373EA400FD5659 /* ToastView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ToastView.mm; sourceTree = "<group>"; };
9747264118323080006B7CB7 /* UIKitCategories.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = UIKitCategories.mm; path = Categories/UIKitCategories.mm; sourceTree = "<group>"; };
9747264218323080006B7CB7 /* UIKitCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIKitCategories.h; path = Categories/UIKitCategories.h; sourceTree = "<group>"; };
9747278218338F0C006B7CB7 /* UIViewController+Navigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+Navigation.h"; path = "Classes/UIViewController+Navigation.h"; sourceTree = "<group>"; };
@@ -3359,8 +3356,6 @@
34EB84501C0738D30004689F /* Editor */,
349A35741B53D4C9009677EE /* CircularProgress */,
34BC72091B0DECAE0012A34B /* MapViewControls */,
- 974386DB19373EA400FD5659 /* ToastView.h */,
- 974386DC19373EA400FD5659 /* ToastView.mm */,
ED48BBB317C267F5003E7E92 /* ColorPickerView.h */,
ED48BBB417C267F5003E7E92 /* ColorPickerView.mm */,
ED48BBB817C2B1E2003E7E92 /* CircleView.h */,
@@ -4689,7 +4684,6 @@
340C20E31C3E565600111D22 /* MWMCuisineEditorViewController.mm in Sources */,
3499C6861D51D3A600A1048A /* UIButton+Orientation.mm in Sources */,
34B82ADE1B84A4A000180497 /* MWMSearchCommonCell.mm in Sources */,
- 974386DD19373EA400FD5659 /* ToastView.mm in Sources */,
34BBB71E1DD07A4B0002E025 /* MWMSearchManager+Filter.mm in Sources */,
347FD8771C60B2CE002FB65E /* MWMOpeningHoursDaysSelectorTableViewCell.mm in Sources */,
342EE4111C43DAA7009F6A49 /* MWMAuthorizationWebViewLoginViewController.mm in Sources */,
@@ -4938,7 +4932,6 @@
34E273261C73876500463965 /* MWMMigrationView.mm in Sources */,
340C20E41C3E565600111D22 /* MWMCuisineEditorViewController.mm in Sources */,
F653CE191C71F62700A453F1 /* MWMAddPlaceNavigationBar.mm in Sources */,
- 6741A9C91BF340DE002C974C /* ToastView.mm in Sources */,
3499C6871D51D3A700A1048A /* UIButton+Orientation.mm in Sources */,
6741A9CB1BF340DE002C974C /* MWMSearchContentView.mm in Sources */,
34BBB71F1DD07A4B0002E025 /* MWMSearchManager+Filter.mm in Sources */,