mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fixed an issue where the GlobalSearch push animation could be jittery Fixed a crash which could occur when returning from the background on certain screens Removed the keyboard dismiss animation when pushing from global search to a conversation (apparently this is how iMessage avoids the animation bug...) Updated to the latest version of GRDB Updated the Atomic wrapper to use the ReadWrite lock for less blocking behaviours Updated the audio attachment icon to be consistent with Android & Desktop Updated the QuoteView to omit the "author" if we don't have their name and the quote can't be found
64 lines
1.8 KiB
Swift
64 lines
1.8 KiB
Swift
// Copyright © 2023 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import UIKit
|
|
import SessionUIKit
|
|
import SessionUtilitiesKit
|
|
import SessionMessagingKit
|
|
|
|
extension MediaInfoVC {
|
|
final class MediaPreviewView: UIView {
|
|
private static let cornerRadius: CGFloat = 8
|
|
|
|
private let attachment: Attachment
|
|
private let isOutgoing: Bool
|
|
|
|
// MARK: - UI
|
|
|
|
private lazy var mediaView: MediaView = {
|
|
let result: MediaView = MediaView.init(
|
|
attachment: attachment,
|
|
isOutgoing: isOutgoing,
|
|
cornerRadius: 0
|
|
)
|
|
|
|
return result
|
|
}()
|
|
|
|
// MARK: - Lifecycle
|
|
|
|
init(attachment: Attachment, isOutgoing: Bool) {
|
|
self.attachment = attachment
|
|
self.isOutgoing = isOutgoing
|
|
|
|
super.init(frame: CGRect.zero)
|
|
self.accessibilityLabel = "Media info"
|
|
setUpViewHierarchy()
|
|
}
|
|
|
|
override init(frame: CGRect) {
|
|
preconditionFailure("Use init(attachment:) instead.")
|
|
}
|
|
|
|
required init?(coder: NSCoder) {
|
|
preconditionFailure("Use init(attachment:) instead.")
|
|
}
|
|
|
|
private func setUpViewHierarchy() {
|
|
set(.width, to: MediaInfoVC.mediaSize)
|
|
set(.height, to: MediaInfoVC.mediaSize)
|
|
|
|
addSubview(mediaView)
|
|
mediaView.pin(to: self)
|
|
|
|
mediaView.loadMedia()
|
|
}
|
|
|
|
// MARK: - Copy
|
|
|
|
/// This function is used to make sure the carousel view contains this class can loop infinitely
|
|
func copyView() -> MediaPreviewView {
|
|
return MediaPreviewView(attachment: self.attachment, isOutgoing: self.isOutgoing)
|
|
}
|
|
}
|
|
}
|