Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1 from ZZBHuang/fromPLJNS
Browse files Browse the repository at this point in the history
Trim a little for fitting code convention
  • Loading branch information
Paul Jones authored Aug 19, 2016
2 parents 23ea09a + 191e03e commit a73ca48
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 35 deletions.
6 changes: 0 additions & 6 deletions YangMingShan/YMSPhotoPicker/Private/YMSAlbumCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,5 @@
*
*/
@property (nonatomic, assign) NSUInteger photosCount;

/**
* @brief Set the font used by the two labels displaying album name and the album count
*
*/
@property (nonatomic, assign) UIFont* fontForAlbumNameAndCount;

@end
15 changes: 9 additions & 6 deletions YangMingShan/YMSPhotoPicker/Private/YMSAlbumCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "YMSAlbumCell.h"
#import "YMSPhotoPickerTheme.h"

@interface YMSAlbumCell()

Expand All @@ -18,6 +19,14 @@ @interface YMSAlbumCell()

@implementation YMSAlbumCell

- (void)awakeFromNib
{
[super awakeFromNib];

self.photosCountLabel.font = [YMSPhotoPickerTheme sharedInstance].photosCountLabelFont;
self.albumNameLabel.font = [YMSPhotoPickerTheme sharedInstance].albumNameLabelFont;
}

- (NSString *)YMS_cellIdentifier
{
return @"YMSAlbumCell";
Expand Down Expand Up @@ -46,10 +55,4 @@ - (void)setPhotosCount:(NSUInteger)photosCount
_photosCount = photosCount;
}

- (void)setFontForAlbumNameAndCount:(UIFont *)fontForAlbumNameAndCount
{
self.photosCountLabel.font = fontForAlbumNameAndCount;
self.albumNameLabel.font = fontForAlbumNameAndCount;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
PHCollection *collection = collectionItem[@"collection"];

cell.albumName = collection.localizedTitle;
cell.fontForAlbumNameAndCount = [YMSPhotoPickerTheme sharedInstance].fontForAlbumNameAndCount ?: [UIFont systemFontOfSize:18.0];
cell.photosCount = fetchResult.count;
if ([collectionItem isEqual:self.selectedCollectionItem]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
Expand Down
6 changes: 0 additions & 6 deletions YangMingShan/YMSPhotoPicker/Private/YMSPhotoCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
*/
@property (nonatomic, assign) NSUInteger selectionOrder;

/**
* @brief Set the font used for the number in the bottom right corner of the cell, specifying which order that photo was picked in
*
*/
@property (nonatomic, assign) UIFont *fontForSelectionOrder;

/**
* @brief Load the photo from photo library and display it on cell.
*
Expand Down
6 changes: 1 addition & 5 deletions YangMingShan/YMSPhotoPicker/Private/YMSPhotoCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ - (void)awakeFromNib
[self addGestureRecognizer:self.longPressGestureRecognizer];

self.selectionOrderLabel.textColor = [YMSPhotoPickerTheme sharedInstance].orderLabelTextColor;
self.selectionOrderLabel.font = [YMSPhotoPickerTheme sharedInstance].selectionOrderLabelFont;

self.selectionVeil.layer.borderWidth = 4.0;

Expand Down Expand Up @@ -83,11 +84,6 @@ - (void)dealloc
[self cancelImageRequest];
}

- (void)setFontForSelectionOrder:(UIFont *)fontForSelectionOrder
{
self.selectionOrderLabel.font = fontForSelectionOrder;
}

#pragma mark - Publics

- (void)loadPhotoWithManager:(PHImageManager *)manager forAsset:(PHAsset *)asset targetSize:(CGSize)size
Expand Down
26 changes: 16 additions & 10 deletions YangMingShan/YMSPhotoPicker/Public/YMSPhotoPickerTheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
*/
@property (nonatomic, strong) UIColor *titleLabelTextColor;

/**
* @brief Specify a UIFont that you want to apply on title label text and drop down arrow image in the middle of navigation bar to display current album localized name.
*
*/
@property (nonatomic, strong) UIFont *titleLabelFont;

/**
* @brief Describe a specific UIColor that you want to apply on whole picker view controllers' navigation bar.
*
Expand Down Expand Up @@ -70,15 +64,27 @@
@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;

/**
* @brief Specify a UIFont that you want to apply to the table view showing album and album count information
* @brief Describe a specify UIFont that you want to apply on title label text and drop down arrow image in the middle of navigation bar to display current album localized name.
*
*/
@property (nonatomic, strong) UIFont *titleLabelFont;

/**
* @brief Describe a specify UIFont that you want to apply to the table view showing album localized name.
*
*/
@property (nonatomic, strong) UIFont *albumNameLabelFont;

/**
* @brief Describe a specify UIFont that you want to apply to the table view showing photo count insdie album.
*
*/
@property (nonatomic, assign) UIFont *fontForAlbumNameAndCount;
@property (nonatomic, strong) UIFont *photosCountLabelFont;

/**
* @brief Specify a UIFont that you want to apply to the number in the bottom right of photo cells after they're selected, denoting order of selection
* @brief Describe a specify UIFont that you want to apply to the number in the bottom right of photo cells after they're selected, denoting order of selection.
*/
@property (nonatomic, assign) UIFont *fontForPhotoSelectionOrder;
@property (nonatomic, strong) UIFont *selectionOrderLabelFont;

/**
* @brief Getting a shared instance of YMSPhotoPickerTheme.
Expand Down
4 changes: 4 additions & 0 deletions YangMingShan/YMSPhotoPicker/Public/YMSPhotoPickerTheme.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ - (void)reset
self.orderLabelTextColor = self.navigationBarBackgroundColor = self.cameraIconColor = [UIColor whiteColor];
self.titleLabelTextColor = [UIColor blackColor];
self.statusBarStyle = UIStatusBarStyleDefault;
self.titleLabelFont = [UIFont systemFontOfSize:18.0];
self.albumNameLabelFont = [UIFont systemFontOfSize:18.0 weight:UIFontWeightLight];
self.photosCountLabelFont = [UIFont systemFontOfSize:18.0 weight:UIFontWeightLight];
self.selectionOrderLabelFont = [UIFont systemFontOfSize:17.0];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ - (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtInde
YMSPhotoCell *photoCell = (YMSPhotoCell *)cell;
[photoCell setNeedsAnimateSelection];
photoCell.selectionOrder = self.selectedPhotos.count+1;
photoCell.fontForSelectionOrder = self.theme.fontForPhotoSelectionOrder;
}
return YES;
}
Expand Down

0 comments on commit a73ca48

Please sign in to comment.