Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
dz_TZImagePickerController
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shuijing
dz_TZImagePickerController
Commits
a19d719d
Unverified
Commit
a19d719d
authored
Sep 24, 2020
by
谭真
Committed by
GitHub
Sep 24, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1382 from iiHorizon/master
support dark mode
parents
700c982c
7a087f9d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
10 deletions
+62
-10
TZImagePickerController/TZImagePickerController/TZAssetCell.m
...agePickerController/TZImagePickerController/TZAssetCell.m
+10
-2
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
...troller/TZImagePickerController/TZImagePickerController.m
+9
-1
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
...troller/TZImagePickerController/TZPhotoPickerController.m
+39
-6
TZImagePickerController/TZImagePickerController/TZVideoPlayerController.h
...troller/TZImagePickerController/TZVideoPlayerController.h
+2
-1
TZImagePickerController/TZImagePickerController/TZVideoPlayerController.m
...troller/TZImagePickerController/TZVideoPlayerController.m
+2
-0
No files found.
TZImagePickerController/TZImagePickerController/TZAssetCell.m
View file @
a19d719d
...
@@ -408,7 +408,11 @@
...
@@ -408,7 +408,11 @@
-
(
void
)
setModel
:(
TZAlbumModel
*
)
model
{
-
(
void
)
setModel
:(
TZAlbumModel
*
)
model
{
_model
=
model
;
_model
=
model
;
NSMutableAttributedString
*
nameString
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
model
.
name
attributes
:@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
16
],
NSForegroundColorAttributeName
:
[
UIColor
blackColor
]}];
UIColor
*
nameColor
=
UIColor
.
blackColor
;
if
(
@available
(
iOS
13
.
0
,
*
))
{
nameColor
=
UIColor
.
labelColor
;
}
NSMutableAttributedString
*
nameString
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
model
.
name
attributes
:@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
16
],
NSForegroundColorAttributeName
:
nameColor
}];
NSAttributedString
*
countString
=
[[
NSAttributedString
alloc
]
initWithString
:[
NSString
stringWithFormat
:
@" (%zd)"
,
model
.
count
]
attributes
:@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
16
],
NSForegroundColorAttributeName
:
[
UIColor
lightGrayColor
]}];
NSAttributedString
*
countString
=
[[
NSAttributedString
alloc
]
initWithString
:[
NSString
stringWithFormat
:
@" (%zd)"
,
model
.
count
]
attributes
:@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
16
],
NSForegroundColorAttributeName
:
[
UIColor
lightGrayColor
]}];
[
nameString
appendAttributedString
:
countString
];
[
nameString
appendAttributedString
:
countString
];
self
.
titleLabel
.
attributedText
=
nameString
;
self
.
titleLabel
.
attributedText
=
nameString
;
...
@@ -461,7 +465,11 @@
...
@@ -461,7 +465,11 @@
if
(
_titleLabel
==
nil
)
{
if
(
_titleLabel
==
nil
)
{
UILabel
*
titleLabel
=
[[
UILabel
alloc
]
init
];
UILabel
*
titleLabel
=
[[
UILabel
alloc
]
init
];
titleLabel
.
font
=
[
UIFont
boldSystemFontOfSize
:
17
];
titleLabel
.
font
=
[
UIFont
boldSystemFontOfSize
:
17
];
titleLabel
.
textColor
=
[
UIColor
blackColor
];
if
(
@available
(
iOS
13
.
0
,
*
))
{
titleLabel
.
textColor
=
UIColor
.
labelColor
;
}
else
{
titleLabel
.
textColor
=
[
UIColor
blackColor
];
}
titleLabel
.
textAlignment
=
NSTextAlignmentLeft
;
titleLabel
.
textAlignment
=
NSTextAlignmentLeft
;
[
self
.
contentView
addSubview
:
titleLabel
];
[
self
.
contentView
addSubview
:
titleLabel
];
_titleLabel
=
titleLabel
;
_titleLabel
=
titleLabel
;
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
View file @
a19d719d
...
@@ -777,7 +777,11 @@
...
@@ -777,7 +777,11 @@
if
(
!
self
->
_tableView
)
{
if
(
!
self
->
_tableView
)
{
self
->
_tableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectZero
style
:
UITableViewStylePlain
];
self
->
_tableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectZero
style
:
UITableViewStylePlain
];
self
->
_tableView
.
rowHeight
=
70
;
self
->
_tableView
.
rowHeight
=
70
;
self
->
_tableView
.
backgroundColor
=
[
UIColor
whiteColor
];
if
(
@available
(
iOS
13
.
0
,
*
))
{
self
->
_tableView
.
backgroundColor
=
[
UIColor
tertiarySystemBackgroundColor
];
}
else
{
self
->
_tableView
.
backgroundColor
=
[
UIColor
whiteColor
];
}
self
->
_tableView
.
tableFooterView
=
[[
UIView
alloc
]
init
];
self
->
_tableView
.
tableFooterView
=
[[
UIView
alloc
]
init
];
self
->
_tableView
.
dataSource
=
self
;
self
->
_tableView
.
dataSource
=
self
;
self
->
_tableView
.
delegate
=
self
;
self
->
_tableView
.
delegate
=
self
;
...
@@ -847,6 +851,10 @@
...
@@ -847,6 +851,10 @@
-
(
UITableViewCell
*
)
tableView
:(
UITableView
*
)
tableView
cellForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
-
(
UITableViewCell
*
)
tableView
:(
UITableView
*
)
tableView
cellForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
TZAlbumCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"TZAlbumCell"
];
TZAlbumCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"TZAlbumCell"
];
if
(
@available
(
iOS
13
.
0
,
*
))
{
cell
.
backgroundColor
=
UIColor
.
tertiarySystemBackgroundColor
;
}
else
{
}
TZImagePickerController
*
imagePickerVc
=
(
TZImagePickerController
*
)
self
.
navigationController
;
TZImagePickerController
*
imagePickerVc
=
(
TZImagePickerController
*
)
self
.
navigationController
;
cell
.
albumCellDidLayoutSubviewsBlock
=
imagePickerVc
.
albumCellDidLayoutSubviewsBlock
;
cell
.
albumCellDidLayoutSubviewsBlock
=
imagePickerVc
.
albumCellDidLayoutSubviewsBlock
;
cell
.
albumCellDidSetModelBlock
=
imagePickerVc
.
albumCellDidSetModelBlock
;
cell
.
albumCellDidSetModelBlock
=
imagePickerVc
.
albumCellDidSetModelBlock
;
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
View file @
a19d719d
...
@@ -166,7 +166,11 @@ static CGFloat itemMargin = 5;
...
@@ -166,7 +166,11 @@ static CGFloat itemMargin = 5;
if
(
!
_collectionView
)
{
if
(
!
_collectionView
)
{
_layout
=
[[
UICollectionViewFlowLayout
alloc
]
init
];
_layout
=
[[
UICollectionViewFlowLayout
alloc
]
init
];
_collectionView
=
[[
TZCollectionView
alloc
]
initWithFrame
:
CGRectZero
collectionViewLayout
:
_layout
];
_collectionView
=
[[
TZCollectionView
alloc
]
initWithFrame
:
CGRectZero
collectionViewLayout
:
_layout
];
_collectionView
.
backgroundColor
=
[
UIColor
whiteColor
];
if
(
@available
(
iOS
13
.
0
,
*
))
{
_collectionView
.
backgroundColor
=
UIColor
.
tertiarySystemBackgroundColor
;
}
else
{
_collectionView
.
backgroundColor
=
[
UIColor
whiteColor
];
}
_collectionView
.
dataSource
=
self
;
_collectionView
.
dataSource
=
self
;
_collectionView
.
delegate
=
self
;
_collectionView
.
delegate
=
self
;
_collectionView
.
alwaysBounceHorizontal
=
NO
;
_collectionView
.
alwaysBounceHorizontal
=
NO
;
...
@@ -177,6 +181,7 @@ static CGFloat itemMargin = 5;
...
@@ -177,6 +181,7 @@ static CGFloat itemMargin = 5;
}
else
{
}
else
{
[
_collectionView
reloadData
];
[
_collectionView
reloadData
];
}
}
if
(
_showTakePhotoBtn
)
{
if
(
_showTakePhotoBtn
)
{
_collectionView
.
contentSize
=
CGSizeMake
(
self
.
view
.
tz_width
,
((
_model
.
count
+
self
.
columnNumber
)
/
self
.
columnNumber
)
*
self
.
view
.
tz_width
);
_collectionView
.
contentSize
=
CGSizeMake
(
self
.
view
.
tz_width
,
((
_model
.
count
+
self
.
columnNumber
)
/
self
.
columnNumber
)
*
self
.
view
.
tz_width
);
...
@@ -224,14 +229,22 @@ static CGFloat itemMargin = 5;
...
@@ -224,14 +229,22 @@ static CGFloat itemMargin = 5;
_bottomToolBar
=
[[
UIView
alloc
]
initWithFrame
:
CGRectZero
];
_bottomToolBar
=
[[
UIView
alloc
]
initWithFrame
:
CGRectZero
];
CGFloat
rgb
=
253
/
255
.
0
;
CGFloat
rgb
=
253
/
255
.
0
;
_bottomToolBar
.
backgroundColor
=
[
UIColor
colorWithRed
:
rgb
green
:
rgb
blue
:
rgb
alpha
:
1
.
0
];
if
(
@available
(
iOS
13
.
0
,
*
))
{
_bottomToolBar
.
backgroundColor
=
UIColor
.
tertiarySystemBackgroundColor
;
}
else
{
_bottomToolBar
.
backgroundColor
=
[
UIColor
colorWithRed
:
rgb
green
:
rgb
blue
:
rgb
alpha
:
1
.
0
];
}
_previewButton
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
_previewButton
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
_previewButton
addTarget
:
self
action
:
@selector
(
previewButtonClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
_previewButton
addTarget
:
self
action
:
@selector
(
previewButtonClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
_previewButton
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
];
_previewButton
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
];
[
_previewButton
setTitle
:
tzImagePickerVc
.
previewBtnTitleStr
forState
:
UIControlStateNormal
];
[
_previewButton
setTitle
:
tzImagePickerVc
.
previewBtnTitleStr
forState
:
UIControlStateNormal
];
[
_previewButton
setTitle
:
tzImagePickerVc
.
previewBtnTitleStr
forState
:
UIControlStateDisabled
];
[
_previewButton
setTitle
:
tzImagePickerVc
.
previewBtnTitleStr
forState
:
UIControlStateDisabled
];
[
_previewButton
setTitleColor
:[
UIColor
blackColor
]
forState
:
UIControlStateNormal
];
if
(
@available
(
iOS
13
.
0
,
*
))
{
[
_previewButton
setTitleColor
:
UIColor
.
labelColor
forState
:
UIControlStateNormal
];
}
else
{
[
_previewButton
setTitleColor
:[
UIColor
blackColor
]
forState
:
UIControlStateNormal
];
}
[
_previewButton
setTitleColor
:[
UIColor
lightGrayColor
]
forState
:
UIControlStateDisabled
];
[
_previewButton
setTitleColor
:[
UIColor
lightGrayColor
]
forState
:
UIControlStateDisabled
];
_previewButton
.
enabled
=
tzImagePickerVc
.
selectedModels
.
count
;
_previewButton
.
enabled
=
tzImagePickerVc
.
selectedModels
.
count
;
...
@@ -243,7 +256,11 @@ static CGFloat itemMargin = 5;
...
@@ -243,7 +256,11 @@ static CGFloat itemMargin = 5;
[
_originalPhotoButton
setTitle
:
tzImagePickerVc
.
fullImageBtnTitleStr
forState
:
UIControlStateNormal
];
[
_originalPhotoButton
setTitle
:
tzImagePickerVc
.
fullImageBtnTitleStr
forState
:
UIControlStateNormal
];
[
_originalPhotoButton
setTitle
:
tzImagePickerVc
.
fullImageBtnTitleStr
forState
:
UIControlStateSelected
];
[
_originalPhotoButton
setTitle
:
tzImagePickerVc
.
fullImageBtnTitleStr
forState
:
UIControlStateSelected
];
[
_originalPhotoButton
setTitleColor
:[
UIColor
lightGrayColor
]
forState
:
UIControlStateNormal
];
[
_originalPhotoButton
setTitleColor
:[
UIColor
lightGrayColor
]
forState
:
UIControlStateNormal
];
[
_originalPhotoButton
setTitleColor
:[
UIColor
blackColor
]
forState
:
UIControlStateSelected
];
if
(
@available
(
iOS
13
.
0
,
*
))
{
[
_originalPhotoButton
setTitleColor
:[
UIColor
labelColor
]
forState
:
UIControlStateSelected
];
}
else
{
[
_originalPhotoButton
setTitleColor
:[
UIColor
blackColor
]
forState
:
UIControlStateSelected
];
}
[
_originalPhotoButton
setImage
:
tzImagePickerVc
.
photoOriginDefImage
forState
:
UIControlStateNormal
];
[
_originalPhotoButton
setImage
:
tzImagePickerVc
.
photoOriginDefImage
forState
:
UIControlStateNormal
];
[
_originalPhotoButton
setImage
:
tzImagePickerVc
.
photoOriginSelImage
forState
:
UIControlStateSelected
];
[
_originalPhotoButton
setImage
:
tzImagePickerVc
.
photoOriginSelImage
forState
:
UIControlStateSelected
];
_originalPhotoButton
.
imageView
.
clipsToBounds
=
YES
;
_originalPhotoButton
.
imageView
.
clipsToBounds
=
YES
;
...
@@ -254,7 +271,11 @@ static CGFloat itemMargin = 5;
...
@@ -254,7 +271,11 @@ static CGFloat itemMargin = 5;
_originalPhotoLabel
=
[[
UILabel
alloc
]
init
];
_originalPhotoLabel
=
[[
UILabel
alloc
]
init
];
_originalPhotoLabel
.
textAlignment
=
NSTextAlignmentLeft
;
_originalPhotoLabel
.
textAlignment
=
NSTextAlignmentLeft
;
_originalPhotoLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
];
_originalPhotoLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
];
_originalPhotoLabel
.
textColor
=
[
UIColor
blackColor
];
if
(
@available
(
iOS
13
.
0
,
*
))
{
_originalPhotoLabel
.
textColor
=
[
UIColor
labelColor
];
}
else
{
_originalPhotoLabel
.
textColor
=
[
UIColor
blackColor
];
}
if
(
_isSelectOriginalPhoto
)
[
self
getSelectedPhotoBytes
];
if
(
_isSelectOriginalPhoto
)
[
self
getSelectedPhotoBytes
];
}
}
...
@@ -284,7 +305,19 @@ static CGFloat itemMargin = 5;
...
@@ -284,7 +305,19 @@ static CGFloat itemMargin = 5;
_divideLine
=
[[
UIView
alloc
]
init
];
_divideLine
=
[[
UIView
alloc
]
init
];
CGFloat
rgb2
=
222
/
255
.
0
;
CGFloat
rgb2
=
222
/
255
.
0
;
_divideLine
.
backgroundColor
=
[
UIColor
colorWithRed
:
rgb2
green
:
rgb2
blue
:
rgb2
alpha
:
1
.
0
];
if
(
@available
(
iOS
13
.
0
,
*
))
{
UIColor
*
divideLineDyColor
=
[
UIColor
colorWithDynamicProvider
:
^
UIColor
*
_Nonnull
(
UITraitCollection
*
_Nonnull
trainCollection
)
{
if
([
trainCollection
userInterfaceStyle
]
==
UIUserInterfaceStyleLight
)
{
return
[
UIColor
colorWithRed
:
rgb2
green
:
rgb2
blue
:
rgb2
alpha
:
1
.
0
];
}
else
{
CGFloat
lineDarkRgb
=
100
/
255
.
0
;
return
[
UIColor
colorWithRed
:
lineDarkRgb
green
:
lineDarkRgb
blue
:
lineDarkRgb
alpha
:
1
.
0
];
}
}];
_divideLine
.
backgroundColor
=
divideLineDyColor
;
}
else
{
_divideLine
.
backgroundColor
=
[
UIColor
colorWithRed
:
rgb2
green
:
rgb2
blue
:
rgb2
alpha
:
1
.
0
];
}
[
_bottomToolBar
addSubview
:
_divideLine
];
[
_bottomToolBar
addSubview
:
_divideLine
];
[
_bottomToolBar
addSubview
:
_previewButton
];
[
_bottomToolBar
addSubview
:
_previewButton
];
...
...
TZImagePickerController/TZImagePickerController/TZVideoPlayerController.h
View file @
a19d719d
...
@@ -13,4 +13,5 @@
...
@@ -13,4 +13,5 @@
@property
(
nonatomic
,
strong
)
TZAssetModel
*
model
;
@property
(
nonatomic
,
strong
)
TZAssetModel
*
model
;
@end
@end
\ No newline at end of file
TZImagePickerController/TZImagePickerController/TZVideoPlayerController.m
View file @
a19d719d
...
@@ -27,8 +27,10 @@
...
@@ -27,8 +27,10 @@
UIStatusBarStyle
_originStatusBarStyle
;
UIStatusBarStyle
_originStatusBarStyle
;
}
}
@property
(
assign
,
nonatomic
)
BOOL
needShowStatusBar
;
@property
(
assign
,
nonatomic
)
BOOL
needShowStatusBar
;
// iCloud无法同步提示UI
// iCloud无法同步提示UI
@property
(
nonatomic
,
strong
)
UIView
*
iCloudErrorView
;
@property
(
nonatomic
,
strong
)
UIView
*
iCloudErrorView
;
@end
@end
#pragma clang diagnostic push
#pragma clang diagnostic push
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment