From 96c60ec3947bf859af1908e287c96c93a7b1819b Mon Sep 17 00:00:00 2001 From: moritz haarmann Date: Fri, 11 Apr 2014 14:57:23 +0200 Subject: [PATCH] + Added Icons to the Editing Screens. --- Classes/BITImageAnnotationViewController.m | 79 +++++++++++++++----- Resources/Arrow.png | Bin 0 -> 394 bytes Resources/Arrow@2x.png | Bin 0 -> 896 bytes Resources/Blur.png | Bin 0 -> 169 bytes Resources/Blur@2x.png | Bin 0 -> 250 bytes Resources/Cancel.png | Bin 0 -> 179 bytes Resources/Cancel@2x.png | Bin 0 -> 303 bytes Resources/Ok.png | Bin 0 -> 245 bytes Resources/Ok@2x.png | Bin 0 -> 363 bytes Resources/Rectangle.png | Bin 0 -> 176 bytes Resources/Rectangle@2x.png | Bin 0 -> 244 bytes Support/HockeySDK.xcodeproj/project.pbxproj | 40 ++++++++++ 12 files changed, 101 insertions(+), 18 deletions(-) create mode 100644 Resources/Arrow.png create mode 100644 Resources/Arrow@2x.png create mode 100644 Resources/Blur.png create mode 100644 Resources/Blur@2x.png create mode 100644 Resources/Cancel.png create mode 100644 Resources/Cancel@2x.png create mode 100644 Resources/Ok.png create mode 100644 Resources/Ok@2x.png create mode 100644 Resources/Rectangle.png create mode 100644 Resources/Rectangle@2x.png diff --git a/Classes/BITImageAnnotationViewController.m b/Classes/BITImageAnnotationViewController.m index b8579cf64d..910b81eaad 100644 --- a/Classes/BITImageAnnotationViewController.m +++ b/Classes/BITImageAnnotationViewController.m @@ -11,12 +11,16 @@ #import "BITRectangleImageAnnotation.h" #import "BITArrowImageAnnotation.h" #import "BITBlurImageAnnotation.h" +#import "BITHockeyHelper.h" +#import "HockeySDKPrivate.h" @interface BITImageAnnotationViewController () @property (nonatomic, strong) UIImageView *imageView; @property (nonatomic, strong) UISegmentedControl *editingControls; @property (nonatomic, strong) NSMutableArray *objects; + +@property (nonatomic, strong) UITapGestureRecognizer *tapRecognizer; @property (nonatomic, strong) UIPanGestureRecognizer *panRecognizer; @property (nonatomic, strong) UIPinchGestureRecognizer *pinchRecognizer; @@ -48,7 +52,15 @@ self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; + NSArray *icons = @[@"Rectangle.png", @"Arrow.png", @"Blur.png"]; + self.editingControls = [[UISegmentedControl alloc] initWithItems:@[@"Rectangle", @"Arrow", @"Blur"]]; + int i=0; + for (NSString *imageName in icons){ + [self.editingControls setImage:bit_imageNamed(imageName, BITHOCKEYSDK_BUNDLE) forSegmentAtIndex:i++]; + } + + [self.editingControls setSegmentedControlStyle:UISegmentedControlStyleBar]; self.navigationItem.titleView = self.editingControls; @@ -66,18 +78,32 @@ [self.view addSubview:self.imageView]; - self.imageView.frame = self.view.bounds; + // Erm. + self.imageView.frame = [UIScreen mainScreen].bounds; self.panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panned:)]; self.pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinched:)]; + self.tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)]; + + [self.panRecognizer requireGestureRecognizerToFail:self.tapRecognizer]; [self.imageView addGestureRecognizer:self.pinchRecognizer]; [self.imageView addGestureRecognizer:self.panRecognizer]; + [self.view addGestureRecognizer:self.tapRecognizer]; self.imageView.userInteractionEnabled = YES; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc ] initWithTitle:@"Discard" style:UIBarButtonItemStyleBordered target:self action:@selector(discard:)]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc ] initWithTitle:@"Save" style:UIBarButtonItemStyleBordered target:self action:@selector(save:)]; + + [self fitImageViewFrame]; + + + // Do any additional setup after loading the view. +} + +- (void)fitImageViewFrame { + CGFloat heightScaleFactor = self.view.frame.size.height / self.image.size.height; CGFloat widthScaleFactor = self.view.frame.size.width / self.image.size.width; @@ -87,9 +113,6 @@ CGSize scaledImageSize = CGSizeMake(self.image.size.width * factor, self.image.size.height * factor); self.imageView.frame = CGRectMake(self.view.frame.size.width/2 - scaledImageSize.width/2, self.view.frame.size.height/2 - scaledImageSize.height/2, scaledImageSize.width, scaledImageSize.height); - - - // Do any additional setup after loading the view. } -(void)editingAction:(id)sender { @@ -196,16 +219,6 @@ } } --(UIView *)firstAnnotationThatIsNotBlur { - for (BITImageAnnotation *annotation in self.imageView.subviews){ - if (![annotation isKindOfClass:[BITBlurImageAnnotation class]]){ - return annotation; - } - } - - return self.imageView; -} - -(void)pinched:(UIPinchGestureRecognizer *)gestureRecognizer { if (gestureRecognizer.state == UIGestureRecognizerStateBegan){ // try to figure out which view we are talking about. @@ -257,10 +270,40 @@ } } -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. +-(void)tapped:(UIGestureRecognizer *)tapRecognizer { + if (self.navigationController.navigationBarHidden){ + // [[UIApplication sharedApplication] setStatusBarHidden:NO]; + [UIView animateWithDuration:0.35f animations:^{ + self.navigationController.navigationBar.alpha = 1; + } completion:^(BOOL finished) { + [self fitImageViewFrame]; + [self.navigationController setNavigationBarHidden:NO animated:NO]; + + + }]; + } else { + [UIView animateWithDuration:0.35f animations:^{ + self.navigationController.navigationBar.alpha = 0; + + } completion:^(BOOL finished) { + [self.navigationController setNavigationBarHidden:YES animated:NO]; + + [self fitImageViewFrame]; + + }]; + } + +} + +#pragma mark - Helpers +-(UIView *)firstAnnotationThatIsNotBlur { + for (BITImageAnnotation *annotation in self.imageView.subviews){ + if (![annotation isKindOfClass:[BITBlurImageAnnotation class]]){ + return annotation; + } + } + + return self.imageView; } @end diff --git a/Resources/Arrow.png b/Resources/Arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..6d8fac10390585862e4384ef2e86820ba5da9356 GIT binary patch literal 394 zcmV;50d@X~P)VCQ8QMKOVG}7t5@%Go!kASp$#?^g*u~$2&~1xlGWoWwl~`bWi5HYH1T*3c zN@(E-S(q`*;1EL6Sv0;2IuWu}HFk3#>p7RmCalKAO%k!je_IqJ{~$Vv^(z zbVJ`U3%!lrs^bx|=0Eg%Z9^OC7U}_9;gQtaXuU$4bajM3tBsE|{R7-1XXJyrJsqK4 zXr4q9C&<{7);QD=nl*G`3eXL!m=lhE=p!_1jWSq+{&s?*uOn39Eu07K;Lr7Sgu2!r oSn6UUEeU;u$9!4;aC=q%1~jHedh8Y&asU7T07*qoM6N<$g8UGz%>V!Z literal 0 HcmV?d00001 diff --git a/Resources/Arrow@2x.png b/Resources/Arrow@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..116a47ee03672a17c2b662403bdcfa9158fc5a6c GIT binary patch literal 896 zcmV-`1AqL9P)0009=NklMY)7gdg>70Ezn)&KCd!Mzx@Be*k?X}ifXNns9ZGHK827bV8_zLyf8dCi^ z_?e-a>w4${_10!nxg9zQWl#xz{sQ}92-GVprrH-!13fd9H|9DOExY1wRwC<7^l7lTZ?F~GLO$l&nh0mXc)1KSz%?1wjJXT* zq6TL3pT&b`U}0WoLKG{-c^|l2s!;_?!A&S%n~$ThAD~yhLAm_e;jkTiV~YC*eUnkF zGtTSa6$AyUnMURu+ zm=$4;N!na53&9=EWcOhLL^T)vcsKzbztp-4bD$|`9l$(pIDNnkt2TqvI(6%W;sLN2 zIRf1vj`b&KH+%xMp2KR`nfbhnYhcT{(Z{!z>#HV+iF_SH#2qk^3wa5|+2IIl&@mHV z$yGhypr;wvV_>eQ3*ht3L1Q7V%@B3&2P1uh`;iF}IVkS3+hA3QPEXn#Ks%jnErx`} zYckn!2u67?_l|xcY%Zease<-}Nbs-b6dE3bNne8nxWS}t?uh2tpSEx|JrA{;z@5v) zmtYX2X>L|8LH%iI3g^-qh=Uz6u^rq3`5w1$&1sYHP`eub+)#1`CUtP?IR%}H7Vs3N zLt3^6A$48Pi4VO|i*nPb0Cz2mI0aoHsrlv~f|?7Gip7l|Mc_@ah!0Jp(4S0SNdDq85fF6^k41QOJ?4h$|2hSC-Lq2DA)$UeG3wRsJHbf$k}0@+;&l zI9Lwaf3<^TGjVwVvX-Ff&iVt!7C=8#vNV&>P8FIb%!oqwF~N2$}<=fCu_x|UA)P`KiKxv^n& U(aWb>fp#-^y85}Sb4q9e0Ejw8Qvd(} literal 0 HcmV?d00001 diff --git a/Resources/Blur@2x.png b/Resources/Blur@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..8cf6ffe5bc51406989170ce3e695f8e9bab7a385 GIT binary patch literal 250 zcmVtK?~9Qgpi#8)j^P+kk`K~aU~9=kg^o<6wF{E;s7IMDdH)Z!Q|tD81;G4BfA@H5(qP6+gJPp%e$iHljKYx`$K6RcZ_2lv|OI(SQqhA^l@uhgl z<|0m@EDeeHQoLky?3|&Q!S?jd)24&F%fD=?T35Dn4Z3kP`{3^-T=u5|C- zIl*s%cV)4n`UQVpwxz7I6e22oFZXq%v8;dV`7r!h=Fu0e73MOhjBQRYTf<|f(LDRa zVZ~JsO@2K-@9Z(Tczu0Hty$LAT<_YwXR@aYn@m!6j&WA}79gBH;UIIF+L6YHC9j{z c?w$CUt+LNxR!nOrBhVELp00i_>zopr0D&w*m;e9( literal 0 HcmV?d00001 diff --git a/Resources/Cancel@2x.png b/Resources/Cancel@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..3ddef8cb237955e0fc3133b1ef8ef9be76d43f92 GIT binary patch literal 303 zcmV+~0nq-5P)A3f$@P#^eJOuqfBk)bTyPmiX#Elq)8SxhT+s#H0zSXvG zCP9c{+J4I>MoZAjyOCZYZ=DK`3PkHWINKQR3pey5wuQUjT_^xDG5QN zK?(tJ6o*Y>#o9tvTtIOKo4J7;!BV+_vUCJjuyF>;1z1|lPGLim?<>VfGyH$`)x4Sc z-n@DLs1Tk$YNHtFH}Mv52=PluE7(Cbq`?&F3f&O7hjfQgh+IQTU2M@*@&sZ00000NkvXXu0mjfuOMVM literal 0 HcmV?d00001 diff --git a/Resources/Ok@2x.png b/Resources/Ok@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..f1915b84f885ce463de072db6185ffbee702968e GIT binary patch literal 363 zcmV-x0hIoUP)`$q!%F{{Kzr)=6uI<578(JD~J6nj3AiqaQ=i}h(lG;#dwnxp{qUzkvgDGs3Yo3 z5II~`gistr?OfQlw{wwpqn(Si6S|)7T#W74s3G>6iwBJLmRrDe4MlXx;q^N*;lX!M zF>f%0DylRWH#o0A#r(iC_{i~)atOs<>hRPQ(nK%BS0`lhnv0_R_bh&Z3fjQ{%H%y4 zWr=Uuum%``rT=^Llo=fdR94DC^U zvEvaMn~Tf}%+2GY+OyW!To~Wn&>q!+T`qU$KP>2|me8xq>ks$^WSTBB^J@SA002ov JPDHLkV1ka>sf_>t literal 0 HcmV?d00001 diff --git a/Resources/Rectangle.png b/Resources/Rectangle.png new file mode 100644 index 0000000000000000000000000000000000000000..49d81ea6b4e7033c300ccdbfd8b7ac056ac7683d GIT binary patch literal 176 zcmeAS@N?(olHy`uVBq!ia0vp^5bV9sh$l zo6j)Kk=Z6);G#7zrFnGH9xvXsQ4tT(EVnTT=OdE_|{FKaoucY5{YwNhv=rw*%V`*R4!0cpuQvpUfU~RH7jD=*{lJ<*}yL z$EJ#=>mQq2cJ+-!c-Wl166Lo-Hz&tL7Jf^*lNo-tuMnnC`tkX{3lCR4+Oyg3nI5;| of_gEh-0*@M?Ek_tH-D*NwiMW_C2FeQ5A+6ur>mdKI;Vst0J6wu1poj5 literal 0 HcmV?d00001 diff --git a/Support/HockeySDK.xcodeproj/project.pbxproj b/Support/HockeySDK.xcodeproj/project.pbxproj index 0ab1521d57..993fffc7ea 100644 --- a/Support/HockeySDK.xcodeproj/project.pbxproj +++ b/Support/HockeySDK.xcodeproj/project.pbxproj @@ -145,6 +145,16 @@ 9760F6C418BB4D2D00959B93 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9760F6C318BB4D2D00959B93 /* AssetsLibrary.framework */; }; 9760F6CF18BB685600959B93 /* BITImageAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 9760F6CD18BB685600959B93 /* BITImageAnnotation.h */; }; 9760F6D018BB685600959B93 /* BITImageAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 9760F6CE18BB685600959B93 /* BITImageAnnotation.m */; }; + 9782023218F81BFC00A98D8B /* Arrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 9782022818F81BFC00A98D8B /* Arrow.png */; }; + 9782023318F81BFC00A98D8B /* Arrow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9782022918F81BFC00A98D8B /* Arrow@2x.png */; }; + 9782023418F81BFC00A98D8B /* Blur.png in Resources */ = {isa = PBXBuildFile; fileRef = 9782022A18F81BFC00A98D8B /* Blur.png */; }; + 9782023518F81BFC00A98D8B /* Blur@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9782022B18F81BFC00A98D8B /* Blur@2x.png */; }; + 9782023618F81BFC00A98D8B /* Cancel.png in Resources */ = {isa = PBXBuildFile; fileRef = 9782022C18F81BFC00A98D8B /* Cancel.png */; }; + 9782023718F81BFC00A98D8B /* Cancel@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9782022D18F81BFC00A98D8B /* Cancel@2x.png */; }; + 9782023818F81BFC00A98D8B /* Ok.png in Resources */ = {isa = PBXBuildFile; fileRef = 9782022E18F81BFC00A98D8B /* Ok.png */; }; + 9782023918F81BFC00A98D8B /* Ok@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9782022F18F81BFC00A98D8B /* Ok@2x.png */; }; + 9782023A18F81BFC00A98D8B /* Rectangle.png in Resources */ = {isa = PBXBuildFile; fileRef = 9782023018F81BFC00A98D8B /* Rectangle.png */; }; + 9782023B18F81BFC00A98D8B /* Rectangle@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9782023118F81BFC00A98D8B /* Rectangle@2x.png */; }; 97F0F9FD18ABAECD00EF50AA /* iconCamera.png in Resources */ = {isa = PBXBuildFile; fileRef = 97F0F9FB18ABAECD00EF50AA /* iconCamera.png */; }; 97F0F9FE18ABAECD00EF50AA /* iconCamera@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97F0F9FC18ABAECD00EF50AA /* iconCamera@2x.png */; }; 97F0FA0518B2294D00EF50AA /* BITFeedbackMessageAttachment.m in Sources */ = {isa = PBXBuildFile; fileRef = 97F0FA0318AE5AED00EF50AA /* BITFeedbackMessageAttachment.m */; }; @@ -319,6 +329,16 @@ 9760F6C318BB4D2D00959B93 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; 9760F6CD18BB685600959B93 /* BITImageAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BITImageAnnotation.h; sourceTree = ""; }; 9760F6CE18BB685600959B93 /* BITImageAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BITImageAnnotation.m; sourceTree = ""; }; + 9782022818F81BFC00A98D8B /* Arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Arrow.png; sourceTree = ""; }; + 9782022918F81BFC00A98D8B /* Arrow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Arrow@2x.png"; sourceTree = ""; }; + 9782022A18F81BFC00A98D8B /* Blur.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Blur.png; sourceTree = ""; }; + 9782022B18F81BFC00A98D8B /* Blur@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Blur@2x.png"; sourceTree = ""; }; + 9782022C18F81BFC00A98D8B /* Cancel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Cancel.png; sourceTree = ""; }; + 9782022D18F81BFC00A98D8B /* Cancel@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Cancel@2x.png"; sourceTree = ""; }; + 9782022E18F81BFC00A98D8B /* Ok.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Ok.png; sourceTree = ""; }; + 9782022F18F81BFC00A98D8B /* Ok@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Ok@2x.png"; sourceTree = ""; }; + 9782023018F81BFC00A98D8B /* Rectangle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Rectangle.png; sourceTree = ""; }; + 9782023118F81BFC00A98D8B /* Rectangle@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Rectangle@2x.png"; sourceTree = ""; }; 97F0F9FB18ABAECD00EF50AA /* iconCamera.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = iconCamera.png; sourceTree = ""; }; 97F0F9FC18ABAECD00EF50AA /* iconCamera@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "iconCamera@2x.png"; sourceTree = ""; }; 97F0F9FF18AE375E00EF50AA /* BITImageAnnotationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BITImageAnnotationViewController.h; sourceTree = ""; }; @@ -382,6 +402,16 @@ 1E5955A415B71BDC00A03429 /* Images */ = { isa = PBXGroup; children = ( + 9782022818F81BFC00A98D8B /* Arrow.png */, + 9782022918F81BFC00A98D8B /* Arrow@2x.png */, + 9782022A18F81BFC00A98D8B /* Blur.png */, + 9782022B18F81BFC00A98D8B /* Blur@2x.png */, + 9782022C18F81BFC00A98D8B /* Cancel.png */, + 9782022D18F81BFC00A98D8B /* Cancel@2x.png */, + 9782022E18F81BFC00A98D8B /* Ok.png */, + 9782022F18F81BFC00A98D8B /* Ok@2x.png */, + 9782023018F81BFC00A98D8B /* Rectangle.png */, + 9782023118F81BFC00A98D8B /* Rectangle@2x.png */, 97F0F9FB18ABAECD00EF50AA /* iconCamera.png */, 97F0F9FC18ABAECD00EF50AA /* iconCamera@2x.png */, 1E5955BB15B71C8600A03429 /* authorize_denied.png */, @@ -860,19 +890,29 @@ files = ( 1E5955C615B71C8600A03429 /* authorize_denied.png in Resources */, 1E5955C715B71C8600A03429 /* authorize_denied@2x.png in Resources */, + 9782023B18F81BFC00A98D8B /* Rectangle@2x.png in Resources */, 1E5955CA15B71C8600A03429 /* bg.png in Resources */, 97F0F9FD18ABAECD00EF50AA /* iconCamera.png in Resources */, + 9782023618F81BFC00A98D8B /* Cancel.png in Resources */, + 9782023318F81BFC00A98D8B /* Arrow@2x.png in Resources */, + 9782023818F81BFC00A98D8B /* Ok.png in Resources */, 1E5955CB15B71C8600A03429 /* buttonHighlight.png in Resources */, 1E5955CC15B71C8600A03429 /* buttonHighlight@2x.png in Resources */, 1E5955CF15B71C8600A03429 /* IconGradient.png in Resources */, 1E5955D015B71C8600A03429 /* IconGradient@2x.png in Resources */, + 9782023218F81BFC00A98D8B /* Arrow.png in Resources */, + 9782023A18F81BFC00A98D8B /* Rectangle.png in Resources */, 1EAF20A8162DC0F600957B1D /* feedbackActivity@2x~ipad.png in Resources */, 1EAF20A9162DC0F600957B1D /* feedbackActivity~ipad.png in Resources */, + 9782023918F81BFC00A98D8B /* Ok@2x.png in Resources */, + 9782023418F81BFC00A98D8B /* Blur.png in Resources */, 1EAF20AA162DC0F600957B1D /* feedbackActiviy.png in Resources */, 1EAF20AB162DC0F600957B1D /* feedbackActiviy@2x.png in Resources */, + 9782023518F81BFC00A98D8B /* Blur@2x.png in Resources */, 1E1127C416580C87007067A2 /* buttonRoundedDelete.png in Resources */, 1E1127C516580C87007067A2 /* buttonRoundedDelete@2x.png in Resources */, 1E1127C616580C87007067A2 /* buttonRoundedDeleteHighlighted.png in Resources */, + 9782023718F81BFC00A98D8B /* Cancel@2x.png in Resources */, 1E1127C716580C87007067A2 /* buttonRoundedDeleteHighlighted@2x.png in Resources */, 1E1127C816580C87007067A2 /* buttonRoundedRegular.png in Resources */, 97F0F9FE18ABAECD00EF50AA /* iconCamera@2x.png in Resources */,