Skip to content

Commit

Permalink
Merge pull request #53 from rewardStyle/COA-1106-bulk-upload-media-pi…
Browse files Browse the repository at this point in the history
…cker

Update YPLibraryView.swift
  • Loading branch information
archangelneo18 committed Aug 8, 2024
2 parents a565f20 + fd56c2b commit 847799f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Source/Pages/Gallery/YPAssetZoomableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ final class YPAssetZoomableView: UIScrollView {
public weak var zoomableViewDelegate: YPAssetZoomableViewDelegate?
public var cropAreaDidChange = {}
public var isVideoMode = false
public var isVideoMuted = false
public var photoImageView = UIImageView()
public var videoView = YPVideoView()
public var squaredZoomScale: CGFloat = 1
Expand Down Expand Up @@ -123,6 +124,7 @@ final class YPAssetZoomableView: UIScrollView {
strongSelf.currentAsset = video

strongSelf.videoView.loadVideo(playerItem)
strongSelf.videoView.player.isMuted = strongSelf.isVideoMuted
strongSelf.videoView.play()
strongSelf.zoomableViewDelegate?.ypAssetZoomableViewDidLayoutSubviews(strongSelf)
}
Expand Down
1 change: 1 addition & 0 deletions Source/Pages/Gallery/YPLibraryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ internal final class YPLibraryView: UIView {
}()
internal let assetZoomableView: YPAssetZoomableView = {
let v = YPAssetZoomableView(frame: .zero)
v.isVideoMuted = YPConfig.library.isBulkUploading
v.accessibilityIdentifier = "assetZoomableView"
return v
}()
Expand Down
5 changes: 4 additions & 1 deletion Source/Pages/Gallery/YPLibraryViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class YPMultipleSelectionIndicator: UIView {

func set(number: Int?) {
label.isHidden = (number == nil)
let isHiddenDuringBulkUploads = YPConfig.library.isBulkUploading && number == nil
circle.isHidden = isHiddenDuringBulkUploads
imageView.isHidden = isHiddenDuringBulkUploads
if let number = number {
circle.backgroundColor = selectionColor
circle.layer.borderColor = selectionBorderColor.cgColor
Expand Down Expand Up @@ -99,7 +102,7 @@ class YPLibraryViewCell: UICollectionViewCell {

layout(
3,
multipleSelectionIndicator-3-|
YPConfig.library.isBulkUploading ? |-3-multipleSelectionIndicator : multipleSelectionIndicator-3-|
)

imageView.contentMode = .scaleAspectFill
Expand Down

0 comments on commit 847799f

Please sign in to comment.