WIP: Media info vc

pull/782/head
Ryan Zhao 2 years ago
parent 94456edd2e
commit 68efe731e7

@ -1558,8 +1558,8 @@ extension ConversationVC:
// MARK: - ContextMenuActionDelegate // MARK: - ContextMenuActionDelegate
func info(_ cellViewModel: MessageViewModel) { func info(_ cellViewModel: MessageViewModel) {
guard let contextMenuVC = self.contextMenuVC else { return } let mediaInfoVC = MediaInfoVC(attachments: (cellViewModel.attachments ?? []))
contextMenuVC.showMessageInfo() navigationController?.pushViewController(mediaInfoVC, animated: true)
} }
func reply(_ cellViewModel: MessageViewModel) { func reply(_ cellViewModel: MessageViewModel) {

@ -163,12 +163,14 @@ extension MediaInfoVC {
}() }()
let durationContainerStackView: UIStackView = UIStackView(arrangedSubviews: [ durationTitleLabel, durationLabel ]) let durationContainerStackView: UIStackView = UIStackView(arrangedSubviews: [ durationTitleLabel, durationLabel ])
durationContainerStackView.axis = .vertical durationContainerStackView.axis = .vertical
container.addSubview(durationContainerStackView)
durationContainerStackView.pin(.trailing, to: .trailing, of: container) durationContainerStackView.pin(.trailing, to: .trailing, of: container)
durationContainerStackView.pin(.top, to: .bottom, of: fileSizeContainerStackView, withInset: Values.mediumSpacing) durationContainerStackView.pin(.top, to: .bottom, of: fileSizeContainerStackView, withInset: Values.mediumSpacing)
durationContainerStackView.set(.width, to: 90) durationContainerStackView.set(.width, to: 90)
container.pin(.bottom, to: .bottom, of: durationContainerStackView)
addSubview(container) backgroundView.addSubview(container)
container.pin(to: self, withInset: Values.mediumSpacing) container.pin(to: backgroundView, withInset: Values.largeSpacing)
} }
} }
} }

@ -38,6 +38,12 @@ final class MediaInfoVC: BaseVC {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
self.title = "Message Info"
attachments.forEach {
let mediaInfoView: MediaInfoView = MediaInfoView(attachment: $0)
self.view.addSubview(mediaInfoView)
mediaInfoView.center(in: self.view)
}
} }
} }

Loading…
Cancel
Save