From 695499dea9e6c3bc58cde93c374380a9968e2ada Mon Sep 17 00:00:00 2001 From: Diego Waxemberg Date: Wed, 30 Sep 2015 19:13:37 -0700 Subject: [PATCH] host and app buttons now have feedback when tapped --- Limelight/AppCollectionView.h | 13 +++++++++ Limelight/AppCollectionView.m | 28 +++++++++++++++++++ Limelight/ComputerScrollView.h | 13 +++++++++ Limelight/ComputerScrollView.m | 28 +++++++++++++++++++ .../ViewControllers/MainFrameViewController.m | 6 +++- Moonlight.xcodeproj/project.pbxproj | 12 ++++++++ iPad.storyboard | 2 +- iPhone.storyboard | 2 +- 8 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 Limelight/AppCollectionView.h create mode 100644 Limelight/AppCollectionView.m create mode 100644 Limelight/ComputerScrollView.h create mode 100644 Limelight/ComputerScrollView.m diff --git a/Limelight/AppCollectionView.h b/Limelight/AppCollectionView.h new file mode 100644 index 0000000..40c59ab --- /dev/null +++ b/Limelight/AppCollectionView.h @@ -0,0 +1,13 @@ +// +// AppCollectionView.h +// Moonlight +// +// Created by Diego Waxemberg on 9/30/15. +// Copyright © 2015 Moonlight Stream. All rights reserved. +// + +#import + +@interface AppCollectionView : UICollectionView + +@end diff --git a/Limelight/AppCollectionView.m b/Limelight/AppCollectionView.m new file mode 100644 index 0000000..4ee9988 --- /dev/null +++ b/Limelight/AppCollectionView.m @@ -0,0 +1,28 @@ +// +// AppCollectionView.m +// Moonlight +// +// Created by Diego Waxemberg on 9/30/15. +// Copyright © 2015 Moonlight Stream. All rights reserved. +// + +#import "AppCollectionView.h" + +@implementation AppCollectionView + +- (BOOL)touchesShouldCancelInContentView:(UIView *)view { + if ([view isKindOfClass:[UIButton class]]) { + return YES; + } + return [super touchesShouldCancelInContentView:view]; +} + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ + +@end diff --git a/Limelight/ComputerScrollView.h b/Limelight/ComputerScrollView.h new file mode 100644 index 0000000..16a93ce --- /dev/null +++ b/Limelight/ComputerScrollView.h @@ -0,0 +1,13 @@ +// +// ComputerScrollView.h +// Moonlight +// +// Created by Diego Waxemberg on 9/30/15. +// Copyright © 2015 Moonlight Stream. All rights reserved. +// + +#import + +@interface ComputerScrollView : UIScrollView + +@end diff --git a/Limelight/ComputerScrollView.m b/Limelight/ComputerScrollView.m new file mode 100644 index 0000000..c961017 --- /dev/null +++ b/Limelight/ComputerScrollView.m @@ -0,0 +1,28 @@ +// +// ComputerScrollView.m +// Moonlight +// +// Created by Diego Waxemberg on 9/30/15. +// Copyright © 2015 Moonlight Stream. All rights reserved. +// + +#import "ComputerScrollView.h" + +@implementation ComputerScrollView + +- (BOOL)touchesShouldCancelInContentView:(UIView *)view { + if ([view isKindOfClass:[UIButton class]]) { + return YES; + } + return [super touchesShouldCancelInContentView:view]; +} + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ + +@end diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index f41c272..9f670f8 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -22,6 +22,7 @@ #import "ServerInfoResponse.h" #import "StreamFrameViewController.h" #import "LoadingFrameViewController.h" +#import "ComputerScrollView.h" @implementation MainFrameViewController { NSOperationQueue* _opQueue; @@ -490,9 +491,12 @@ static NSMutableSet* hostList; [self setAutomaticallyAdjustsScrollViewInsets:NO]; - hostScrollView = [[UIScrollView alloc] init]; + hostScrollView = [[ComputerScrollView alloc] init]; hostScrollView.frame = CGRectMake(0, self.navigationController.navigationBar.frame.origin.y + self.navigationController.navigationBar.frame.size.height, self.view.frame.size.width, self.view.frame.size.height / 2); [hostScrollView setShowsHorizontalScrollIndicator:NO]; + hostScrollView.delaysContentTouches = NO; + + self.collectionView.delaysContentTouches = NO; [self retrieveSavedHosts]; _discMan = [[DiscoveryManager alloc] initWithHosts:[hostList allObjects] andCallback:self]; diff --git a/Moonlight.xcodeproj/project.pbxproj b/Moonlight.xcodeproj/project.pbxproj index b390aa6..30d8d9e 100644 --- a/Moonlight.xcodeproj/project.pbxproj +++ b/Moonlight.xcodeproj/project.pbxproj @@ -15,6 +15,8 @@ 9E5D60131A5A5A3900689918 /* Roboto-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 9E5D60001A5A5A3900689918 /* Roboto-Medium.ttf */; }; 9E5D60151A5A5A3900689918 /* Roboto-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 9E5D60021A5A5A3900689918 /* Roboto-Regular.ttf */; }; 9E5D60161A5A5A3900689918 /* Roboto-Thin.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 9E5D60031A5A5A3900689918 /* Roboto-Thin.ttf */; }; + FB1D59971BBCCB6400F482CA /* ComputerScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = FB1D59961BBCCB6400F482CA /* ComputerScrollView.m */; settings = {ASSET_TAGS = (); }; }; + FB1D599A1BBCCD7E00F482CA /* AppCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = FB1D59991BBCCD7E00F482CA /* AppCollectionView.m */; settings = {ASSET_TAGS = (); }; }; FB290CF219B2C406004C83CF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB290CF119B2C406004C83CF /* Foundation.framework */; }; FB290CF419B2C406004C83CF /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB290CF319B2C406004C83CF /* CoreGraphics.framework */; }; FB290CF619B2C406004C83CF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB290CF519B2C406004C83CF /* UIKit.framework */; }; @@ -99,6 +101,10 @@ 9E5D60001A5A5A3900689918 /* Roboto-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Medium.ttf"; sourceTree = ""; }; 9E5D60021A5A5A3900689918 /* Roboto-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Regular.ttf"; sourceTree = ""; }; 9E5D60031A5A5A3900689918 /* Roboto-Thin.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Thin.ttf"; sourceTree = ""; }; + FB1D59951BBCCB6400F482CA /* ComputerScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComputerScrollView.h; sourceTree = ""; }; + FB1D59961BBCCB6400F482CA /* ComputerScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ComputerScrollView.m; sourceTree = ""; }; + FB1D59981BBCCD7E00F482CA /* AppCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppCollectionView.h; sourceTree = ""; }; + FB1D59991BBCCD7E00F482CA /* AppCollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppCollectionView.m; sourceTree = ""; }; FB290CEE19B2C406004C83CF /* Moonlight.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Moonlight.app; sourceTree = BUILT_PRODUCTS_DIR; }; FB290CF119B2C406004C83CF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; FB290CF319B2C406004C83CF /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; @@ -397,6 +403,10 @@ FB89463719F6473800339C8A /* Launch Screen.xib */, FB290D0819B2C406004C83CF /* Images.xcassets */, FB290D0519B2C406004C83CF /* Limelight.xcdatamodeld */, + FB1D59951BBCCB6400F482CA /* ComputerScrollView.h */, + FB1D59961BBCCB6400F482CA /* ComputerScrollView.m */, + FB1D59981BBCCD7E00F482CA /* AppCollectionView.h */, + FB1D59991BBCCD7E00F482CA /* AppCollectionView.m */, ); path = Limelight; sourceTree = ""; @@ -827,6 +837,7 @@ FB89463019F646E200339C8A /* StreamConfiguration.m in Sources */, FBFCB3311B50B29400089F8A /* Host.m in Sources */, FBD3495319FF36FB002D2A60 /* SWRevealViewController.m in Sources */, + FB1D59971BBCCB6400F482CA /* ComputerScrollView.m in Sources */, FBD3495019FF2174002D2A60 /* SettingsViewController.m in Sources */, FB89462C19F646E200339C8A /* HttpManager.m in Sources */, FB89462D19F646E200339C8A /* MDNSManager.m in Sources */, @@ -834,6 +845,7 @@ FB4678FA1A55FFAD00377732 /* DiscoveryManager.m in Sources */, FB89463519F646E200339C8A /* MainFrameViewController.m in Sources */, FBD1C8E21A8AD71400C6703C /* Logger.m in Sources */, + FB1D599A1BBCCD7E00F482CA /* AppCollectionView.m in Sources */, FB89463619F646E200339C8A /* StreamFrameViewController.m in Sources */, FB89462819F646E200339C8A /* CryptoManager.m in Sources */, FB89462E19F646E200339C8A /* PairManager.m in Sources */, diff --git a/iPad.storyboard b/iPad.storyboard index 9dc847e..09c93c1 100644 --- a/iPad.storyboard +++ b/iPad.storyboard @@ -14,7 +14,7 @@ - + diff --git a/iPhone.storyboard b/iPhone.storyboard index e4afc80..ea465ff 100644 --- a/iPhone.storyboard +++ b/iPhone.storyboard @@ -14,7 +14,7 @@ - +