Browse files

Merge remote-tracking branch 'origin/master'

  • Loading branch information...
2 parents b965ffb + 7d114d8 commit 7f286fce5213a7380e5157c155a404b994e1ff9c @kent013 committed May 27, 2012
View
10 tottepost.xcodeproj/project.pbxproj
@@ -1098,6 +1098,9 @@
79F58B6C152B3E8200EB98F5 /* PhotoSubmitterImageEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F58B67152B3E8200EB98F5 /* PhotoSubmitterImageEntity.m */; };
79F58B6D152B3E8200EB98F5 /* PhotoSubmitterVideoEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F58B69152B3E8200EB98F5 /* PhotoSubmitterVideoEntity.m */; };
EA76226F14D0312100C54159 /* AVFoundationFlashButton.m in Sources */ = {isa = PBXBuildFile; fileRef = EA76226E14D0312100C54159 /* AVFoundationFlashButton.m */; };
+ EAA92B13157253C100F618CA /* FlashView.m in Sources */ = {isa = PBXBuildFile; fileRef = EAA92B12157253C100F618CA /* FlashView.m */; };
+ EAA92B141572568D00F618CA /* FlashView.m in Sources */ = {isa = PBXBuildFile; fileRef = EAA92B12157253C100F618CA /* FlashView.m */; };
+ EAA92B15157256B300F618CA /* FlashView.m in Sources */ = {isa = PBXBuildFile; fileRef = EAA92B12157253C100F618CA /* FlashView.m */; };
EAAC412614E939AD00CDC2CC /* HPGrowingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = EAAC412314E939AD00CDC2CC /* HPGrowingTextView.m */; };
EAAC412714E939AD00CDC2CC /* HPTextViewInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = EAAC412514E939AD00CDC2CC /* HPTextViewInternal.m */; };
/* End PBXBuildFile section */
@@ -2485,6 +2488,8 @@
79F58B69152B3E8200EB98F5 /* PhotoSubmitterVideoEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhotoSubmitterVideoEntity.m; sourceTree = "<group>"; };
EA76226D14D0312100C54159 /* AVFoundationFlashButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AVFoundationFlashButton.h; path = Libraries/AVFoundationCameraController/AVFoundationFlashButton.h; sourceTree = "<group>"; };
EA76226E14D0312100C54159 /* AVFoundationFlashButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AVFoundationFlashButton.m; path = Libraries/AVFoundationCameraController/AVFoundationFlashButton.m; sourceTree = "<group>"; };
+ EAA92B11157253C100F618CA /* FlashView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlashView.h; sourceTree = "<group>"; };
+ EAA92B12157253C100F618CA /* FlashView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FlashView.m; sourceTree = "<group>"; };
EAAC412214E939AD00CDC2CC /* HPGrowingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HPGrowingTextView.h; path = Libraries/HPGrowingTextView/HPGrowingTextView.h; sourceTree = "<group>"; };
EAAC412314E939AD00CDC2CC /* HPGrowingTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HPGrowingTextView.m; path = Libraries/HPGrowingTextView/HPGrowingTextView.m; sourceTree = "<group>"; };
EAAC412414E939AD00CDC2CC /* HPTextViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HPTextViewInternal.h; path = Libraries/HPGrowingTextView/HPTextViewInternal.h; sourceTree = "<group>"; };
@@ -2582,6 +2587,8 @@
children = (
79E7052715135C82000C792B /* CameraModeSwitchView.h */,
79E7052815135C82000C792B /* CameraModeSwitchView.m */,
+ EAA92B11157253C100F618CA /* FlashView.h */,
+ EAA92B12157253C100F618CA /* FlashView.m */,
376A8D5E14A24A9E00637B68 /* MainViewControllerConstants.h */,
37FB64DB1496238600387490 /* MainViewController.h */,
37FB64DC1496238600387490 /* MainViewController.m */,
@@ -5695,6 +5702,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ EAA92B141572568D00F618CA /* FlashView.m in Sources */,
7995E52614F29F8D005C1453 /* ScreenStatus.m in Sources */,
376E15491494C47800A34E7D /* main.m in Sources */,
376E154D1494C47800A34E7D /* AppDelegate.m in Sources */,
@@ -6042,13 +6050,15 @@
buildActionMask = 2147483647;
files = (
376E15621494C47800A34E7D /* tottepostTests.m in Sources */,
+ EAA92B13157253C100F618CA /* FlashView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
79924B45150CAE180043C16D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ EAA92B15157256B300F618CA /* FlashView.m in Sources */,
79924B46150CAE180043C16D /* ScreenStatus.m in Sources */,
79924B47150CAE180043C16D /* main.m in Sources */,
79924B48150CAE180043C16D /* AppDelegate.m in Sources */,
View
19 tottepost/FlashView.h
@@ -0,0 +1,19 @@
+//
+// FlashView.h
+// SketchTest
+//
+// Created by Ken Watanabe on 12/05/27.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface FlashView : UIView{
+ NSTimeInterval flashInterval_;
+ float firstAlpha_;
+}
+
+- (void) flash;
+
+@property (nonatomic,assign) NSTimeInterval flashInterval;
+
+@end
View
35 tottepost/FlashView.m
@@ -0,0 +1,35 @@
+//
+// FlashView.m
+// SketchTest
+//
+// Created by Ken Watanabe on 12/05/27.
+//
+
+#import "FlashView.h"
+
+@implementation FlashView
+@synthesize flashInterval = flashInterval_;
+
+- (id)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self) {
+ self.backgroundColor = [UIColor colorWithWhite:1.0f alpha:1.0f];
+ self.alpha = 0.0f;
+ firstAlpha_ = 0.8f;
+ flashInterval_ = 0.4f;
+ }
+ return self;
+}
+
+// flash this view
+-(void)flash{
+ self.alpha = firstAlpha_;
+ CGContextRef context = UIGraphicsGetCurrentContext();
+ [UIView beginAnimations:nil context:context];
+ [UIView setAnimationDuration:flashInterval_];
+ self.alpha = 0.0f;
+ [UIView commitAnimations];
+}
+
+@end
View
2 tottepost/MainViewController.h
@@ -18,6 +18,7 @@
#import "PhotoSubmitterAccountTableViewController.h"
#import "CameraModeSwitchView.h"
#import "UVDelegate.h"
+#import "FlashView.h"
/*!
* Main view controller
@@ -42,6 +43,7 @@
__strong UIImageView *cameraIconImageView_;
__strong CameraModeSwitchView *cameraModeSwitchView_;
__strong id<PhotoSubmitterServiceSettingTableViewDelegate> settingTableViewDelegate_;
+ __strong FlashView *flashView_;
UIDeviceOrientation orientation_;
UIDeviceOrientation lastOrientation_;
BOOL refreshCameraNeeded_;
View
6 tottepost/MainViewController.m
@@ -166,6 +166,10 @@ - (void) setupInitialState: (CGRect) aFrame{
launchImageView_ = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]];
[self.view addSubview:launchImageView_];
}
+
+ //flashView
+ flashView_ = [[FlashView alloc] initWithFrame:CGRectMake(0, 0, aFrame.size.width, aFrame.size.height - MAINVIEW_TOOLBAR_HEIGHT)];
+ [self.view addSubview:flashView_];
}
/*!
@@ -289,6 +293,8 @@ - (void)didCameraButtonTapped:(id)sender
#else
[imagePicker_ takePicture];
#endif
+ [self.view bringSubviewToFront:flashView_];
+ [flashView_ flash];
}else{
if(cameraButton_.enabled == NO){
return;

0 comments on commit 7f286fc

Please sign in to comment.