|
|
|
@ -5,10 +5,14 @@ import SessionUIKit
|
|
|
|
|
import SessionUtilitiesKit
|
|
|
|
|
|
|
|
|
|
final class MediaInfoVC: BaseVC {
|
|
|
|
|
internal static let mediaSize: CGFloat = 293
|
|
|
|
|
|
|
|
|
|
private let attachments: [Attachment]
|
|
|
|
|
private let isOutgoing: Bool
|
|
|
|
|
|
|
|
|
|
// MARK: - UI
|
|
|
|
|
private lazy var mediaInfoView: MediaInfoView = MediaInfoView()
|
|
|
|
|
|
|
|
|
|
// MARK: - Initialization
|
|
|
|
|
|
|
|
|
|
init(attachments: [Attachment], isOutgoing: Bool) {
|
|
|
|
@ -36,13 +40,26 @@ final class MediaInfoVC: BaseVC {
|
|
|
|
|
hasCustomBackButton: false
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
let mediaStackView: UIStackView = UIStackView()
|
|
|
|
|
mediaStackView.axis = .horizontal
|
|
|
|
|
|
|
|
|
|
attachments.forEach {
|
|
|
|
|
let mediaPreviewView: MediaPreviewView = MediaPreviewView(
|
|
|
|
|
attachment: $0,
|
|
|
|
|
isOutgoing: isOutgoing)
|
|
|
|
|
let mediaInfoView: MediaInfoView = MediaInfoView(attachment: $0)
|
|
|
|
|
mediaStackView.addArrangedSubview(mediaPreviewView)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let stackView: UIStackView = UIStackView(arrangedSubviews: [ mediaPreviewView, mediaInfoView ])
|
|
|
|
|
let scrollView: UIScrollView = UIScrollView()
|
|
|
|
|
scrollView.isPagingEnabled = true
|
|
|
|
|
scrollView.set(.width, to: Self.mediaSize)
|
|
|
|
|
scrollView.set(.height, to: Self.mediaSize)
|
|
|
|
|
scrollView.contentSize = CGSize(width: Self.mediaSize * CGFloat(attachments.count), height: Self.mediaSize)
|
|
|
|
|
scrollView.addSubview(mediaStackView)
|
|
|
|
|
|
|
|
|
|
mediaInfoView.update(attachment: attachments[0])
|
|
|
|
|
|
|
|
|
|
let stackView: UIStackView = UIStackView(arrangedSubviews: [ scrollView, mediaInfoView ])
|
|
|
|
|
stackView.axis = .vertical
|
|
|
|
|
stackView.spacing = Values.largeSpacing
|
|
|
|
|
|
|
|
|
@ -50,4 +67,3 @@ final class MediaInfoVC: BaseVC {
|
|
|
|
|
stackView.center(in: self.view)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|