From 079b84cf81063c6cc113067f7531f2d634a540a7 Mon Sep 17 00:00:00 2001 From: Juan Pablo Fernandez Date: Wed, 15 May 2019 19:47:10 -0500 Subject: [PATCH 1/3] Exposed Colors --- QBImagePicker.xcodeproj/project.pbxproj | 7 ++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++ QBImagePicker/QBAlbumsViewController.m | 9 ++- QBImagePicker/QBAssetsViewController.m | 6 +- QBImagePicker/QBImagePicker.storyboard | 67 ++++++++++--------- QBImagePicker/QBImagePickerController.h | 14 ++++ QBImagePicker/QBImagePickerController.m | 15 +++++ QBImagePickerDemo/ViewController.m | 15 +++++ 8 files changed, 107 insertions(+), 34 deletions(-) create mode 100644 QBImagePicker.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/QBImagePicker.xcodeproj/project.pbxproj b/QBImagePicker.xcodeproj/project.pbxproj index 56a6f42e..e761c32e 100644 --- a/QBImagePicker.xcodeproj/project.pbxproj +++ b/QBImagePicker.xcodeproj/project.pbxproj @@ -422,9 +422,11 @@ }; AAA8FE261ACDA0CE002A9710 = { CreatedOnToolsVersion = 6.2; + DevelopmentTeam = V92SZ8966T; }; AAA8FE3E1ACDA0CE002A9710 = { CreatedOnToolsVersion = 6.2; + DevelopmentTeam = V92SZ8966T; TestTargetID = AAA8FE261ACDA0CE002A9710; }; }; @@ -434,6 +436,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ja, @@ -738,6 +741,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = V92SZ8966T; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -753,6 +757,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = V92SZ8966T; INFOPLIST_FILE = QBImagePickerDemo/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "jp.questbeat.$(PRODUCT_NAME:rfc1034identifier)"; @@ -764,6 +769,7 @@ isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + DEVELOPMENT_TEAM = V92SZ8966T; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -781,6 +787,7 @@ isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + DEVELOPMENT_TEAM = V92SZ8966T; INFOPLIST_FILE = QBImagePickerDemoTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; diff --git a/QBImagePicker.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/QBImagePicker.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/QBImagePicker.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/QBImagePicker/QBAlbumsViewController.m b/QBImagePicker/QBAlbumsViewController.m index a08dfe28..13d08e5c 100644 --- a/QBImagePicker/QBAlbumsViewController.m +++ b/QBImagePicker/QBAlbumsViewController.m @@ -47,7 +47,7 @@ - (void)viewDidLoad PHFetchResult *smartAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAny options:nil]; PHFetchResult *userAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:nil]; self.fetchResults = @[smartAlbums, userAlbums]; - + self.tableView.backgroundColor = self.imagePickerController.albumsBackgroundColor; [self updateAssetCollections]; // Register observer @@ -62,6 +62,10 @@ - (void)viewWillAppear:(BOOL)animated self.navigationItem.title = NSLocalizedStringFromTableInBundle(@"albums.title", @"QBImagePicker", self.imagePickerController.assetBundle, nil); self.navigationItem.prompt = self.imagePickerController.prompt; + self.navigationController.navigationBar.barTintColor = self.imagePickerController.navigationBarTintColor; + self.navigationController.navigationBar.tintColor = self.imagePickerController.navigationTintColor; + [self.navigationController.navigationBar setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: self.imagePickerController.navigationTitleColor, NSForegroundColorAttributeName, nil]]; + // Show/hide 'Done' button if (self.imagePickerController.allowsMultipleSelection) { [self.navigationItem setRightBarButtonItem:self.doneButton animated:NO]; @@ -277,6 +281,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N QBAlbumCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AlbumCell" forIndexPath:indexPath]; cell.tag = indexPath.row; cell.borderWidth = 1.0 / [[UIScreen mainScreen] scale]; + cell.backgroundColor = self.imagePickerController.albumCellBackgroundColor; // Thumbnail PHAssetCollection *assetCollection = self.assetCollections[indexPath.row]; @@ -356,9 +361,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N // Album title cell.titleLabel.text = assetCollection.localizedTitle; + cell.titleLabel.textColor = self.imagePickerController.albumCellTitleColor; // Number of photos cell.countLabel.text = [NSString stringWithFormat:@"%lu", (long)fetchResult.count]; + cell.countLabel.textColor = self.imagePickerController.albumCellCountColor; return cell; } diff --git a/QBImagePicker/QBAssetsViewController.m b/QBImagePicker/QBAssetsViewController.m index 98177684..cf9b1dae 100644 --- a/QBImagePicker/QBAssetsViewController.m +++ b/QBImagePicker/QBAssetsViewController.m @@ -91,6 +91,9 @@ - (void)viewWillAppear:(BOOL)animated // Configure collection view self.collectionView.allowsMultipleSelection = self.imagePickerController.allowsMultipleSelection; + self.collectionView.backgroundColor = self.imagePickerController.assetsBackgroundColor; + + self.navigationController.toolbar.barTintColor = self.imagePickerController.assetsToolbarBackgroundColor; // Show/hide 'Done' button if (self.imagePickerController.allowsMultipleSelection) { @@ -197,7 +200,7 @@ - (void)setUpToolbarItems UIBarButtonItem *rightSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:NULL]; // Info label - NSDictionary *attributes = @{ NSForegroundColorAttributeName: [UIColor blackColor] }; + NSDictionary *attributes = @{ NSForegroundColorAttributeName: self.imagePickerController.assetsToolbarTextColor }; UIBarButtonItem *infoButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:NULL]; infoButtonItem.enabled = NO; [infoButtonItem setTitleTextAttributes:attributes forState:UIControlStateNormal]; @@ -501,6 +504,7 @@ - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView // Number of assets UILabel *label = (UILabel *)[footerView viewWithTag:1]; + label.textColor = self.imagePickerController.assetCountColor; NSBundle *bundle = self.imagePickerController.assetBundle; NSUInteger numberOfPhotos = [self.fetchResult countOfAssetsWithMediaType:PHAssetMediaTypeImage]; diff --git a/QBImagePicker/QBImagePicker.storyboard b/QBImagePicker/QBImagePicker.storyboard index cba77d90..6552faa4 100644 --- a/QBImagePicker/QBImagePicker.storyboard +++ b/QBImagePicker/QBImagePicker.storyboard @@ -1,8 +1,12 @@ - - + + + + + - - + + + @@ -10,19 +14,19 @@ - + - + - + - + - + @@ -46,7 +50,7 @@ - + @@ -59,13 +63,13 @@