forked from organicmaps/organicmaps
[ios] Deleted Start route and End route buttons
This commit is contained in:
parent
87abbc4e20
commit
db082df1c4
7 changed files with 4 additions and 142 deletions
|
@ -1,18 +0,0 @@
|
|||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class PlacePageRoutingCell;
|
||||
@protocol PlacePageRoutingCellDelegate <NSObject>
|
||||
|
||||
- (void)cancelRouting:(PlacePageRoutingCell *)cell;
|
||||
- (void)routeCellDidSetEndPoint:(PlacePageRoutingCell *)cell;
|
||||
|
||||
@end
|
||||
|
||||
@interface PlacePageRoutingCell : UITableViewCell
|
||||
|
||||
@property (nonatomic, weak) id <PlacePageRoutingCellDelegate> delegate;
|
||||
|
||||
+ (CGFloat)cellHeight;
|
||||
|
||||
@end
|
|
@ -1,86 +0,0 @@
|
|||
|
||||
#import "PlacePageRoutingCell.h"
|
||||
#import "UIKitCategories.h"
|
||||
|
||||
@interface PlacePageRoutingCell ()
|
||||
|
||||
@property (nonatomic) UIButton * cancelButton;
|
||||
@property (nonatomic) UIButton * toButton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation PlacePageRoutingCell
|
||||
|
||||
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
|
||||
[self addSubview:self.toButton];
|
||||
[self addSubview:self.cancelButton];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
CGFloat const xOffset = 20;
|
||||
CGFloat const yOffset = 14;
|
||||
CGFloat const height = [self.toButton backgroundImageForState:UIControlStateNormal].size.height;
|
||||
CGFloat const betweenOffset = 10;
|
||||
self.cancelButton.frame = CGRectMake(xOffset, yOffset, (self.width - 2 * xOffset - betweenOffset) / 2, height);
|
||||
self.toButton.frame = CGRectMake(self.cancelButton.maxX + betweenOffset, yOffset, (self.width - 2 * xOffset - betweenOffset) / 2, height);
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
|
||||
- (void)cancelButtonPressed:(id)sender
|
||||
{
|
||||
[self.delegate cancelRouting:self];
|
||||
}
|
||||
|
||||
- (void)toButtonPressed:(id)sender
|
||||
{
|
||||
[self.delegate routeCellDidSetEndPoint:self];
|
||||
}
|
||||
|
||||
+ (CGFloat)cellHeight
|
||||
{
|
||||
return 70;
|
||||
}
|
||||
|
||||
- (UIButton *)cancelButton
|
||||
{
|
||||
if (!_cancelButton)
|
||||
{
|
||||
UIImage * image = [[UIImage imageNamed:@"PlacePageButton"] resizableImageWithCapInsets:UIEdgeInsetsMake(6, 6, 6, 6)];
|
||||
_cancelButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, image.size.width, image.size.height)];
|
||||
_cancelButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:17.5];
|
||||
_cancelButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin;
|
||||
[_cancelButton setBackgroundImage:image forState:UIControlStateNormal];
|
||||
[_cancelButton addTarget:self action:@selector(cancelButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_cancelButton setTitle:NSLocalizedString(@"choose_starting_point", nil) forState:UIControlStateNormal];
|
||||
[_cancelButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[_cancelButton setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted];
|
||||
}
|
||||
return _cancelButton;
|
||||
}
|
||||
|
||||
- (UIButton *)toButton
|
||||
{
|
||||
if (!_toButton)
|
||||
{
|
||||
UIImage * image = [[UIImage imageNamed:@"PlacePageButton"] resizableImageWithCapInsets:UIEdgeInsetsMake(6, 6, 6, 6)];
|
||||
_toButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, image.size.width, image.size.height)];
|
||||
_toButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:17.5];
|
||||
_toButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin;
|
||||
[_toButton setBackgroundImage:image forState:UIControlStateNormal];
|
||||
[_toButton addTarget:self action:@selector(toButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_toButton setTitle:NSLocalizedString(@"choose_destination", nil) forState:UIControlStateNormal];
|
||||
[_toButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[_toButton setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted];
|
||||
}
|
||||
return _toButton;
|
||||
}
|
||||
|
||||
@end
|
|
@ -8,7 +8,6 @@
|
|||
#import "PlacePageInfoCell.h"
|
||||
#import "PlacePageEditCell.h"
|
||||
#import "PlacePageShareCell.h"
|
||||
#import "PlacePageRoutingCell.h"
|
||||
#import "PlacePageBookmarkDescriptionCell.h"
|
||||
#include "../../search/result.hpp"
|
||||
#import "ColorPickerView.h"
|
||||
|
@ -21,11 +20,10 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
CellRowSet,
|
||||
CellRowBookmarkDescription,
|
||||
CellRowShare,
|
||||
CellRowRouting,
|
||||
CellInvalid // Sections changed but rows are not
|
||||
};
|
||||
|
||||
@interface PlacePageView () <UIGestureRecognizerDelegate, UITableViewDataSource, UITableViewDelegate, PlacePageShareCellDelegate, PlacePageInfoCellDelegate, ColorPickerDelegate, UIAlertViewDelegate, PlacePageRoutingCellDelegate, UIWebViewDelegate>
|
||||
@interface PlacePageView () <UIGestureRecognizerDelegate, UITableViewDataSource, UITableViewDelegate, PlacePageShareCellDelegate, PlacePageInfoCellDelegate, ColorPickerDelegate, UIAlertViewDelegate, UIWebViewDelegate>
|
||||
|
||||
@property (nonatomic) UIImageView * backgroundView;
|
||||
@property (nonatomic) UIView * headerView;
|
||||
|
@ -104,7 +102,6 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
[self.tableView registerClass:[PlacePageInfoCell class] forCellReuseIdentifier:[PlacePageInfoCell className]];
|
||||
[self.tableView registerClass:[PlacePageEditCell class] forCellReuseIdentifier:[PlacePageEditCell className]];
|
||||
[self.tableView registerClass:[PlacePageShareCell class] forCellReuseIdentifier:[PlacePageShareCell className]];
|
||||
[self.tableView registerClass:[PlacePageRoutingCell class] forCellReuseIdentifier:[PlacePageRoutingCell className]];
|
||||
}
|
||||
|
||||
CGFloat const defaultHeight = 93;
|
||||
|
@ -174,11 +171,9 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
else if (indexPath.row == 1)
|
||||
return [self isBookmark] ? CellRowSet : CellRowShare;
|
||||
else if (indexPath.row == 2)
|
||||
return [self isBookmark] ? CellRowBookmarkDescription : CellRowRouting;
|
||||
return CellRowBookmarkDescription;
|
||||
else if (indexPath.row == 3)
|
||||
return CellRowShare;
|
||||
else if (indexPath.row == 4)
|
||||
return CellRowRouting;
|
||||
return CellInvalid;
|
||||
}
|
||||
|
||||
|
@ -251,15 +246,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
cell.apiAppTitle = nil;
|
||||
return cell;
|
||||
}
|
||||
else if (row == CellRowRouting)
|
||||
{
|
||||
PlacePageRoutingCell * cell = [tableView dequeueReusableCellWithIdentifier:[PlacePageRoutingCell className]];
|
||||
if (!cell) // only for iOS 5
|
||||
cell = [[PlacePageRoutingCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[PlacePageRoutingCell className]];
|
||||
|
||||
cell.delegate = self;
|
||||
return cell;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -286,8 +273,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
}
|
||||
else if (row == CellRowShare)
|
||||
return [PlacePageShareCell cellHeight];
|
||||
else if (row == CellRowRouting)
|
||||
return [PlacePageRoutingCell cellHeight];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -513,7 +499,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
- (CGFloat)fullHeight
|
||||
{
|
||||
CGFloat const infoCellHeight = [PlacePageInfoCell cellHeightWithViewWidth:self.tableView.width inMyPositionMode:[self isMyPosition]];
|
||||
CGFloat fullHeight = [self headerHeight] + infoCellHeight + [PlacePageShareCell cellHeight] + [PlacePageRoutingCell cellHeight];
|
||||
CGFloat fullHeight = [self headerHeight] + infoCellHeight + [PlacePageShareCell cellHeight];
|
||||
if ([self isBookmark])
|
||||
{
|
||||
fullHeight += [PlacePageEditCell cellHeightWithTextValue:self.setName viewWidth:self.tableView.width];
|
||||
|
@ -680,18 +666,6 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
}
|
||||
}
|
||||
|
||||
- (void)cancelRouting:(PlacePageRoutingCell *)cell
|
||||
{
|
||||
GetFramework().CancelRoutingSession();
|
||||
[self setState:PlacePageStateHidden animated:YES withCallback:YES];
|
||||
}
|
||||
|
||||
- (void)routeCellDidSetEndPoint:(PlacePageRoutingCell *)cell
|
||||
{
|
||||
GetFramework().StartRoutingSession([self pinPoint]);
|
||||
[self setState:PlacePageStateHidden animated:YES withCallback:YES];
|
||||
}
|
||||
|
||||
- (void)infoCellDidPressColorSelector:(PlacePageInfoCell *)cell
|
||||
{
|
||||
UIWindow * appWindow = [[UIApplication sharedApplication].windows firstObject];
|
||||
|
|
Before Width: | Height: | Size: 590 B After Width: | Height: | Size: 590 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
@ -17,8 +17,6 @@
|
|||
46F26CD810F623BA00ECCA39 /* EAGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46F26CD710F623BA00ECCA39 /* EAGLView.mm */; };
|
||||
46F26D1F10F626CB00ECCA39 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46F26D1E10F626CB00ECCA39 /* QuartzCore.framework */; };
|
||||
972CDCC61887F1B7006641CA /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 972CDCC51887F1B7006641CA /* CFNetwork.framework */; };
|
||||
97354B65196AF97200352536 /* PlacePageRoutingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 97354B64196AF97200352536 /* PlacePageRoutingCell.m */; };
|
||||
97354B66196AF97200352536 /* PlacePageRoutingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 97354B64196AF97200352536 /* PlacePageRoutingCell.m */; };
|
||||
97354B6E196EDD3A00352536 /* AccountManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 97354B6D196EDD3A00352536 /* AccountManager.m */; };
|
||||
97354B6F196EDD3F00352536 /* AccountManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 97354B6D196EDD3A00352536 /* AccountManager.m */; };
|
||||
974386D91934CBAC00FD5659 /* FacebookSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 974386D81934CBAC00FD5659 /* FacebookSDK.framework */; };
|
||||
|
@ -1340,8 +1338,6 @@
|
|||
77DDA9A116D504F900804BDB /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
8D1107310486CEB800E47090 /* MapsWithMe-Pro.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "MapsWithMe-Pro.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; };
|
||||
97354B63196AF97200352536 /* PlacePageRoutingCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlacePageRoutingCell.h; sourceTree = "<group>"; };
|
||||
97354B64196AF97200352536 /* PlacePageRoutingCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlacePageRoutingCell.m; sourceTree = "<group>"; };
|
||||
97354B6C196EDD3A00352536 /* AccountManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccountManager.h; sourceTree = "<group>"; };
|
||||
97354B6D196EDD3A00352536 /* AccountManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AccountManager.m; sourceTree = "<group>"; };
|
||||
974386D81934CBAC00FD5659 /* FacebookSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FacebookSDK.framework; sourceTree = "<group>"; };
|
||||
|
@ -2463,8 +2459,6 @@
|
|||
97D092B4190A6E1D00FF645B /* PlacePageEditCell.mm */,
|
||||
97AA281F190AD21100AE1AAB /* PlacePageShareCell.h */,
|
||||
97AA2820190AD21100AE1AAB /* PlacePageShareCell.m */,
|
||||
97354B63196AF97200352536 /* PlacePageRoutingCell.h */,
|
||||
97354B64196AF97200352536 /* PlacePageRoutingCell.m */,
|
||||
9773DB8D198652E600C4A9E9 /* PlacePageBookmarkDescriptionCell.h */,
|
||||
9773DB8E198652E600C4A9E9 /* PlacePageBookmarkDescriptionCell.m */,
|
||||
);
|
||||
|
@ -4483,7 +4477,6 @@
|
|||
97D092B5190A6E1D00FF645B /* PlacePageEditCell.mm in Sources */,
|
||||
9750841F199501F100A7457D /* ImageDownloader.m in Sources */,
|
||||
978F9253183BD530000D6C7C /* NavigationController.mm in Sources */,
|
||||
97354B65196AF97200352536 /* PlacePageRoutingCell.m in Sources */,
|
||||
974386DD19373EA400FD5659 /* ToastView.m in Sources */,
|
||||
97C9851E186AE3C500AF7E9E /* Reachability.m in Sources */,
|
||||
EE7F29821219ECA300EB67A9 /* RenderContext.mm in Sources */,
|
||||
|
@ -4558,7 +4551,6 @@
|
|||
978F9254183BD530000D6C7C /* NavigationController.mm in Sources */,
|
||||
97508420199501F100A7457D /* ImageDownloader.m in Sources */,
|
||||
97A0EEFD192F3B43009B2779 /* BottomMenuCell.m in Sources */,
|
||||
97354B66196AF97200352536 /* PlacePageRoutingCell.m in Sources */,
|
||||
97C9851F186AE3C500AF7E9E /* Reachability.m in Sources */,
|
||||
97ABBA4618C8DF620079333C /* PlacePageView.mm in Sources */,
|
||||
9789DB5B188D94F9007C6FAE /* InterstitialView.mm in Sources */,
|
||||
|
|
Loading…
Add table
Reference in a new issue