Skip to content

Commit f7c5f13

Browse files
committed
dark mode
1 parent 6189bd1 commit f7c5f13

6 files changed

Lines changed: 74 additions & 17 deletions

File tree

TZImagePickerController.xcodeproj/project.pbxproj

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@
487487
TargetAttributes = {
488488
900E657B1C2BB8D5003D9A9E = {
489489
CreatedOnToolsVersion = 7.2;
490-
DevelopmentTeam = LTFQDC2QVX;
490+
DevelopmentTeam = U5XPKW87TZ;
491491
ProvisioningStyle = Automatic;
492492
};
493493
900E65941C2BB8D5003D9A9E = {
@@ -796,10 +796,10 @@
796796
isa = XCBuildConfiguration;
797797
buildSettings = {
798798
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
799-
CODE_SIGN_IDENTITY = "";
799+
CODE_SIGN_IDENTITY = "Apple Development";
800800
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
801801
CODE_SIGN_STYLE = Automatic;
802-
DEVELOPMENT_TEAM = LTFQDC2QVX;
802+
DEVELOPMENT_TEAM = U5XPKW87TZ;
803803
FRAMEWORK_SEARCH_PATHS = (
804804
"$(inherited)",
805805
"$(PROJECT_DIR)/TZImagePickerController",
@@ -808,7 +808,7 @@
808808
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
809809
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
810810
MARKETING_VERSION = 3.3.2;
811-
PRODUCT_BUNDLE_IDENTIFIER = tanzhenios2019.TZImagePickerController.www;
811+
PRODUCT_BUNDLE_IDENTIFIER = tanzhenios2020.TZImagePickerController.www;
812812
PRODUCT_NAME = "$(TARGET_NAME)";
813813
PROVISIONING_PROFILE = "";
814814
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -820,10 +820,10 @@
820820
isa = XCBuildConfiguration;
821821
buildSettings = {
822822
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
823-
CODE_SIGN_IDENTITY = "";
823+
CODE_SIGN_IDENTITY = "Apple Development";
824824
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
825825
CODE_SIGN_STYLE = Automatic;
826-
DEVELOPMENT_TEAM = LTFQDC2QVX;
826+
DEVELOPMENT_TEAM = U5XPKW87TZ;
827827
FRAMEWORK_SEARCH_PATHS = (
828828
"$(inherited)",
829829
"$(PROJECT_DIR)/TZImagePickerController",
@@ -832,7 +832,7 @@
832832
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
833833
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
834834
MARKETING_VERSION = 3.3.2;
835-
PRODUCT_BUNDLE_IDENTIFIER = tanzhenios2019.TZImagePickerController.www;
835+
PRODUCT_BUNDLE_IDENTIFIER = tanzhenios2020.TZImagePickerController.www;
836836
PRODUCT_NAME = "$(TARGET_NAME)";
837837
PROVISIONING_PROFILE = "";
838838
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -844,6 +844,7 @@
844844
isa = XCBuildConfiguration;
845845
buildSettings = {
846846
BUNDLE_LOADER = "$(TEST_HOST)";
847+
DEVELOPMENT_TEAM = "";
847848
INFOPLIST_FILE = TZImagePickerControllerTests/Info.plist;
848849
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
849850
PRODUCT_BUNDLE_IDENTIFIER = tanzhen.TZImagePickerControllerTests;
@@ -856,6 +857,7 @@
856857
isa = XCBuildConfiguration;
857858
buildSettings = {
858859
BUNDLE_LOADER = "$(TEST_HOST)";
860+
DEVELOPMENT_TEAM = "";
859861
INFOPLIST_FILE = TZImagePickerControllerTests/Info.plist;
860862
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
861863
PRODUCT_BUNDLE_IDENTIFIER = tanzhen.TZImagePickerControllerTests;
@@ -867,6 +869,8 @@
867869
900E65B01C2BB8D5003D9A9E /* Debug */ = {
868870
isa = XCBuildConfiguration;
869871
buildSettings = {
872+
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
873+
DEVELOPMENT_TEAM = "";
870874
INFOPLIST_FILE = TZImagePickerControllerUITests/Info.plist;
871875
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
872876
PRODUCT_BUNDLE_IDENTIFIER = tanzhen.TZImagePickerControllerUITests;
@@ -879,6 +883,8 @@
879883
900E65B11C2BB8D5003D9A9E /* Release */ = {
880884
isa = XCBuildConfiguration;
881885
buildSettings = {
886+
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
887+
DEVELOPMENT_TEAM = "";
882888
INFOPLIST_FILE = TZImagePickerControllerUITests/Info.plist;
883889
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
884890
PRODUCT_BUNDLE_IDENTIFIER = tanzhen.TZImagePickerControllerUITests;

TZImagePickerController/TZImagePickerController/TZAssetCell.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,11 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr
388388
- (void)setModel:(TZAlbumModel *)model {
389389
_model = model;
390390

391-
NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:model.name attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:[UIColor blackColor]}];
391+
UIColor *nameColor = UIColor.blackColor;
392+
if (@available(iOS 13.0, *)) {
393+
nameColor = UIColor.labelColor;
394+
}
395+
NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:model.name attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:nameColor}];
392396
NSAttributedString *countString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@" (%zd)",model.count] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:[UIColor lightGrayColor]}];
393397
[nameString appendAttributedString:countString];
394398
self.titleLabel.attributedText = nameString;
@@ -440,7 +444,11 @@ - (UILabel *)titleLabel {
440444
if (_titleLabel == nil) {
441445
UILabel *titleLabel = [[UILabel alloc] init];
442446
titleLabel.font = [UIFont boldSystemFontOfSize:17];
443-
titleLabel.textColor = [UIColor blackColor];
447+
if (@available(iOS 13.0, *)) {
448+
titleLabel.textColor = UIColor.labelColor;
449+
} else {
450+
titleLabel.textColor = [UIColor blackColor];
451+
}
444452
titleLabel.textAlignment = NSTextAlignmentLeft;
445453
[self.contentView addSubview:titleLabel];
446454
_titleLabel = titleLabel;

TZImagePickerController/TZImagePickerController/TZImagePickerController.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,11 @@ - (void)configTableView {
770770
if (!self->_tableView) {
771771
self->_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
772772
self->_tableView.rowHeight = 70;
773-
self->_tableView.backgroundColor = [UIColor whiteColor];
773+
if (@available(iOS 13.0, *)) {
774+
self->_tableView.backgroundColor = [UIColor tertiarySystemBackgroundColor];
775+
} else {
776+
self->_tableView.backgroundColor = [UIColor whiteColor];
777+
}
774778
self->_tableView.tableFooterView = [[UIView alloc] init];
775779
self->_tableView.dataSource = self;
776780
self->_tableView.delegate = self;
@@ -824,6 +828,10 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
824828

825829
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
826830
TZAlbumCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TZAlbumCell"];
831+
if (@available(iOS 13.0, *)) {
832+
cell.backgroundColor = UIColor.tertiarySystemBackgroundColor;
833+
} else {
834+
}
827835
TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
828836
cell.albumCellDidLayoutSubviewsBlock = imagePickerVc.albumCellDidLayoutSubviewsBlock;
829837
cell.albumCellDidSetModelBlock = imagePickerVc.albumCellDidSetModelBlock;

TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ - (UIStatusBarStyle)preferredStatusBarStyle {
165165
- (void)configCollectionView {
166166
_layout = [[UICollectionViewFlowLayout alloc] init];
167167
_collectionView = [[TZCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:_layout];
168-
_collectionView.backgroundColor = [UIColor whiteColor];
168+
if (@available(iOS 13.0, *)) {
169+
_collectionView.backgroundColor = UIColor.tertiarySystemBackgroundColor;
170+
} else {
171+
_collectionView.backgroundColor = [UIColor whiteColor];
172+
}
169173
_collectionView.dataSource = self;
170174
_collectionView.delegate = self;
171175
_collectionView.alwaysBounceHorizontal = NO;
@@ -216,14 +220,22 @@ - (void)configBottomToolBar {
216220

217221
_bottomToolBar = [[UIView alloc] initWithFrame:CGRectZero];
218222
CGFloat rgb = 253 / 255.0;
219-
_bottomToolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:1.0];
223+
if (@available(iOS 13.0, *)) {
224+
_bottomToolBar.backgroundColor = UIColor.tertiarySystemBackgroundColor;
225+
} else {
226+
_bottomToolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:1.0];
227+
}
220228

221229
_previewButton = [UIButton buttonWithType:UIButtonTypeCustom];
222230
[_previewButton addTarget:self action:@selector(previewButtonClick) forControlEvents:UIControlEventTouchUpInside];
223231
_previewButton.titleLabel.font = [UIFont systemFontOfSize:16];
224232
[_previewButton setTitle:tzImagePickerVc.previewBtnTitleStr forState:UIControlStateNormal];
225233
[_previewButton setTitle:tzImagePickerVc.previewBtnTitleStr forState:UIControlStateDisabled];
226-
[_previewButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
234+
if (@available(iOS 13.0, *)) {
235+
[_previewButton setTitleColor:UIColor.labelColor forState:UIControlStateNormal];
236+
} else {
237+
[_previewButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
238+
}
227239
[_previewButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled];
228240
_previewButton.enabled = tzImagePickerVc.selectedModels.count;
229241

@@ -235,7 +247,11 @@ - (void)configBottomToolBar {
235247
[_originalPhotoButton setTitle:tzImagePickerVc.fullImageBtnTitleStr forState:UIControlStateNormal];
236248
[_originalPhotoButton setTitle:tzImagePickerVc.fullImageBtnTitleStr forState:UIControlStateSelected];
237249
[_originalPhotoButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
238-
[_originalPhotoButton setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
250+
if (@available(iOS 13.0, *)) {
251+
[_originalPhotoButton setTitleColor:[UIColor labelColor] forState:UIControlStateSelected];
252+
} else {
253+
[_originalPhotoButton setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
254+
}
239255
[_originalPhotoButton setImage:tzImagePickerVc.photoOriginDefImage forState:UIControlStateNormal];
240256
[_originalPhotoButton setImage:tzImagePickerVc.photoOriginSelImage forState:UIControlStateSelected];
241257
_originalPhotoButton.imageView.clipsToBounds = YES;
@@ -246,7 +262,11 @@ - (void)configBottomToolBar {
246262
_originalPhotoLabel = [[UILabel alloc] init];
247263
_originalPhotoLabel.textAlignment = NSTextAlignmentLeft;
248264
_originalPhotoLabel.font = [UIFont systemFontOfSize:16];
249-
_originalPhotoLabel.textColor = [UIColor blackColor];
265+
if (@available(iOS 13.0, *)) {
266+
_originalPhotoLabel.textColor = [UIColor labelColor];
267+
} else {
268+
_originalPhotoLabel.textColor = [UIColor blackColor];
269+
}
250270
if (_isSelectOriginalPhoto) [self getSelectedPhotoBytes];
251271
}
252272

@@ -276,7 +296,20 @@ - (void)configBottomToolBar {
276296

277297
_divideLine = [[UIView alloc] init];
278298
CGFloat rgb2 = 222 / 255.0;
279-
_divideLine.backgroundColor = [UIColor colorWithRed:rgb2 green:rgb2 blue:rgb2 alpha:1.0];
299+
if (@available(iOS 13.0, *)) {
300+
UIColor *divideLineDyColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull trainCollection) {
301+
if ([trainCollection userInterfaceStyle] == UIUserInterfaceStyleLight) {
302+
return [UIColor colorWithRed:rgb2 green:rgb2 blue:rgb2 alpha:1.0];
303+
}
304+
else {
305+
CGFloat lineDarkRgb = 100 / 255.0;
306+
return [UIColor colorWithRed:lineDarkRgb green:lineDarkRgb blue:lineDarkRgb alpha:1.0];
307+
}
308+
}];
309+
_divideLine.backgroundColor = divideLineDyColor;
310+
} else {
311+
_divideLine.backgroundColor = [UIColor colorWithRed:rgb2 green:rgb2 blue:rgb2 alpha:1.0];
312+
}
280313

281314
[_bottomToolBar addSubview:_divideLine];
282315
[_bottomToolBar addSubview:_previewButton];

TZImagePickerController/TZImagePickerController/TZVideoPlayerController.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313

1414
@property (nonatomic, strong) TZAssetModel *model;
1515

16-
@end
16+
@end
17+

TZImagePickerController/TZImagePickerController/TZVideoPlayerController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ @interface TZVideoPlayerController () {
2727
UIStatusBarStyle _originStatusBarStyle;
2828
}
2929
@property (assign, nonatomic) BOOL needShowStatusBar;
30+
3031
@end
3132

3233
#pragma clang diagnostic push

0 commit comments

Comments
 (0)