Skip to content

Commit

Permalink
some fix:
Browse files Browse the repository at this point in the history
1. add weibo sharing function
2. complete all filter adjustment
3. gallery photo re-ordering
4. add URL in About page
Only one thing left: filter icons
  • Loading branch information
Aragan123 committed Sep 6, 2013
1 parent 2e2b670 commit b66126a
Show file tree
Hide file tree
Showing 30 changed files with 141 additions and 24 deletions.
20 changes: 16 additions & 4 deletions SophiaShow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
6D1006B217A214210084D36A /* Icon-Small.png in Resources */ = {isa = PBXBuildFile; fileRef = 6D1006AD17A214210084D36A /* Icon-Small.png */; };
6D1006B317A214210084D36A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 6D1006AE17A214210084D36A /* [email protected] */; };
6D1006B417A214210084D36A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 6D1006AF17A214210084D36A /* [email protected] */; };
6D15044F17D9ACA8009DF62F /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 6D15044E17D9ACA8009DF62F /* [email protected] */; };
6D15045417D9D306009DF62F /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D15045317D9D306009DF62F /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
6D1539F016FB42A2001C0FAC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D1539EF16FB42A2001C0FAC /* UIKit.framework */; };
6D1539F216FB42A2001C0FAC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D1539F116FB42A2001C0FAC /* Foundation.framework */; };
6D1539FA16FB42A2001C0FAC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6D1539F816FB42A2001C0FAC /* InfoPlist.strings */; };
Expand Down Expand Up @@ -126,6 +128,8 @@
6D1C034717D71F9400B60640 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 6D1C033717D71F9400B60640 /* [email protected] */; };
6D1C034817D71F9400B60640 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 6D1C033817D71F9400B60640 /* [email protected] */; };
6D38AD6A17A00DD3006BA6CC /* UIImage+Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D38AD6917A00DD3006BA6CC /* UIImage+Filter.m */; };
6D3BA18E17D8B121007FC6D6 /* about_yee_cn.png in Resources */ = {isa = PBXBuildFile; fileRef = 6D3BA18C17D8B121007FC6D6 /* about_yee_cn.png */; };
6D3BA18F17D8B121007FC6D6 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 6D3BA18D17D8B121007FC6D6 /* [email protected] */; };
6D3EE3BB1746874E00A56512 /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 6D3EE3BA1746874E00A56512 /* Default-Landscape~ipad.png */; };
6D3EE3BD1746878400A56512 /* Default-Landscape@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 6D3EE3BC1746878400A56512 /* Default-Landscape@2x~ipad.png */; };
6D41CE411737968400E1145C /* BGGalleryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D41CE401737968400E1145C /* BGGalleryViewController.m */; };
Expand Down Expand Up @@ -158,7 +162,6 @@
6D6E6D0C17A900CB003E5BA2 /* about_text_en.png in Resources */ = {isa = PBXBuildFile; fileRef = 6D6E6D0817A900CA003E5BA2 /* about_text_en.png */; };
6D6E6D0D17A900CB003E5BA2 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 6D6E6D0917A900CB003E5BA2 /* [email protected] */; };
6D6E6D0E17A900CB003E5BA2 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 6D6E6D0A17A900CB003E5BA2 /* [email protected] */; };
6D763A4617D47A76005C7700 /* about_yee_cn.png in Resources */ = {isa = PBXBuildFile; fileRef = 6D763A4417D47A76005C7700 /* about_yee_cn.png */; };
6D763A4717D47A76005C7700 /* about_yee_en.png in Resources */ = {isa = PBXBuildFile; fileRef = 6D763A4517D47A76005C7700 /* about_yee_en.png */; };
6DC94617174265C50019FDA4 /* NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DC94616174265C50019FDA4 /* NSObject+Blocks.m */; };
6DCF23A9179E67B0001FE0BC /* BGHomeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6DCF23A8179E67B0001FE0BC /* BGHomeViewController.xib */; };
Expand Down Expand Up @@ -262,6 +265,8 @@
6D1006AD17A214210084D36A /* Icon-Small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-Small.png"; sourceTree = "<group>"; };
6D1006AE17A214210084D36A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
6D1006AF17A214210084D36A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
6D15044E17D9ACA8009DF62F /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
6D15045317D9D306009DF62F /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
6D1539EC16FB42A2001C0FAC /* SophiaShow.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SophiaShow.app; sourceTree = BUILT_PRODUCTS_DIR; };
6D1539EF16FB42A2001C0FAC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
6D1539F116FB42A2001C0FAC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -311,6 +316,8 @@
6D1C033817D71F9400B60640 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
6D38AD6817A00DD3006BA6CC /* UIImage+Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Filter.h"; sourceTree = "<group>"; };
6D38AD6917A00DD3006BA6CC /* UIImage+Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Filter.m"; sourceTree = "<group>"; };
6D3BA18C17D8B121007FC6D6 /* about_yee_cn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = about_yee_cn.png; sourceTree = "<group>"; };
6D3BA18D17D8B121007FC6D6 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
6D3EE3BA1746874E00A56512 /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape~ipad.png"; sourceTree = "<group>"; };
6D3EE3BC1746878400A56512 /* Default-Landscape@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape@2x~ipad.png"; sourceTree = "<group>"; };
6D41CE3F1737968400E1145C /* BGGalleryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BGGalleryViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -350,7 +357,6 @@
6D6E6D0817A900CA003E5BA2 /* about_text_en.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = about_text_en.png; sourceTree = "<group>"; };
6D6E6D0917A900CB003E5BA2 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
6D6E6D0A17A900CB003E5BA2 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
6D763A4417D47A76005C7700 /* about_yee_cn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = about_yee_cn.png; sourceTree = "<group>"; };
6D763A4517D47A76005C7700 /* about_yee_en.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = about_yee_en.png; sourceTree = "<group>"; };
6DC94615174265C50019FDA4 /* NSObject+Blocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+Blocks.h"; sourceTree = "<group>"; };
6DC94616174265C50019FDA4 /* NSObject+Blocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+Blocks.m"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -379,6 +385,7 @@
6DF84C8017A94CBE00004968 /* CoreGraphics.framework in Frameworks */,
6D1539F016FB42A2001C0FAC /* UIKit.framework in Frameworks */,
6D1539F216FB42A2001C0FAC /* Foundation.framework in Frameworks */,
6D15045417D9D306009DF62F /* Social.framework in Frameworks */,
6DE747E91731FE8800A06939 /* QuartzCore.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -484,8 +491,10 @@
6D10064E17A2121F0084D36A /* [email protected] */,
6D10064F17A2121F0084D36A /* about_en.png */,
6D10065017A2121F0084D36A /* [email protected] */,
6D763A4417D47A76005C7700 /* about_yee_cn.png */,
6D3BA18C17D8B121007FC6D6 /* about_yee_cn.png */,
6D3BA18D17D8B121007FC6D6 /* [email protected] */,
6D763A4517D47A76005C7700 /* about_yee_en.png */,
6D15044E17D9ACA8009DF62F /* [email protected] */,
6D10065117A2121F0084D36A /* background_home.jpg */,
6D10065217A2121F0084D36A /* [email protected] */,
6D10065317A2121F0084D36A /* gallerymenu_beauty.png */,
Expand Down Expand Up @@ -556,6 +565,7 @@
6D1539EE16FB42A2001C0FAC /* Frameworks */ = {
isa = PBXGroup;
children = (
6D15045317D9D306009DF62F /* Social.framework */,
6DE747E81731FE8800A06939 /* QuartzCore.framework */,
6D1539EF16FB42A2001C0FAC /* UIKit.framework */,
6D1539F116FB42A2001C0FAC /* Foundation.framework */,
Expand Down Expand Up @@ -880,7 +890,6 @@
6D0A54DC17B091DE003BFFA2 /* [email protected] in Resources */,
6D0A54DD17B091DE003BFFA2 /* borderImage04.png in Resources */,
6D0A54DE17B091DE003BFFA2 /* [email protected] in Resources */,
6D763A4617D47A76005C7700 /* about_yee_cn.png in Resources */,
6D763A4717D47A76005C7700 /* about_yee_en.png in Resources */,
6D1C031B17D71D0900B60640 /* icon_pat5.png in Resources */,
6D1C031C17D71D0900B60640 /* icon_pat6.png in Resources */,
Expand Down Expand Up @@ -912,6 +921,9 @@
6D1C034617D71F9400B60640 /* [email protected] in Resources */,
6D1C034717D71F9400B60640 /* [email protected] in Resources */,
6D1C034817D71F9400B60640 /* [email protected] in Resources */,
6D3BA18E17D8B121007FC6D6 /* about_yee_cn.png in Resources */,
6D3BA18F17D8B121007FC6D6 /* [email protected] in Resources */,
6D15044F17D9ACA8009DF62F /* [email protected] in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "SophiaShow/BGFilterAreaViewController.m"
timestampString = "399907374.932366"
timestampString = "400148858.439999"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "153"
endingLineNumber = "153"
startingLineNumber = "152"
endingLineNumber = "152"
landmarkName = "-updatePhotoFrame:"
landmarkType = "5">
</FileBreakpoint>
Expand Down
62 changes: 52 additions & 10 deletions SophiaShow/BGFilterAreaViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ - (void) setupViewsWithSourceImage: (UIImage*) srcImage{
// default photo scroll views
self.scrollView = [[[UIScrollView alloc] initWithFrame:[self calculatePhotoViewRect:self.view.frame]] autorelease];
self.scrollView.center = areaCentre;
[self.scrollView setBackgroundColor:[UIColor whiteColor]];
[self.scrollView setBackgroundColor:[UIColor colorWithRed:255.0/255 green:253.0/255 blue:250.0f/255 alpha:0.5f]];
[self.scrollView setDelegate:self];
[self.scrollView setBounces:NO];
[self.scrollView setShowsHorizontalScrollIndicator:NO];
Expand All @@ -97,12 +97,12 @@ - (void) setupViewsWithSourceImage: (UIImage*) srcImage{
// default photo view
self.photoView = [[[UIImageView alloc] initWithImage:srcImage] autorelease];
self.photoView.backgroundColor = [UIColor clearColor];
// self.scrollView.tileContainerView = self.photoView;
[self.scrollView addSubview:self.photoView]; // add views

[self.scrollView setContentSize:CGSizeMake(imageWidth, imageHeight)];
[self.scrollView setMinimumZoomScale:MIN((self.scrollView.frame.size.width / imageWidth), (self.scrollView.frame.size.height / imageHeight)) ];
[self.scrollView setZoomScale:[self.scrollView minimumZoomScale]];
[self.scrollView setMaximumZoomScale:[self calculateScrollerMaxZoom:self.scrollView.frame.size andPhotoSize:CGSizeMake(imageWidth, imageHeight)]];
[self.scrollView setZoomScale:[self.scrollView minimumZoomScale]];

// default result image view
self.resultFilterView = [[[UIImageView alloc] initWithFrame:self.scrollView.frame] autorelease];
Expand All @@ -119,7 +119,6 @@ - (void) setupViewsWithSourceImage: (UIImage*) srcImage{
self.specialForeLayer = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, areaSize.width, areaSize.height)] autorelease];
[self.specialForeLayer setBackgroundColor:[UIColor clearColor]];
[self.view addSubview:self.specialForeLayer];

}

- (void) clearContents{
Expand Down Expand Up @@ -224,18 +223,31 @@ - (void) updatePhotoFilter: (BGFilterData) data{
// UIImage *resizedImage = [data.image imageScaledToSize:self.cropedImage.size];
UIImage *resizedImage = [data.image resizeImageFromSize:data.image.size toSize:self.cropedImage.size orientation:isPortrait];
UIImage *filterImage = self.cropedImage;
NSLog(@"update photo filer brightness=%f, contrast=%f", data.brightness, data.contrast);

if (data.type == 1) { // add Differences Blending Mode of blue image with alpha 0.22
NSLog(@"Add Blue Filter");
NSString *blueImagePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingFormat:@"/Filters/filter_type1.jpg"];
UIImage *blueImage = [UIImage imageWithContentsOfFile:blueImagePath];
UIImage *resizedBlueImage = [blueImage resizeImageFromSize:blueImage.size toSize:self.cropedImage.size orientation:isPortrait];
filterImage = [filterImage imageBlendedWithImage:resizedBlueImage blendMode:kCGBlendModeDifference alpha:0.22f];

// self.resultFilterView.image = resizedBlueImage;
}

// Finally add blending
UIImage *result = [filterImage imageBlendedWithImage:resizedImage blendMode:(CGBlendMode)data.blendMode alpha:data.alpha];

// then add contrast and brightness to result image
NSLog(@"update photo filer brightness=%f, contrast=%f", data.brightness, data.contrast);
if (data.brightness != 0.0f) { // change brightness
filterImage = [filterImage brightness:data.brightness];
result = [result brightness:data.brightness];
}
if (data.contrast != 0.0f) { // change contrast
filterImage = [filterImage contrast:data.contrast];
result = [result contrast:data.contrast];
}

// Finally add blending
UIImage *result = [filterImage imageBlendedWithImage:resizedImage blendMode:(CGBlendMode)data.blendMode alpha:data.alpha];

self.resultFilterView.image = result;

}
}

Expand Down Expand Up @@ -427,4 +439,34 @@ - (void)scrollViewDidZoom:(UIScrollView *)scrollView
subView.center = CGPointMake(scrollView.contentSize.width * 0.5 + offsetX, scrollView.contentSize.height * 0.5 + offsetY);
}

//-(void)scrollViewDidZoom:(UIScrollView *)pScrollView {
// UIView *imageView = [pScrollView.subviews objectAtIndex:0];
//
// CGRect innerFrame = imageView.frame;
// CGRect scrollerBounds = pScrollView.bounds;
//
// if ( ( innerFrame.size.width < scrollerBounds.size.width ) || ( innerFrame.size.height < scrollerBounds.size.height ) )
// {
// CGFloat tempx = imageView.center.x - ( scrollerBounds.size.width / 2 );
// CGFloat tempy = imageView.center.y - ( scrollerBounds.size.height / 2 );
// CGPoint myScrollViewOffset = CGPointMake( tempx, tempy);
//
// pScrollView.contentOffset = myScrollViewOffset;
//
// }
//
// UIEdgeInsets anEdgeInset = { 0, 0, 0, 0};
// if ( scrollerBounds.size.width > innerFrame.size.width )
// {
// anEdgeInset.left = (scrollerBounds.size.width - innerFrame.size.width) / 2;
// anEdgeInset.right = -anEdgeInset.left; // I don't know why this needs to be negative, but that's what works
// }
// if ( scrollerBounds.size.height > innerFrame.size.height )
// {
// anEdgeInset.top = (scrollerBounds.size.height - innerFrame.size.height) / 2;
// anEdgeInset.bottom = -anEdgeInset.top; // I don't know why this needs to be negative, but that's what works
// }
// pScrollView.contentInset = anEdgeInset;
//}

@end
2 changes: 1 addition & 1 deletion SophiaShow/BGGlobalData.m
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ - (BGFilterData) getFilterDataByIndex: (int) index{
filterData.brightness = [resArr[4] floatValue];
filterData.contrast = [resArr[5] floatValue];

if (filterData.type == 0) {
if (filterData.type == 0 || filterData.type==1) {
// this is file
NSString *resUri = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:resArr[1]];
filterData.image = [UIImage imageWithContentsOfFile:resUri];
Expand Down
2 changes: 1 addition & 1 deletion SophiaShow/BGHomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ - (BGUIView*) bgViewWithTag:(NSInteger) tag{
NSString *yeePath = [[NSBundle mainBundle] pathForResource:@"about_yee_cn" ofType:@"png"];
UIImage * yeeImage = [UIImage imageWithContentsOfFile:yeePath];
UIButton *yeebtn = [UIButton buttonWithType:UIButtonTypeCustom];
yeebtn.frame = CGRectMake(460.0f, 460.0f, yeeImage.size.width, yeeImage.size.height);
yeebtn.frame = CGRectMake(450.0f, 442.0f, yeeImage.size.width, yeeImage.size.height);
[yeebtn setBackgroundImage:yeeImage forState:UIControlStateNormal];
[yeebtn addTarget:self action:@selector(yeePhotoButton:) forControlEvents:UIControlEventTouchUpInside];
yeebtn.tag = kTagAboutYee;
Expand Down
Loading

0 comments on commit b66126a

Please sign in to comment.