From 4fb513c5aed238663a87a4b35c85d92bf85c7c1a Mon Sep 17 00:00:00 2001 From: Robert Mao Date: Sun, 23 Mar 2014 22:57:46 -0700 Subject: [PATCH 1/9] add property to allow user turn on/off autoselect row --- SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h | 1 + SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h index a35539f..7f0cb40 100644 --- a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h +++ b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h @@ -39,6 +39,7 @@ UIKIT_EXTERN ALAssetsFilter * ALAssetsFilterFromQBImagePickerControllerFilterTyp @property (nonatomic, assign) QBImagePickerControllerFilterType filterType; @property (nonatomic, assign) BOOL showsCancelButton; @property (nonatomic, assign) BOOL allowsMultipleSelection; +@property (nonatomic, assign) BOOL allowsSelectRow; @property (nonatomic, assign) NSUInteger minimumNumberOfSelection; @property (nonatomic, assign) NSUInteger maximumNumberOfSelection; diff --git a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m index 4d80b8a..8949e4d 100644 --- a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m +++ b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m @@ -296,7 +296,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - QBAssetsCollectionViewController *assetsCollectionViewController = [[QBAssetsCollectionViewController alloc] initWithCollectionViewLayout:[SECollectionViewFlowLayout layoutWithAutoSelectRows:YES panToDeselect:YES autoSelectCellsBetweenTouches:YES]]; + QBAssetsCollectionViewController *assetsCollectionViewController = [[QBAssetsCollectionViewController alloc] initWithCollectionViewLayout:[SECollectionViewFlowLayout layoutWithAutoSelectRows:self.allowsSelectRow panToDeselect:YES autoSelectCellsBetweenTouches:YES]]; assetsCollectionViewController.imagePickerController = self; assetsCollectionViewController.filterType = self.filterType; assetsCollectionViewController.allowsMultipleSelection = self.allowsMultipleSelection; From 88ece3fad8f2260853f7f00decb06eb30f505507 Mon Sep 17 00:00:00 2001 From: Robert Mao Date: Sun, 23 Mar 2014 23:53:52 -0700 Subject: [PATCH 2/9] adding autoSelectCellsBetweenTouches property --- SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h | 1 + SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h index 7f0cb40..bf14161 100644 --- a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h +++ b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h @@ -40,6 +40,7 @@ UIKIT_EXTERN ALAssetsFilter * ALAssetsFilterFromQBImagePickerControllerFilterTyp @property (nonatomic, assign) BOOL showsCancelButton; @property (nonatomic, assign) BOOL allowsMultipleSelection; @property (nonatomic, assign) BOOL allowsSelectRow; +@property (nonatomic, assign) BOOL autoSelectCellsBetweenTouches; @property (nonatomic, assign) NSUInteger minimumNumberOfSelection; @property (nonatomic, assign) NSUInteger maximumNumberOfSelection; diff --git a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m index 8949e4d..f421fae 100644 --- a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m +++ b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m @@ -296,7 +296,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - QBAssetsCollectionViewController *assetsCollectionViewController = [[QBAssetsCollectionViewController alloc] initWithCollectionViewLayout:[SECollectionViewFlowLayout layoutWithAutoSelectRows:self.allowsSelectRow panToDeselect:YES autoSelectCellsBetweenTouches:YES]]; + QBAssetsCollectionViewController *assetsCollectionViewController = [[QBAssetsCollectionViewController alloc] initWithCollectionViewLayout:[SECollectionViewFlowLayout layoutWithAutoSelectRows:self.allowsSelectRow panToDeselect:YES autoSelectCellsBetweenTouches:self.autoSelectCellsBetweenTouches]]; assetsCollectionViewController.imagePickerController = self; assetsCollectionViewController.filterType = self.filterType; assetsCollectionViewController.allowsMultipleSelection = self.allowsMultipleSelection; From 21cdb164e5751e0e1b16584db391c3c5f80467d4 Mon Sep 17 00:00:00 2001 From: Robert Mao Date: Mon, 24 Mar 2014 10:41:37 -0700 Subject: [PATCH 3/9] bugfix: poster image of each group is not correct --- .../PodFiles/QBImagePickerThumbnailView.m | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/SECollectionViewFlowLayout/PodFiles/QBImagePickerThumbnailView.m b/SECollectionViewFlowLayout/PodFiles/QBImagePickerThumbnailView.m index aa525cd..270f9e9 100644 --- a/SECollectionViewFlowLayout/PodFiles/QBImagePickerThumbnailView.m +++ b/SECollectionViewFlowLayout/PodFiles/QBImagePickerThumbnailView.m @@ -67,19 +67,9 @@ - (void)drawRect:(CGRect)rect - (void)setAssetsGroup:(ALAssetsGroup *)assetsGroup { _assetsGroup = assetsGroup; - - // Extract three thumbnail images - NSIndexSet *indexes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, MIN(3, assetsGroup.numberOfAssets))]; - NSMutableArray *thumbnailImages = [NSMutableArray array]; - [assetsGroup enumerateAssetsAtIndexes:indexes - options:0 - usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) { - if (result) { - UIImage *thumbnailImage = [UIImage imageWithCGImage:[result thumbnail]]; - [thumbnailImages addObject:thumbnailImage]; - } - }]; - self.thumbnailImages = [thumbnailImages copy]; + + UIImage* posterImage = [UIImage imageWithCGImage:[assetsGroup posterImage]]; + self.thumbnailImages = @[posterImage, posterImage, posterImage]; } @end From 8af25bfacf1b61daa9a5030042a09b5ae6f6b526 Mon Sep 17 00:00:00 2001 From: Haitao Li Date: Sat, 10 May 2014 23:15:22 -0700 Subject: [PATCH 4/9] Add resource files --- .../project.pbxproj | 23 +++++++++++++++++++ .../en.lproj/QBImagePickerController.strings | 13 +++++++++++ .../ja.lproj/QBImagePickerController.strings | 13 +++++++++++ 3 files changed, 49 insertions(+) create mode 100644 SECollectionViewFlowLayout/Resources/en.lproj/QBImagePickerController.strings create mode 100644 SECollectionViewFlowLayout/Resources/ja.lproj/QBImagePickerController.strings diff --git a/SECollectionViewFlowLayout.xcodeproj/project.pbxproj b/SECollectionViewFlowLayout.xcodeproj/project.pbxproj index ddc2120..431f813 100644 --- a/SECollectionViewFlowLayout.xcodeproj/project.pbxproj +++ b/SECollectionViewFlowLayout.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ AF24726218B32D8D00614655 /* QBAssetsCollectionFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = AF24725518B32D8D00614655 /* QBAssetsCollectionFooterView.m */; }; AF24726318B32D8D00614655 /* QBImagePickerGroupCell.m in Sources */ = {isa = PBXBuildFile; fileRef = AF24725A18B32D8D00614655 /* QBImagePickerGroupCell.m */; }; AF24726418B32D8D00614655 /* QBImagePickerThumbnailView.m in Sources */ = {isa = PBXBuildFile; fileRef = AF24725C18B32D8D00614655 /* QBImagePickerThumbnailView.m */; }; + B24127FC191F4B2F00676122 /* QBImagePickerController.strings in Resources */ = {isa = PBXBuildFile; fileRef = B24127F9191F4B2F00676122 /* QBImagePickerController.strings */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -80,6 +81,8 @@ AF24725A18B32D8D00614655 /* QBImagePickerGroupCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = QBImagePickerGroupCell.m; path = PodFiles/QBImagePickerGroupCell.m; sourceTree = ""; }; AF24725B18B32D8D00614655 /* QBImagePickerThumbnailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QBImagePickerThumbnailView.h; path = PodFiles/QBImagePickerThumbnailView.h; sourceTree = ""; }; AF24725C18B32D8D00614655 /* QBImagePickerThumbnailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = QBImagePickerThumbnailView.m; path = PodFiles/QBImagePickerThumbnailView.m; sourceTree = ""; }; + B24127FA191F4B2F00676122 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/QBImagePickerController.strings; sourceTree = ""; }; + B24127FB191F4B2F00676122 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/QBImagePickerController.strings; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -199,6 +202,7 @@ AF24725A18B32D8D00614655 /* QBImagePickerGroupCell.m */, AF24725B18B32D8D00614655 /* QBImagePickerThumbnailView.h */, AF24725C18B32D8D00614655 /* QBImagePickerThumbnailView.m */, + B24127F8191F4B2F00676122 /* Resources */, ); name = QBImagePickerController; sourceTree = ""; @@ -213,6 +217,14 @@ name = PodFiles; sourceTree = ""; }; + B24127F8191F4B2F00676122 /* Resources */ = { + isa = PBXGroup; + children = ( + B24127F9191F4B2F00676122 /* QBImagePickerController.strings */, + ); + path = Resources; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -273,6 +285,7 @@ knownRegions = ( en, Base, + ja, ); mainGroup = AF2471EE18B30BAD00614655; productRefGroup = AF2471F818B30BAD00614655 /* Products */; @@ -293,6 +306,7 @@ AF24721318B30BAD00614655 /* Images.xcassets in Resources */, AF24720518B30BAD00614655 /* InfoPlist.strings in Resources */, AF24720E18B30BAD00614655 /* Main.storyboard in Resources */, + B24127FC191F4B2F00676122 /* QBImagePickerController.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -369,6 +383,15 @@ name = InfoPlist.strings; sourceTree = ""; }; + B24127F9191F4B2F00676122 /* QBImagePickerController.strings */ = { + isa = PBXVariantGroup; + children = ( + B24127FA191F4B2F00676122 /* en */, + B24127FB191F4B2F00676122 /* ja */, + ); + name = QBImagePickerController.strings; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ diff --git a/SECollectionViewFlowLayout/Resources/en.lproj/QBImagePickerController.strings b/SECollectionViewFlowLayout/Resources/en.lproj/QBImagePickerController.strings new file mode 100644 index 0000000..0ae19c8 --- /dev/null +++ b/SECollectionViewFlowLayout/Resources/en.lproj/QBImagePickerController.strings @@ -0,0 +1,13 @@ +/* + QBImagePickerController.strings + QBImagePickerControllerDemo + + Created by Tanaka Katsuma on 2014/01/01. + Copyright (c) 2014年 Katsuma Tanaka. All rights reserved. +*/ + +"title" = "Photos"; + +"format_photos_and_videos" = "%ld Photos, %ld Videos"; +"format_photos" = "%ld Photos"; +"format_videos" = "%ld Videos"; diff --git a/SECollectionViewFlowLayout/Resources/ja.lproj/QBImagePickerController.strings b/SECollectionViewFlowLayout/Resources/ja.lproj/QBImagePickerController.strings new file mode 100644 index 0000000..15afa95 --- /dev/null +++ b/SECollectionViewFlowLayout/Resources/ja.lproj/QBImagePickerController.strings @@ -0,0 +1,13 @@ +/* + QBImagePickerController.strings + QBImagePickerControllerDemo + + Created by Tanaka Katsuma on 2014/01/01. + Copyright (c) 2014年 Katsuma Tanaka. All rights reserved. +*/ + +"title" = "アルバム"; + +"format_photos_and_videos" = "写真%ld枚、ビデオ%ld本"; +"format_photos" = "写真%ld枚"; +"format_videos" = "ビデオ%ld本"; From 8722d69b3a21a3d684c5aa71167d05ffa3d84af3 Mon Sep 17 00:00:00 2001 From: Haitao Li Date: Sat, 10 May 2014 23:33:05 -0700 Subject: [PATCH 5/9] Add resource files to podspec --- SEQBImagePickerController.podspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SEQBImagePickerController.podspec b/SEQBImagePickerController.podspec index da09da5..c5f4b5e 100644 --- a/SEQBImagePickerController.podspec +++ b/SEQBImagePickerController.podspec @@ -7,7 +7,9 @@ Pod::Spec.new do |s| s.license = 'MIT' s.source = { :git => 'https://github.com/CEWendel/SECollectionViewFlowLayout.git', :tag => '0.0.1' } s.source_files = 'SECollectionViewFlowLayout/PodFiles/*.{h,m}' + s.resources = 'SECollectionViewFlowLayout/PodFiles/Resources' s.platform = :ios s.ios.deployment_target = '6.0' s.requires_arc = true + end From 00846a1b7d16cde2af1b6e970f44f7f2cace099a Mon Sep 17 00:00:00 2001 From: haitaoli Date: Sat, 10 May 2014 23:51:10 -0700 Subject: [PATCH 6/9] Update SEQBImagePickerController.podspec --- SEQBImagePickerController.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SEQBImagePickerController.podspec b/SEQBImagePickerController.podspec index c5f4b5e..548d919 100644 --- a/SEQBImagePickerController.podspec +++ b/SEQBImagePickerController.podspec @@ -7,7 +7,7 @@ Pod::Spec.new do |s| s.license = 'MIT' s.source = { :git => 'https://github.com/CEWendel/SECollectionViewFlowLayout.git', :tag => '0.0.1' } s.source_files = 'SECollectionViewFlowLayout/PodFiles/*.{h,m}' - s.resources = 'SECollectionViewFlowLayout/PodFiles/Resources' + s.resources = 'SECollectionViewFlowLayout/Resources' s.platform = :ios s.ios.deployment_target = '6.0' s.requires_arc = true From 9798aafb5a737304124b69a31a111c8aa2b541f0 Mon Sep 17 00:00:00 2001 From: Haitao Li Date: Sun, 11 May 2014 00:17:06 -0700 Subject: [PATCH 7/9] Rename Resources folder --- .../en.lproj/QBImagePickerController.strings | 0 .../ja.lproj}/InfoPlist.strings | 0 .../ja.lproj/QBImagePickerController.strings | 0 SEQBImagePickerController.podspec | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename SECollectionViewFlowLayout/{Resources => SECollectionViewFlowLayout.bundle}/en.lproj/QBImagePickerController.strings (100%) rename SECollectionViewFlowLayout/{en.lproj => SECollectionViewFlowLayout.bundle/ja.lproj}/InfoPlist.strings (100%) rename SECollectionViewFlowLayout/{Resources => SECollectionViewFlowLayout.bundle}/ja.lproj/QBImagePickerController.strings (100%) diff --git a/SECollectionViewFlowLayout/Resources/en.lproj/QBImagePickerController.strings b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/en.lproj/QBImagePickerController.strings similarity index 100% rename from SECollectionViewFlowLayout/Resources/en.lproj/QBImagePickerController.strings rename to SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/en.lproj/QBImagePickerController.strings diff --git a/SECollectionViewFlowLayout/en.lproj/InfoPlist.strings b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/ja.lproj/InfoPlist.strings similarity index 100% rename from SECollectionViewFlowLayout/en.lproj/InfoPlist.strings rename to SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/ja.lproj/InfoPlist.strings diff --git a/SECollectionViewFlowLayout/Resources/ja.lproj/QBImagePickerController.strings b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/ja.lproj/QBImagePickerController.strings similarity index 100% rename from SECollectionViewFlowLayout/Resources/ja.lproj/QBImagePickerController.strings rename to SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/ja.lproj/QBImagePickerController.strings diff --git a/SEQBImagePickerController.podspec b/SEQBImagePickerController.podspec index 548d919..92ec273 100644 --- a/SEQBImagePickerController.podspec +++ b/SEQBImagePickerController.podspec @@ -7,7 +7,7 @@ Pod::Spec.new do |s| s.license = 'MIT' s.source = { :git => 'https://github.com/CEWendel/SECollectionViewFlowLayout.git', :tag => '0.0.1' } s.source_files = 'SECollectionViewFlowLayout/PodFiles/*.{h,m}' - s.resources = 'SECollectionViewFlowLayout/Resources' + s.resources = 'SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle' s.platform = :ios s.ios.deployment_target = '6.0' s.requires_arc = true From 2411830d17668fbb42108207f2b6a406c3aa95a6 Mon Sep 17 00:00:00 2001 From: Haitao Li Date: Sun, 11 May 2014 00:19:45 -0700 Subject: [PATCH 8/9] add InfoPlist.strings --- .../en.lproj/InfoPlist.strings | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/en.lproj/InfoPlist.strings diff --git a/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/en.lproj/InfoPlist.strings b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + From 65f7e67fd6c19cae10b3a7c205762c415daae01d Mon Sep 17 00:00:00 2001 From: haitaoli Date: Sun, 11 May 2014 10:09:51 -0700 Subject: [PATCH 9/9] Update SEQBImagePickerController.podspec --- SEQBImagePickerController.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SEQBImagePickerController.podspec b/SEQBImagePickerController.podspec index 92ec273..a210411 100644 --- a/SEQBImagePickerController.podspec +++ b/SEQBImagePickerController.podspec @@ -7,7 +7,7 @@ Pod::Spec.new do |s| s.license = 'MIT' s.source = { :git => 'https://github.com/CEWendel/SECollectionViewFlowLayout.git', :tag => '0.0.1' } s.source_files = 'SECollectionViewFlowLayout/PodFiles/*.{h,m}' - s.resources = 'SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle' + s.resources = 'SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/*.lproj' s.platform = :ios s.ios.deployment_target = '6.0' s.requires_arc = true