-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from carousell/feature/video-support
Support video in the picker
- Loading branch information
Showing
16 changed files
with
215 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Pickle/Assets/Images.xcassets/video-icon.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "video-icon.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// This source file is part of the carousell/pickle open source project | ||
// | ||
// Copyright © 2017 Carousell and the project authors | ||
// Licensed under Apache License v2.0 | ||
// | ||
// See https://github.com/carousell/pickle/blob/master/LICENSE for license information | ||
// See https://github.com/carousell/pickle/graphs/contributors for the list of project authors | ||
// | ||
|
||
import UIKit | ||
import Photos | ||
|
||
internal final class GalleryVideoCell: GalleryPhotoCell { | ||
|
||
private let videoPropertyView = VideoPropertyView() | ||
|
||
override func setUpSubviews() { | ||
super.setUpSubviews() | ||
|
||
contentView.addSubview(videoPropertyView) | ||
videoPropertyView.translatesAutoresizingMaskIntoConstraints = false | ||
videoPropertyView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor).isActive = true | ||
videoPropertyView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor).isActive = true | ||
videoPropertyView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor).isActive = true | ||
videoPropertyView.heightAnchor.constraint(equalToConstant: 24).isActive = true | ||
} | ||
|
||
override func configure( | ||
with asset: PHAsset, | ||
taggedText: String? = nil, | ||
configuration: ImagePickerConfigurable?) { | ||
|
||
super.configure( | ||
with: asset, | ||
taggedText: taggedText, | ||
configuration: configuration) | ||
|
||
videoPropertyView.configure(duration: asset.duration) | ||
videoPropertyView.setSelected(taggedText != nil) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.