forked from organicmaps/organicmaps
[ios] Bug fixies
This commit is contained in:
parent
cedd6b9fba
commit
04702abbe9
10 changed files with 53 additions and 61 deletions
|
@ -24,8 +24,6 @@
|
|||
[self.contentView addSubview:self.iconImageView];
|
||||
[self.contentView addSubview:self.separator];
|
||||
|
||||
self.titleLabel.textColor = [UIColor whiteColor];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -43,7 +41,7 @@
|
|||
self.separator.width = self.width - 2 * shift;
|
||||
self.separator.maxY = self.height;
|
||||
|
||||
self.titleLabel.frame = CGRectMake(53, -1.5, self.width - 70, self.height);
|
||||
self.titleLabel.frame = CGRectMake(53, -2, self.width - 70, self.height);
|
||||
self.iconImageView.origin = CGPointMake(11, 4.5);
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,6 @@
|
|||
if (!_swipeView)
|
||||
{
|
||||
_swipeView = [[SolidTouchView alloc] initWithFrame:CGRectZero];
|
||||
_swipeView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
|
||||
|
||||
UISwipeGestureRecognizer * swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipe:)];
|
||||
[_swipeView addGestureRecognizer:swipe];
|
||||
|
|
|
@ -815,21 +815,21 @@ const long long LITE_IDL = 431183278L;
|
|||
{
|
||||
SelectSetVC * vc = [[SelectSetVC alloc] initWithBookmarkAndCategory:bookmarkAndCategory];
|
||||
vc.delegate = self;
|
||||
[self pushViewController:vc];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
else if ([propertyName isEqualToString:@"Description"])
|
||||
{
|
||||
BookmarkDescriptionVC * vc = [self.mainStoryboard instantiateViewControllerWithIdentifier:[BookmarkDescriptionVC className]];
|
||||
vc.delegate = self;
|
||||
vc.bookmarkAndCategory = bookmarkAndCategory;
|
||||
[self pushViewController:vc];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
else if ([propertyName isEqualToString:@"Name"])
|
||||
{
|
||||
BookmarkNameVC * vc = [self.mainStoryboard instantiateViewControllerWithIdentifier:[BookmarkNameVC className]];
|
||||
vc.delegate = self;
|
||||
vc.bookmarkAndCategory = bookmarkAndCategory;
|
||||
[self pushViewController:vc];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1095,26 +1095,6 @@ NSInteger compareAddress(id l, id r, void * context)
|
|||
f.Invalidate();
|
||||
}
|
||||
|
||||
- (void)pushViewController:(UIViewController *)vc
|
||||
{
|
||||
if (IPAD)
|
||||
{
|
||||
NavigationController * navC = [[NavigationController alloc] init];
|
||||
self.popoverVC = [[UIPopoverController alloc] initWithContentViewController:navC];
|
||||
self.popoverVC.delegate = self;
|
||||
|
||||
[navC pushViewController:vc animated:YES];
|
||||
navC.navigationBar.barStyle = UIBarStyleBlack;
|
||||
|
||||
[self.popoverVC setPopoverContentSize:CGSizeMake(320, 480)];
|
||||
[self showPopover];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showAppStoreRatingMenu
|
||||
{
|
||||
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@"App Store"
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
|
||||
|
@ -52,6 +51,7 @@
|
|||
self.titleLabel.origin = CGPointMake(LEFT_SHIFT, 10);
|
||||
|
||||
self.selectedBackgroundView.frame = self.bounds;
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
@property (nonatomic) CopyLabel * addressLabel;
|
||||
@property (nonatomic) CopyLabel * coordinatesLabel;
|
||||
@property (nonatomic) SmallCompassView * compassView;
|
||||
@property (nonatomic) UIImageView * separator;
|
||||
@property (nonatomic) UIImageView * separatorView;
|
||||
@property (nonatomic) SelectedColorView * selectedColorView;
|
||||
|
||||
@property (nonatomic) m2::PointD pinPoint;
|
||||
|
@ -28,22 +28,13 @@
|
|||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
|
||||
[self addSubview:self.compassView];
|
||||
[self addSubview:self.distanceLabel];
|
||||
[self addSubview:self.addressLabel];
|
||||
[self addSubview:self.coordinatesLabel];
|
||||
[self addSubview:self.selectedColorView];
|
||||
|
||||
UIImage * separatorImage = [[UIImage imageNamed:@"PlacePageSeparator"] resizableImageWithCapInsets:UIEdgeInsetsZero];
|
||||
CGFloat const offset = 15;
|
||||
UIImageView * separator = [[UIImageView alloc] initWithFrame:CGRectMake(offset, self.height - separatorImage.size.height, self.width - 2 * offset, separatorImage.size.height)];
|
||||
separator.image = separatorImage;
|
||||
separator.maxY = self.height;
|
||||
separator.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
|
||||
[self addSubview:separator];
|
||||
self.separator = separator;
|
||||
[self addSubview:self.separatorView];
|
||||
|
||||
[[MapsAppDelegate theApp].m_locationManager start:self];
|
||||
|
||||
|
@ -107,12 +98,11 @@
|
|||
[self.selectedColorView setColor:color];
|
||||
}
|
||||
|
||||
#define ADDRESS_LEFT_SHIFT 19
|
||||
#define RIGHT_SHIFT 55
|
||||
|
||||
#define DISTANCE_LEFT_SHIFT 55
|
||||
|
||||
#define ADDRESS_FONT [UIFont fontWithName:@"HelveticaNeue-Light" size:17.5]
|
||||
#define ADDRESS_LEFT_SHIFT 19
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
|
@ -131,7 +121,6 @@
|
|||
self.distanceLabel.hidden = YES;
|
||||
addressY = 15;
|
||||
}
|
||||
|
||||
self.addressLabel.width = self.width - ADDRESS_LEFT_SHIFT - RIGHT_SHIFT;
|
||||
[self.addressLabel sizeToFit];
|
||||
self.addressLabel.origin = CGPointMake(ADDRESS_LEFT_SHIFT, addressY);
|
||||
|
@ -139,6 +128,13 @@
|
|||
self.coordinatesLabel.frame = CGRectMake(ADDRESS_LEFT_SHIFT, self.addressLabel.maxY + 10, self.width - ADDRESS_LEFT_SHIFT - RIGHT_SHIFT, 24);
|
||||
|
||||
self.selectedColorView.center = CGPointMake(self.width - 32, 27);
|
||||
|
||||
self.separatorView.maxY = self.height;
|
||||
CGFloat const shift = 15;
|
||||
self.separatorView.width = self.width - 2 * shift;
|
||||
self.separatorView.minX = shift;
|
||||
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
|
||||
+ (CGFloat)cellHeightWithAddress:(NSString *)address viewWidth:(CGFloat)viewWidth
|
||||
|
@ -162,6 +158,17 @@
|
|||
[self.delegate infoCellDidPressColorSelector:self];
|
||||
}
|
||||
|
||||
- (UIImageView *)separatorView
|
||||
{
|
||||
if (!_separatorView)
|
||||
{
|
||||
_separatorView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, 1)];
|
||||
_separatorView.image = [[UIImage imageNamed:@"PlacePageSeparator"] resizableImageWithCapInsets:UIEdgeInsetsZero];
|
||||
_separatorView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
}
|
||||
return _separatorView;
|
||||
}
|
||||
|
||||
- (UILabel *)distanceLabel
|
||||
{
|
||||
if (!_distanceLabel)
|
||||
|
@ -183,6 +190,8 @@
|
|||
_addressLabel = [[CopyLabel alloc] initWithFrame:CGRectZero];
|
||||
_addressLabel.backgroundColor = [UIColor clearColor];
|
||||
_addressLabel.font = ADDRESS_FONT;
|
||||
_addressLabel.numberOfLines = 0;
|
||||
_addressLabel.lineBreakMode = NSLineBreakByWordWrapping;
|
||||
_addressLabel.textAlignment = NSTextAlignmentLeft;
|
||||
_addressLabel.textColor = [UIColor whiteColor];
|
||||
_addressLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
|
||||
|
|
|
@ -14,11 +14,10 @@
|
|||
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
|
||||
[self.contentView addSubview:self.shareButton];
|
||||
[self.contentView addSubview:self.apiButton];
|
||||
[self addSubview:self.shareButton];
|
||||
[self addSubview:self.apiButton];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
@ -41,6 +40,7 @@
|
|||
self.shareButton.frame = CGRectMake(xOffset, yOffset, self.width - 2 * xOffset, height);
|
||||
self.apiButton.hidden = YES;
|
||||
}
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
|
||||
+ (CGFloat)cellHeight
|
||||
|
|
|
@ -247,6 +247,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
{
|
||||
_state = state;
|
||||
[self updateBookmarkStateAnimated:NO];
|
||||
[self updateBookmarkViewsAlpha:animated];
|
||||
[self.tableView reloadData];
|
||||
[self reloadHeader];
|
||||
[self alignAnimated:animated];
|
||||
|
@ -258,8 +259,11 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
{
|
||||
if (!updatingTable)
|
||||
{
|
||||
[self alignAnimated:YES];
|
||||
[self setState:self.state animated:YES withCallback:YES];
|
||||
self.tableView.frame = CGRectMake(0, 0, self.superview.width, self.backgroundView.height);
|
||||
// [self reloadHeader];
|
||||
// [self alignAnimated:YES];
|
||||
// self.tableView.contentInset = UIEdgeInsetsMake([self headerHeight], 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,9 +291,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
[self updateHeight:[self headerHeight]];
|
||||
self.minY = self.statusBarIncluded ? 0 : -20;
|
||||
self.headerSeparator.alpha = 0;
|
||||
} completion:^(BOOL finished) {
|
||||
// self.tableView.frame = CGRectMake(0, 0, self.superview.width, self.backgroundView.height);
|
||||
}];
|
||||
} completion:nil];
|
||||
}
|
||||
else if (self.state == PlacePageStateOpened)
|
||||
{
|
||||
|
@ -342,8 +344,6 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
// [self performAfterDelay:0 block:^{
|
||||
[self resizeTableAnimated:animated];
|
||||
// }];
|
||||
|
||||
[self updateBookmarkViewsAlpha:animated];
|
||||
}
|
||||
|
||||
- (void)resizeTableAnimated:(BOOL)animated
|
||||
|
@ -374,8 +374,8 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
updatingTable = NO;
|
||||
}];
|
||||
}];
|
||||
self.bookmarkButton.selected = [self isBookmark];
|
||||
}
|
||||
self.bookmarkButton.selected = [self isBookmark];
|
||||
}
|
||||
|
||||
- (CGFloat)maxHeight
|
||||
|
@ -395,6 +395,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
|
||||
- (void)bookmarkCategoryDeletedNotification:(NSNotification *)notification
|
||||
{
|
||||
#warning <#message#>
|
||||
if (m_categoryIndex == [[notification object] integerValue])
|
||||
[self abortBookmarkState];
|
||||
}
|
||||
|
@ -415,7 +416,8 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
|
||||
[self clearCachedProperties];
|
||||
[self reloadHeader];
|
||||
[self updateBookmarkStateAnimated:YES];
|
||||
[self updateBookmarkStateAnimated:NO];
|
||||
[self updateBookmarkViewsAlpha:NO];
|
||||
}
|
||||
|
||||
- (void)swipe:(UISwipeGestureRecognizer *)sender
|
||||
|
@ -451,7 +453,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
UIWindow * window = [[appWindow subviews] firstObject];
|
||||
|
||||
self.pickerView = [[UIView alloc] initWithFrame:window.bounds];
|
||||
ColorPickerView * colorPicker = [[ColorPickerView alloc] initWithWidth:MIN(window.height, window.width) andSelectButton:[ColorPickerView getColorIndex:self.colorName]];
|
||||
ColorPickerView * colorPicker = [[ColorPickerView alloc] initWithWidth:(IPAD ? 340 : 300) andSelectButton:[ColorPickerView getColorIndex:self.colorName]];
|
||||
colorPicker.delegate = self;
|
||||
colorPicker.minX = (self.pickerView.width - colorPicker.width) / 2;
|
||||
colorPicker.minY = (self.pickerView.height - colorPicker.height) / 2;
|
||||
|
@ -754,6 +756,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
|
||||
[self reloadHeader];
|
||||
[self updateBookmarkStateAnimated:YES];
|
||||
[self updateBookmarkViewsAlpha:YES];
|
||||
}
|
||||
|
||||
- (void)addBookmark
|
||||
|
@ -783,6 +786,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
|
||||
[self reloadHeader];
|
||||
[self updateBookmarkStateAnimated:YES];
|
||||
[self updateBookmarkViewsAlpha:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -874,7 +878,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
{
|
||||
if (!_headerView)
|
||||
{
|
||||
_headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.width, [self headerHeight])];
|
||||
_headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, [self headerHeight])];
|
||||
_headerView.backgroundColor = [UIColor applicationColor];
|
||||
_headerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
@interface SearchCell ()
|
||||
|
||||
@property (nonatomic) UIView * separatorView;
|
||||
@property (nonatomic) UIImageView * separatorView;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -34,13 +34,13 @@
|
|||
self.selectedBackgroundView.frame = self.bounds;
|
||||
}
|
||||
|
||||
- (UIView *)separatorView
|
||||
- (UIImageView *)separatorView
|
||||
{
|
||||
if (!_separatorView)
|
||||
{
|
||||
_separatorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 0.5)];
|
||||
_separatorView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, 1)];
|
||||
_separatorView.image = [[UIImage imageNamed:@"SearchCellSeparator"] resizableImageWithCapInsets:UIEdgeInsetsZero];
|
||||
_separatorView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
_separatorView.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.5];
|
||||
}
|
||||
return _separatorView;
|
||||
}
|
||||
|
|
|
@ -148,6 +148,7 @@
|
|||
_typeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 70, 16)];
|
||||
_typeLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
|
||||
_typeLabel.font = TYPE_FONT;
|
||||
_typeLabel.backgroundColor = [UIColor clearColor];
|
||||
_typeLabel.textColor = [UIColor colorWithColorCode:@"c9c9c9"];
|
||||
_typeLabel.textAlignment = NSTextAlignmentRight;
|
||||
}
|
||||
|
@ -161,6 +162,7 @@
|
|||
_distanceLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 70, 16)];
|
||||
_distanceLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
|
||||
_distanceLabel.textColor = [UIColor colorWithColorCode:@"c9c9c9"];
|
||||
_distanceLabel.backgroundColor = [UIColor clearColor];
|
||||
_distanceLabel.font = DISTANCE_FONT;
|
||||
_distanceLabel.textAlignment = NSTextAlignmentRight;
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ __weak SearchView * selfPointer;
|
|||
|
||||
[self addSubview:self.tableView];
|
||||
[self addSubview:self.topBackgroundView];
|
||||
self.topBackgroundView.height = 64;
|
||||
self.topBackgroundView.height = SYSTEM_VERSION_IS_LESS_THAN(@"7") ? 44 : 64;
|
||||
[self addSubview:self.searchBar];
|
||||
[self.tableView addSubview:self.emptyResultLabel];
|
||||
|
||||
|
@ -387,7 +387,7 @@ static void OnSearchResultCallback(search::Results const & results)
|
|||
|
||||
- (CGFloat)defaultSearchBarMinY
|
||||
{
|
||||
return SYSTEM_VERSION_IS_LESS_THAN(@"7") ? 0 : 20;
|
||||
return SYSTEM_VERSION_IS_LESS_THAN(@"7") ? 3 : 20;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
|
|
Loading…
Add table
Reference in a new issue