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 #12 from PLJNS/master
Browse files Browse the repository at this point in the history
#11 customizable fonts
  • Loading branch information
ZZBHuang authored Aug 19, 2016
2 parents eaef77e + 40e5772 commit 96952a7
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
9 changes: 9 additions & 0 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
1 change: 1 addition & 0 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
23 changes: 23 additions & 0 deletions YangMingShan/YMSPhotoPicker/Public/YMSPhotoPickerTheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,29 @@
*/
@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;

/**
* @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, strong) UIFont *photosCountLabelFont;

/**
* @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, 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 @@ -419,7 +419,7 @@ - (void)updateViewWithCollectionItem:(NSDictionary *)collectionItem

UIButton *albumButton = [UIButton buttonWithType:UIButtonTypeSystem];
albumButton.tintColor = self.theme.titleLabelTextColor;
albumButton.titleLabel.font = [UIFont systemFontOfSize:18.0];
albumButton.titleLabel.font = self.theme.titleLabelFont;
[albumButton addTarget:self action:@selector(presentAlbumPickerView:) forControlEvents:UIControlEventTouchUpInside];
[albumButton setTitle:photoCollection.localizedTitle forState:UIControlStateNormal];
UIImage *arrowDownImage = [UIImage imageNamed:@"YMSIconSpinnerDropdwon" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
Expand Down

0 comments on commit 96952a7

Please sign in to comment.