[ios] Change search colors and layout.
|
@ -13,9 +13,9 @@
|
|||
@interface SearchBar : UIView
|
||||
|
||||
@property (nonatomic, readonly) UITextField * textField;
|
||||
@property (nonatomic, readonly) UIButton * clearButton;
|
||||
@property (nonatomic, readonly) UIButton * cancelButton;
|
||||
@property (nonatomic, readonly) SolidTouchImageView * fieldBackgroundView;
|
||||
@property (nonatomic, readonly) UIButton * clearButton;
|
||||
@property (nonatomic, readonly) SolidTouchView * fieldBackgroundView;
|
||||
|
||||
@property (nonatomic, weak) id <SearchBarDelegate> delegate;
|
||||
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
|
||||
#import "SearchBar.h"
|
||||
#import "Framework.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
||||
#import "../../../3party/Alohalytics/src/alohalytics_objc.h"
|
||||
|
||||
@interface SearchBar ()
|
||||
|
||||
@property (nonatomic) UITextField * textField;
|
||||
@property (nonatomic) UIButton * clearButton;
|
||||
@property (nonatomic) UIButton * cancelButton;
|
||||
@property (nonatomic) UIButton * clearButton;
|
||||
@property (nonatomic) UIImageView * spotImageView;
|
||||
@property (nonatomic) UIActivityIndicatorView * activity;
|
||||
@property (nonatomic) SolidTouchImageView * fieldBackgroundView;
|
||||
@property (nonatomic) SolidTouchView * fieldBackgroundView;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -24,7 +26,7 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
|
||||
[self addSubview:self.fieldBackgroundView];
|
||||
self.fieldBackgroundView.maxY = self.height - 12;
|
||||
self.fieldBackgroundView.minX = 12.5;
|
||||
self.fieldBackgroundView.minX = 8;
|
||||
|
||||
[self.fieldBackgroundView addSubview:self.spotImageView];
|
||||
self.spotImageView.center = CGPointMake(14, self.fieldBackgroundView.height / 2 - 1);
|
||||
|
@ -36,15 +38,15 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
self.clearButton.midX = self.fieldBackgroundView.width - 14;
|
||||
|
||||
self.cancelButton.midY = self.height / 2 - 5;
|
||||
self.cancelButton.maxX = self.width - 4;
|
||||
self.cancelButton.maxX = self.width - 8;
|
||||
[self addSubview:self.cancelButton];
|
||||
|
||||
[self addSubview:self.textField];
|
||||
self.textField.midY = self.height / 2 - 3;
|
||||
self.textField.minX = 44;
|
||||
self.textField.minX = 36.;
|
||||
|
||||
if ([self.textField respondsToSelector:@selector(setTintColor:)])
|
||||
self.textField.tintColor = [UIColor whiteColor];
|
||||
self.textField.tintColor = [UIColor blackHintText];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
@ -69,18 +71,11 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
[self.delegate searchBarDidPressCancelButton:self];
|
||||
}
|
||||
|
||||
- (void)clearButtonPressed:(id)sender
|
||||
- (void)clearButtonPressed
|
||||
{
|
||||
[self.delegate searchBarDidPressClearButton:self];
|
||||
}
|
||||
|
||||
- (void)hideSearchedText
|
||||
{
|
||||
[UIView animateWithDuration:0.4 delay:0 damping:0.8 initialVelocity:1 options:UIViewAnimationOptionCurveEaseInOut animations:^{
|
||||
self.clearButton.alpha = 0;
|
||||
} completion:nil];
|
||||
}
|
||||
|
||||
- (UIButton *)cancelButton
|
||||
{
|
||||
if (!_cancelButton)
|
||||
|
@ -101,26 +96,26 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
|
||||
- (UIButton *)clearButton
|
||||
{
|
||||
if (!_clearButton)
|
||||
if (!_clearButton)
|
||||
{
|
||||
_clearButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
|
||||
_clearButton.contentMode = UIViewContentModeCenter;
|
||||
_clearButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
|
||||
[_clearButton setImage:[UIImage imageNamed:@"SearchBarClearButton"] forState:UIControlStateNormal];
|
||||
[_clearButton addTarget:self action:@selector(clearButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_clearButton addTarget:self action:@selector(clearButtonPressed) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _clearButton;
|
||||
}
|
||||
|
||||
- (SolidTouchImageView *)fieldBackgroundView
|
||||
- (SolidTouchView *)fieldBackgroundView
|
||||
{
|
||||
if (!_fieldBackgroundView)
|
||||
{
|
||||
UIImage * image = [[UIImage imageNamed:@"SearchFieldBackground"] resizableImageWithCapInsets:UIEdgeInsetsMake(6, 6, 6, 6)];
|
||||
_fieldBackgroundView = [[SolidTouchImageView alloc] initWithFrame:CGRectMake(0, 0, 0, 27)];
|
||||
_fieldBackgroundView.image = image;
|
||||
_fieldBackgroundView = [[SolidTouchView alloc] initWithFrame:CGRectMake(0, 0, 0, 27)];
|
||||
_fieldBackgroundView.backgroundColor = [UIColor whiteColor];
|
||||
_fieldBackgroundView.userInteractionEnabled = YES;
|
||||
_fieldBackgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
_fieldBackgroundView.layer.cornerRadius = 4.;
|
||||
}
|
||||
return _fieldBackgroundView;
|
||||
}
|
||||
|
@ -129,10 +124,11 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
{
|
||||
if (!_textField)
|
||||
{
|
||||
_textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, self.width, 22)];
|
||||
_textField = [[UITextField alloc] initWithFrame:CGRectMake(1, 0, self.width, 22)];
|
||||
_textField.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
_textField.font = [UIFont fontWithName:@"HelveticaNeue" size:17.5];
|
||||
_textField.textColor = [UIColor whiteColor];
|
||||
_textField.font = [UIFont fontWithName:@"HelveticaNeue" size:16.];
|
||||
_textField.textColor = [UIColor blackPrimaryText];
|
||||
_textField.placeholder = L(@"search");
|
||||
_textField.returnKeyType = UIReturnKeySearch;
|
||||
_textField.autocorrectionType = UITextAutocorrectionTypeNo;
|
||||
_textField.enablesReturnKeyAutomatically = YES;
|
||||
|
@ -144,7 +140,7 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
{
|
||||
if (!_spotImageView)
|
||||
{
|
||||
_spotImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"SearchSpot"]];
|
||||
_spotImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ic_search"]];
|
||||
_spotImageView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
|
||||
}
|
||||
return _spotImageView;
|
||||
|
@ -154,7 +150,7 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
{
|
||||
if (!_activity)
|
||||
{
|
||||
_activity = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
|
||||
_activity = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
|
||||
_activity.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
|
||||
}
|
||||
return _activity;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
#import "SearchCategoryCell.h"
|
||||
#import "UIKitCategories.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
||||
@interface SearchCategoryCell ()
|
||||
|
||||
|
@ -18,10 +19,6 @@
|
|||
[self.contentView addSubview:self.titleLabel];
|
||||
[self.contentView addSubview:self.iconImageView];
|
||||
|
||||
UIView * selectedBackgroundView = [[UIView alloc] initWithFrame:self.bounds];
|
||||
selectedBackgroundView.backgroundColor = [UIColor colorWithColorCode:@"15d081"];
|
||||
self.selectedBackgroundView = selectedBackgroundView;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -29,12 +26,13 @@
|
|||
{
|
||||
[super layoutSubviews];
|
||||
|
||||
self.titleLabel.origin = CGPointMake(44, 8);
|
||||
CGFloat const offsetL = 56;
|
||||
self.titleLabel.origin = CGPointMake(offsetL, 8);
|
||||
self.titleLabel.width = self.width - self.titleLabel.minX - 20;
|
||||
self.titleLabel.center = CGPointMake(self.titleLabel.center.x, self.height / 2.);
|
||||
self.iconImageView.center = CGPointMake(self.iconImageView.center.x, self.titleLabel.center.y);
|
||||
|
||||
CGFloat const offsetL = 40;
|
||||
CGFloat const offsetR = 12.5;
|
||||
self.separatorView.width = self.width - offsetL - offsetR;
|
||||
self.separatorView.width = self.width - offsetL;
|
||||
self.separatorView.minX = offsetL;
|
||||
}
|
||||
|
||||
|
@ -50,8 +48,8 @@
|
|||
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 24)];
|
||||
_titleLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
|
||||
_titleLabel.backgroundColor = [UIColor clearColor];
|
||||
_titleLabel.textColor = [UIColor whiteColor];
|
||||
_titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:17.5];
|
||||
_titleLabel.textColor = [UIColor blackPrimaryText];
|
||||
_titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:16.];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
@ -60,7 +58,7 @@
|
|||
{
|
||||
if (!_iconImageView)
|
||||
{
|
||||
_iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(9, 9, 25, 25)];
|
||||
_iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(16, 9, 25, 25)];
|
||||
_iconImageView.contentMode = UIViewContentModeCenter;
|
||||
}
|
||||
return _iconImageView;
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
@interface SearchCell : UITableViewCell
|
||||
|
||||
@property (nonatomic) UIImageView * separatorView;
|
||||
@property (nonatomic) UIView * separatorView;
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
|
||||
#import "SearchCell.h"
|
||||
#import "UIKitCategories.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
||||
@implementation SearchCell
|
||||
|
||||
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleDefault;
|
||||
[self addSubview:self.separatorView];
|
||||
|
||||
UIImageView * selectedBackgroundView = [[UIImageView alloc] initWithFrame:self.bounds];
|
||||
selectedBackgroundView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.2];
|
||||
self.selectedBackgroundView = selectedBackgroundView;
|
||||
|
||||
UIView * selectedView = [[UIView alloc] initWithFrame:self.bounds];
|
||||
selectedView.backgroundColor = [UIColor pressBackground];
|
||||
self.selectedBackgroundView = selectedView;
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -26,12 +24,12 @@
|
|||
self.backgroundView.frame = self.bounds;
|
||||
}
|
||||
|
||||
- (UIImageView *)separatorView
|
||||
- (UIView *)separatorView
|
||||
{
|
||||
if (!_separatorView)
|
||||
{
|
||||
_separatorView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, 1)];
|
||||
_separatorView.image = [[UIImage imageNamed:@"SearchCellSeparator"] resizableImageWithCapInsets:UIEdgeInsetsZero];
|
||||
_separatorView.backgroundColor = [UIColor blackDividers];
|
||||
_separatorView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
}
|
||||
return _separatorView;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
|
||||
#import "SearchResultCell.h"
|
||||
#import "UIKitCategories.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
||||
static CGFloat const kOffset = 16.;
|
||||
|
||||
@interface SearchResultCell ()
|
||||
|
||||
|
@ -22,19 +25,14 @@
|
|||
[self.contentView addSubview:self.subtitleLabel];
|
||||
[self.contentView addSubview:self.distanceLabel];
|
||||
|
||||
UIView * selectedBackgroundView = [[UIView alloc] initWithFrame:self.bounds];
|
||||
selectedBackgroundView.backgroundColor = [UIColor colorWithColorCode:@"15d081"];
|
||||
self.selectedBackgroundView = selectedBackgroundView;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
#define DISTANCE_FONT [UIFont fontWithName:@"HelveticaNeue-Light" size:12.5]
|
||||
#define TYPE_FONT [UIFont fontWithName:@"HelveticaNeue-Light" size:12.5]
|
||||
#define TITLE_FONT [UIFont fontWithName:@"HelveticaNeue-Light" size:17]
|
||||
#define SUBTITLE_FONT [UIFont fontWithName:@"HelveticaNeue-Light" size:12.5]
|
||||
#define LEFT_SHIFT 20
|
||||
#define RIGHT_SHIFT 20
|
||||
#define DISTANCE_FONT [UIFont fontWithName:@"HelveticaNeue" size:14]
|
||||
#define TYPE_FONT [UIFont fontWithName:@"HelveticaNeue-Light" size:12]
|
||||
#define TITLE_FONT [UIFont fontWithName:@"HelveticaNeue" size:16]
|
||||
#define TITLE_BOLD_FONT [UIFont fontWithName:@"HelveticaNeue-Bold" size:16]
|
||||
#define SUBTITLE_FONT [UIFont fontWithName:@"HelveticaNeue-Light" size:12]
|
||||
#define SPACE 4
|
||||
|
||||
- (void)setTitle:(NSString *)title selectedRanges:(NSArray *)selectedRanges
|
||||
|
@ -64,7 +62,7 @@
|
|||
{
|
||||
static NSDictionary * selectedAttributes;
|
||||
if (!selectedAttributes)
|
||||
selectedAttributes = @{NSForegroundColorAttributeName : [UIColor colorWithColorCode:@"16b68a"], NSFontAttributeName : TITLE_FONT};
|
||||
selectedAttributes = @{NSForegroundColorAttributeName : [UIColor blackPrimaryText], NSFontAttributeName : TITLE_BOLD_FONT};
|
||||
return selectedAttributes;
|
||||
}
|
||||
|
||||
|
@ -72,7 +70,7 @@
|
|||
{
|
||||
static NSDictionary * unselectedAttributes;
|
||||
if (!unselectedAttributes)
|
||||
unselectedAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor], NSFontAttributeName : TITLE_FONT};
|
||||
unselectedAttributes = @{NSForegroundColorAttributeName : [UIColor blackPrimaryText], NSFontAttributeName : TITLE_FONT};
|
||||
return unselectedAttributes;
|
||||
}
|
||||
|
||||
|
@ -81,25 +79,24 @@
|
|||
[super layoutSubviews];
|
||||
|
||||
self.typeLabel.size = [[self class] typeSizeWithType:self.typeLabel.text];
|
||||
self.typeLabel.maxX = self.width - RIGHT_SHIFT;
|
||||
self.typeLabel.maxX = self.width - kOffset;
|
||||
self.typeLabel.minY = 9;
|
||||
|
||||
self.distanceLabel.width = 70;
|
||||
[self.distanceLabel sizeToIntegralFit];
|
||||
self.distanceLabel.maxX = self.width - RIGHT_SHIFT;
|
||||
self.distanceLabel.maxX = self.width - kOffset;
|
||||
self.distanceLabel.maxY = self.height - 8;
|
||||
|
||||
self.titleLabel.size = [[self class] titleSizeWithTitle:self.titleLabel.text viewWidth:self.width typeSize:self.typeLabel.size];
|
||||
self.titleLabel.minX = LEFT_SHIFT;
|
||||
self.titleLabel.minX = kOffset;
|
||||
self.titleLabel.minY = self.typeLabel.minY - 4;
|
||||
|
||||
self.subtitleLabel.size = CGSizeMake(self.width - self.distanceLabel.width - LEFT_SHIFT - RIGHT_SHIFT - SPACE, 16);
|
||||
self.subtitleLabel.minX = LEFT_SHIFT;
|
||||
self.subtitleLabel.size = CGSizeMake(self.width - self.distanceLabel.width - 2 * kOffset - SPACE, 16);
|
||||
self.subtitleLabel.minX = kOffset;
|
||||
self.subtitleLabel.maxY = self.distanceLabel.maxY;
|
||||
|
||||
CGFloat const offset = 12.5;
|
||||
self.separatorView.width = self.width - 2 * offset;
|
||||
self.separatorView.minX = offset;
|
||||
self.separatorView.width = self.width - kOffset;
|
||||
self.separatorView.minX = kOffset;
|
||||
}
|
||||
|
||||
+ (CGSize)typeSizeWithType:(NSString *)type
|
||||
|
@ -109,8 +106,8 @@
|
|||
|
||||
+ (CGSize)titleSizeWithTitle:(NSString *)title viewWidth:(CGFloat)width typeSize:(CGSize)typeSize
|
||||
{
|
||||
CGSize const titleDrawSize = CGSizeMake(width - typeSize.width - LEFT_SHIFT - RIGHT_SHIFT - SPACE, 300);
|
||||
return [title sizeWithDrawSize:titleDrawSize font:TITLE_FONT];
|
||||
CGSize const titleDrawSize = CGSizeMake(width - typeSize.width - 2 * kOffset - SPACE, 300);
|
||||
return [title sizeWithDrawSize:titleDrawSize font:TITLE_BOLD_FONT];
|
||||
}
|
||||
|
||||
+ (CGFloat)cellHeightWithTitle:(NSString *)title type:(NSString *)type subtitle:(NSString *)subtitle distance:(NSString *)distance viewWidth:(CGFloat)width
|
||||
|
@ -127,7 +124,7 @@
|
|||
_typeLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
|
||||
_typeLabel.font = TYPE_FONT;
|
||||
_typeLabel.backgroundColor = [UIColor clearColor];
|
||||
_typeLabel.textColor = [UIColor colorWithColorCode:@"c9c9c9"];
|
||||
_typeLabel.textColor = [UIColor blackSecondaryText];
|
||||
_typeLabel.textAlignment = NSTextAlignmentRight;
|
||||
}
|
||||
return _typeLabel;
|
||||
|
@ -139,7 +136,7 @@
|
|||
{
|
||||
_distanceLabel = [[UILabel alloc] initWithFrame:CGRectZero];
|
||||
_distanceLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
|
||||
_distanceLabel.textColor = [UIColor colorWithColorCode:@"c9c9c9"];
|
||||
_distanceLabel.textColor = [UIColor blackPrimaryText];
|
||||
_distanceLabel.backgroundColor = [UIColor clearColor];
|
||||
_distanceLabel.font = DISTANCE_FONT;
|
||||
_distanceLabel.textAlignment = NSTextAlignmentRight;
|
||||
|
@ -153,7 +150,7 @@
|
|||
{
|
||||
_subtitleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
|
||||
_subtitleLabel.backgroundColor = [UIColor clearColor];
|
||||
_subtitleLabel.textColor = [UIColor whiteColor];
|
||||
_subtitleLabel.textColor = [UIColor blackSecondaryText];
|
||||
_subtitleLabel.font = SUBTITLE_FONT;
|
||||
}
|
||||
return _subtitleLabel;
|
||||
|
@ -170,7 +167,7 @@
|
|||
if (![_titleLabel respondsToSelector:@selector(setAttributedText:)])
|
||||
{
|
||||
_titleLabel.font = TITLE_FONT;
|
||||
_titleLabel.textColor = [UIColor whiteColor];
|
||||
_titleLabel.textColor = [UIColor blackPrimaryText];
|
||||
}
|
||||
}
|
||||
return _titleLabel;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
|
||||
#import "SearchShowOnMapCell.h"
|
||||
#import "UIKitCategories.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
||||
static CGFloat const kOffset = 16.;
|
||||
|
||||
@interface SearchShowOnMapCell ()
|
||||
|
||||
|
@ -13,14 +16,8 @@
|
|||
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
|
||||
UIView * backgroundView = [[UIView alloc] initWithFrame:self.bounds];
|
||||
backgroundView.backgroundColor = [UIColor colorWithColorCode:@"1f9f7e"];
|
||||
self.backgroundView = backgroundView;
|
||||
|
||||
self.separatorView.hidden = YES;
|
||||
if (self)
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
@ -28,7 +25,11 @@
|
|||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
self.titleLabel.width = self.width - self.titleLabel.minX - 20;
|
||||
self.titleLabel.width = self.width - self.titleLabel.minX - kOffset;
|
||||
self.titleLabel.minX = kOffset;
|
||||
self.separatorView.width = self.width;
|
||||
self.separatorView.minX = 0;
|
||||
self.separatorView.minY = self.height - 1;
|
||||
}
|
||||
|
||||
+ (CGFloat)cellHeight
|
||||
|
@ -40,11 +41,11 @@
|
|||
{
|
||||
if (!_titleLabel)
|
||||
{
|
||||
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, INTEGRAL(8.5), 0, 24)];
|
||||
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kOffset, INTEGRAL(8.5), 0, 24)];
|
||||
_titleLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
|
||||
_titleLabel.backgroundColor = [UIColor clearColor];
|
||||
_titleLabel.textColor = [UIColor whiteColor];
|
||||
_titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:17.5];
|
||||
_titleLabel.textColor = [UIColor primary];
|
||||
_titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:16.];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
#import "SearchSuggestCell.h"
|
||||
#import "UIKitCategories.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
||||
@interface SearchSuggestCell ()
|
||||
|
||||
|
@ -17,11 +18,6 @@
|
|||
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
[self.contentView addSubview:self.iconImageView];
|
||||
|
||||
UIView * backgroundView = [[UIView alloc] initWithFrame:self.bounds];
|
||||
backgroundView.backgroundColor = [UIColor colorWithColorCode:@"1f9f7e"];
|
||||
self.backgroundView = backgroundView;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -29,12 +25,15 @@
|
|||
{
|
||||
[super layoutSubviews];
|
||||
|
||||
self.titleLabel.width = self.width - self.titleLabel.minX - 20;
|
||||
self.titleLabel.minX = self.iconImageView.minX + self.iconImageView.width + 5;
|
||||
CGFloat const offset = 34.;
|
||||
self.titleLabel.minX = offset;
|
||||
self.titleLabel.width = self.width - self.titleLabel.minX - offset;
|
||||
self.titleLabel.center = CGPointMake(self.titleLabel.center.x, self.height / 2.);
|
||||
self.iconImageView.center = CGPointMake(self.iconImageView.center.x, self.titleLabel.center.y);
|
||||
|
||||
|
||||
CGFloat const offset = 12.5;
|
||||
self.separatorView.width = self.width - 2 * offset;
|
||||
self.separatorView.minX = offset;
|
||||
self.separatorView.width = self.width - 16.;
|
||||
self.separatorView.minX = 16.;
|
||||
}
|
||||
|
||||
+ (CGFloat)cellHeight
|
||||
|
@ -46,11 +45,11 @@
|
|||
{
|
||||
if (!_titleLabel)
|
||||
{
|
||||
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(44, INTEGRAL(8.5), 0, 24)];
|
||||
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0., INTEGRAL(8.5), 0, 24)];
|
||||
_titleLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
|
||||
_titleLabel.backgroundColor = [UIColor clearColor];
|
||||
_titleLabel.textColor = [UIColor whiteColor];
|
||||
_titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:17.5];
|
||||
_titleLabel.textColor = [UIColor primary];
|
||||
_titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:16.];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
@ -59,7 +58,8 @@
|
|||
{
|
||||
if (!_iconImageView)
|
||||
{
|
||||
_iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(16, 12, 20, 20)];
|
||||
_iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(16, 14, 12, 12)];
|
||||
_iconImageView.image = [UIImage imageNamed:@"ic_suggest"];
|
||||
_iconImageView.contentMode = UIViewContentModeCenter;
|
||||
}
|
||||
return _iconImageView;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#import "Statistics.h"
|
||||
#import "ToastView.h"
|
||||
#import "UIKitCategories.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
||||
#include "Framework.h"
|
||||
|
||||
|
@ -174,7 +175,7 @@ static BOOL keyboardLoaded = NO;
|
|||
|
||||
CGFloat const cancelButtonMinX = (state == SearchViewStateResults) ? self.searchBar.width - 4 : self.searchBar.cancelButton.minX;
|
||||
CGFloat const textFieldBackgroundWidth = cancelButtonMinX - self.searchBar.fieldBackgroundView.minX - 8;
|
||||
CGFloat const textFieldWidth = textFieldBackgroundWidth - 60;
|
||||
CGFloat const textFieldWidth = textFieldBackgroundWidth - 60.;
|
||||
|
||||
LocationManager const * const locationManager = [MapsAppDelegate theApp].m_locationManager;
|
||||
if (state == SearchViewStateFullscreen)
|
||||
|
@ -586,7 +587,6 @@ static BOOL keyboardLoaded = NO;
|
|||
search::Result const & result = [self.wrapper resultWithPosition:position];
|
||||
|
||||
customCell.titleLabel.text = [NSString stringWithUTF8String:result.GetString()];
|
||||
customCell.iconImageView.image = [UIImage imageNamed:@"SearchSpot"];
|
||||
cell = customCell;
|
||||
break;
|
||||
}
|
||||
|
@ -723,19 +723,19 @@ static BOOL keyboardLoaded = NO;
|
|||
@"food",
|
||||
@"hotel",
|
||||
@"tourism",
|
||||
@"wifi",
|
||||
@"transport",
|
||||
@"fuel",
|
||||
@"parking",
|
||||
@"shop",
|
||||
@"entertainment",
|
||||
@"atm",
|
||||
@"bank",
|
||||
@"wifi",
|
||||
@"parking",
|
||||
@"toilet",
|
||||
@"pharmacy",
|
||||
@"entertainment",
|
||||
@"hospital",
|
||||
@"post",
|
||||
@"police"];
|
||||
@"pharmacy",
|
||||
@"police",
|
||||
@"toilet",
|
||||
@"post"];
|
||||
return _categoriesNames;
|
||||
}
|
||||
|
||||
|
@ -752,7 +752,7 @@ static BOOL keyboardLoaded = NO;
|
|||
_tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.backgroundColor = [UIColor colorWithColorCode:@"1D1F29"];
|
||||
_tableView.backgroundColor = [UIColor whiteColor];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
}
|
||||
return _tableView;
|
||||
|
@ -790,9 +790,9 @@ static BOOL keyboardLoaded = NO;
|
|||
{
|
||||
_emptyResultLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, 60)];
|
||||
_emptyResultLabel.backgroundColor = [UIColor clearColor];
|
||||
_emptyResultLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:18];
|
||||
_emptyResultLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:16];
|
||||
_emptyResultLabel.text = L(@"no_search_results_found");
|
||||
_emptyResultLabel.textColor = [UIColor whiteColor];
|
||||
_emptyResultLabel.textColor = [UIColor primary];
|
||||
_emptyResultLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
_emptyResultLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 578 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 648 B |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.6 KiB |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconAtm.imageset/CategoryIconAtm.png
vendored
Normal file
After Width: | Height: | Size: 257 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconAtm.imageset/CategoryIconAtm@2x.png
vendored
Normal file
After Width: | Height: | Size: 413 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconAtm.imageset/CategoryIconAtm@3x.png
vendored
Normal file
After Width: | Height: | Size: 570 B |
|
@ -13,7 +13,7 @@
|
|||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "atm_xxhdpi.png"
|
||||
"filename" : "CategoryIconAtm@3x.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconBank.imageset/CategoryIconBank.png
vendored
Normal file
After Width: | Height: | Size: 433 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconBank.imageset/CategoryIconBank@2x.png
vendored
Normal file
After Width: | Height: | Size: 780 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconBank.imageset/CategoryIconBank@3x.png
vendored
Normal file
After Width: | Height: | Size: 1.1 KiB |
|
@ -13,7 +13,7 @@
|
|||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "bank_xxhdpi.png"
|
||||
"filename" : "CategoryIconBank@3x.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconEntertainment.imageset/CategoryIconEntertainment.png
vendored
Normal file
After Width: | Height: | Size: 388 B |
After Width: | Height: | Size: 654 B |
After Width: | Height: | Size: 888 B |
|
@ -13,7 +13,7 @@
|
|||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "entertainment_xxhdpi.png"
|
||||
"filename" : "CategoryIconEntertainment@3x.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconFood.imageset/CategoryIconFood.png
vendored
Normal file
After Width: | Height: | Size: 413 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconFood.imageset/CategoryIconFood@2x.png
vendored
Normal file
After Width: | Height: | Size: 760 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconFood.imageset/CategoryIconFood@3x.png
vendored
Normal file
After Width: | Height: | Size: 907 B |
|
@ -13,7 +13,7 @@
|
|||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "food_xxhdpi.png"
|
||||
"filename" : "CategoryIconFood@3x.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconFuel.imageset/CategoryIconFuel.png
vendored
Normal file
After Width: | Height: | Size: 353 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconFuel.imageset/CategoryIconFuel@2x.png
vendored
Normal file
After Width: | Height: | Size: 541 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconFuel.imageset/CategoryIconFuel@3x.png
vendored
Normal file
After Width: | Height: | Size: 727 B |
|
@ -13,7 +13,7 @@
|
|||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "fuel_xxhdpi.png"
|
||||
"filename" : "CategoryIconFuel@3x.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconHospital.imageset/CategoryIconHospital.png
vendored
Normal file
After Width: | Height: | Size: 238 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconHospital.imageset/CategoryIconHospital@2x.png
vendored
Normal file
After Width: | Height: | Size: 227 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconHospital.imageset/CategoryIconHospital@3x.png
vendored
Normal file
After Width: | Height: | Size: 288 B |
|
@ -13,7 +13,7 @@
|
|||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "hospital_xxhdpi.png"
|
||||
"filename" : "CategoryIconHospital@3x.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconHotel.imageset/CategoryIconHotel.png
vendored
Normal file
After Width: | Height: | Size: 333 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconHotel.imageset/CategoryIconHotel@2x.png
vendored
Normal file
After Width: | Height: | Size: 529 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconHotel.imageset/CategoryIconHotel@3x.png
vendored
Normal file
After Width: | Height: | Size: 742 B |
|
@ -13,7 +13,7 @@
|
|||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "hotel_xxhdpi.png"
|
||||
"filename" : "CategoryIconHotel@3x.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconParking.imageset/CategoryIconParking.png
vendored
Normal file
After Width: | Height: | Size: 303 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconParking.imageset/CategoryIconParking@2x.png
vendored
Normal file
After Width: | Height: | Size: 512 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconParking.imageset/CategoryIconParking@3x.png
vendored
Normal file
After Width: | Height: | Size: 700 B |
|
@ -13,7 +13,7 @@
|
|||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "parking_xxhdpi.png"
|
||||
"filename" : "CategoryIconParking@3x.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconPharmacy.imageset/CategoryIconPharmacy.png
vendored
Normal file
After Width: | Height: | Size: 200 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconPharmacy.imageset/CategoryIconPharmacy@2x.png
vendored
Normal file
After Width: | Height: | Size: 282 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconPharmacy.imageset/CategoryIconPharmacy@3x.png
vendored
Normal file
After Width: | Height: | Size: 321 B |
|
@ -13,7 +13,7 @@
|
|||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "pharmacy_xxhdpi.png"
|
||||
"filename" : "CategoryIconPharmacy@3x.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconPolice.imageset/CategoryIconPolice.png
vendored
Normal file
After Width: | Height: | Size: 414 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconPolice.imageset/CategoryIconPolice@2x.png
vendored
Normal file
After Width: | Height: | Size: 710 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconPolice.imageset/CategoryIconPolice@3x.png
vendored
Normal file
After Width: | Height: | Size: 980 B |
|
@ -13,7 +13,7 @@
|
|||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x",
|
||||
"filename" : "police_xxhdpi.png"
|
||||
"filename" : "CategoryIconPolice@3x.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconPost.imageset/CategoryIconPost.png
vendored
Normal file
After Width: | Height: | Size: 388 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconPost.imageset/CategoryIconPost@2x.png
vendored
Normal file
After Width: | Height: | Size: 671 B |
BIN
iphone/Maps/Images.xcassets/Search/CategoryIconPost.imageset/CategoryIconPost@3x.png
vendored
Normal file
After Width: | Height: | Size: 928 B |