Permalink
Browse files

Merge pull request #156 from birarda/18716

Code Review for Job #18716
  • Loading branch information...
2 parents 21cc9d8 + 22680e7 commit 58a9b65fb54d8345f542ecd7342c08b1b0f99af1 @birarda birarda committed Nov 27, 2012
Oops, something went wrong.
Deleted file not rendered
Deleted file not rendered
@@ -31,8 +31,6 @@ typedef enum {
// the following properties are used to dismiss F2F alerts that don't need to still be showing once new ones come in
@property (strong, nonatomic) UIAlertView *f2fInviteAlert;
-@property (strong, nonatomic) UIAlertView *f2fPasswordAlert;
-
- (IBAction)loginButtonClick:(id)sender;
- (IBAction)blockUIButtonClick:(id)sender;
@@ -27,8 +27,6 @@ @interface SettingsMenuController() <UITabBarControllerDelegate>
@property (strong, nonatomic) UITapGestureRecognizer *menuCloseGestureRecognizer;
@property (strong, nonatomic) UIPanGestureRecognizer *menuClosePanGestureRecognizer;
@property (strong, nonatomic) UIPanGestureRecognizer *menuClosePanFromNavbarGestureRecognizer;
-@property (strong, nonatomic) UIPanGestureRecognizer *menuClosePanFromTabbarGestureRecognizer;
-@property (strong, nonatomic) UITapGestureRecognizer *menuCloseTapFromTabbarGestureRecognizer;
@property (nonatomic) CGPoint panStartLocation;
- (void)setMapAndButtonsViewXOffset:(CGFloat)xOffset;
@@ -73,12 +71,6 @@ - (void)setF2fInviteAlert:(UIAlertView *)f2fInviteAlert
_f2fInviteAlert.delegate = self;
}
-- (void)setF2fPasswordAlert:(UIAlertView *)f2fPasswordAlert
-{
- _f2fPasswordAlert = f2fPasswordAlert;
- _f2fPasswordAlert.delegate = self;
-}
-
#pragma mark - View lifecycle
- (void)viewDidLoad
{
@@ -162,31 +154,24 @@ - (void)showMenu:(BOOL)showMenu {
int touchViewTag = 3040;
+ // add a view in front of the tab bar controller to handle pan and tap
UINavigationController *visibleNC = (UINavigationController *)self.cpTabBarController.selectedViewController;
- UIViewController *visibleVC = visibleNC.visibleViewController;
-
- // make sure we have a touchView layer
- UIView *touchView = [visibleVC.view viewWithTag:touchViewTag];
+ UIView *touchView = [self.cpTabBarController.view viewWithTag:touchViewTag];
if (!touchView) {
- // place an invisible view over the VC's view to handle touch
- CGRect touchFrame = CGRectMake(0, 0, visibleVC.view.frame.size.width, visibleVC.view.frame.size.height);
+ // height of the touch view is the device height, minus navigation bar
+ CGFloat navBarHeight = visibleNC.navigationBar.frame.size.height;
+ CGFloat touchViewHeight = self.cpTabBarController.view.frame.size.height - navBarHeight;
+
+ CGRect touchFrame = CGRectMake(0,
+ navBarHeight,
+ self.cpTabBarController.view.frame.size.width,
+ touchViewHeight);
touchView = [[UIView alloc] initWithFrame:touchFrame];
touchView.tag = touchViewTag;
- [visibleVC.view addSubview:touchView];
+ [self.cpTabBarController.view addSubview:touchView];
}
-
- // make sure we have a tabTouch layer over the tabBar
- UIView *tabTouch = [self.cpTabBarController.tabBar viewWithTag:touchViewTag];
-
- if (!tabTouch) {
- // place an invisible view over the tab bar to handle tap
- CGRect tabFrame = CGRectMake(0, 0, self.cpTabBarController.tabBar.frame.size.width, self.cpTabBarController.tabBar.frame.size.height);
- tabTouch = [[UIView alloc] initWithFrame:tabFrame];
- tabTouch.tag = touchViewTag;
- [self.cpTabBarController.tabBar addSubview:tabTouch];
- }
-
+
if (showMenu) {
// shift to the right, hiding buttons
@@ -207,17 +192,7 @@ - (void)showMenu:(BOOL)showMenu {
if (!self.menuClosePanFromNavbarGestureRecognizer) {
// Pan to close from navbar
self.menuClosePanFromNavbarGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(menuClosePan:)];
- [visibleVC.navigationController.navigationBar addGestureRecognizer:self.menuClosePanFromNavbarGestureRecognizer];
- }
- if (!self.menuClosePanFromTabbarGestureRecognizer) {
- // Pan to close from tab bar
- self.menuClosePanFromTabbarGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(menuClosePan:)];
- [tabTouch addGestureRecognizer:self.menuClosePanFromTabbarGestureRecognizer];
- }
- if (!self.menuCloseTapFromTabbarGestureRecognizer) {
- // Tap to close from tab bar
- self.menuCloseTapFromTabbarGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeMenu)];
- [tabTouch addGestureRecognizer:self.menuCloseTapFromTabbarGestureRecognizer];
+ [visibleNC.navigationBar addGestureRecognizer:self.menuClosePanFromNavbarGestureRecognizer];
}
} else {
// shift to the left, restoring the buttons
@@ -232,18 +207,8 @@ - (void)showMenu:(BOOL)showMenu {
// remove the touch view from the VC
[touchView removeFromSuperview];
- [visibleVC.navigationController.navigationBar removeGestureRecognizer:self.menuClosePanFromNavbarGestureRecognizer];
+ [visibleNC.navigationBar removeGestureRecognizer:self.menuClosePanFromNavbarGestureRecognizer];
self.menuClosePanFromNavbarGestureRecognizer = nil;
-
- [tabTouch removeGestureRecognizer:self.menuClosePanFromTabbarGestureRecognizer];
- self.menuClosePanFromTabbarGestureRecognizer = nil;
-
- [tabTouch removeGestureRecognizer:self.menuCloseTapFromTabbarGestureRecognizer];
- self.menuCloseTapFromTabbarGestureRecognizer = nil;
-
- // remove the tab touch view from the tab bar
- [tabTouch removeFromSuperview];
-
}
[UIView commitAnimations];
self.isMenuShowing = showMenu ? 1 : 0;
@@ -75,9 +75,9 @@
<outlet property="delegate" destination="WGr-Yo-Vg9" id="egh-Cb-sq2"/>
</connections>
</tableView>
- <imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="map-shadow.png" id="rBQ-Tw-WrU">
+ <imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="settings-menu-shadow.png" id="rBQ-Tw-WrU">
<rect key="frame" x="-10" y="0.0" width="10" height="460"/>
- <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="ZWv-dm-FCa">
<rect key="frame" x="85" y="427" width="40" height="25"/>
@@ -1274,8 +1274,8 @@ photo?</string>
<image name="default-avatar-256.png" width="256" height="256"/>
<image name="drop-down.png" width="196" height="27"/>
<image name="list-arrow-dark-grey.png" width="11" height="16"/>
- <image name="map-shadow.png" width="10" height="320"/>
<image name="settings-button-3.png" width="42" height="29"/>
+ <image name="settings-menu-shadow.png" width="9" height="1"/>
</resources>
<classes>
<class className="AutoCheckinCell" superclassName="UITableViewCell">
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 58a9b65

Please sign in to comment.