Compare commits

..

No commits in common. "375ad259194d97ce9b2e81bc0c320ad7884fd033" and "b4693252bed55e5c6fab0aaf4daad6915f9c5f68" have entirely different histories.

7 changed files with 6 additions and 23 deletions

View File

@ -25,7 +25,6 @@ class GalleryDismissInteraction: NSObject {
super.init()
let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(panRecognized))
panRecognizer.delegate = self
panRecognizer.allowedScrollTypesMask = .continuous
viewController.view.addGestureRecognizer(panRecognizer)
}

View File

@ -102,7 +102,6 @@ class GalleryItemViewController: UIViewController {
shareButton.pointerStyleProvider = { button, effect, shape in
return UIPointerStyle(effect: .highlight(effect.preview), shape: .roundedRect(button.frame))
}
shareButton.preferredBehavioralStyle = .pad
shareButton.translatesAutoresizingMaskIntoConstraints = false
updateShareButton()
topControlsView.addSubview(shareButton)
@ -119,7 +118,6 @@ class GalleryItemViewController: UIViewController {
closeButton.pointerStyleProvider = { button, effect, shape in
return UIPointerStyle(effect: .highlight(effect.preview), shape: .roundedRect(button.frame))
}
closeButton.preferredBehavioralStyle = .pad
closeButton.translatesAutoresizingMaskIntoConstraints = false
topControlsView.addSubview(closeButton)
@ -154,15 +152,10 @@ class GalleryItemViewController: UIViewController {
updateCaptionTextView()
bottomControlsView.addArrangedSubview(captionTextView)
#if targetEnvironment(macCatalyst)
closeButtonTopConstraint = closeButton.topAnchor.constraint(equalTo: topControlsView.safeAreaLayoutGuide.topAnchor)
shareButtonTopConstraint = shareButton.topAnchor.constraint(equalTo: topControlsView.safeAreaLayoutGuide.topAnchor)
#else
closeButtonTopConstraint = closeButton.topAnchor.constraint(equalTo: topControlsView.topAnchor)
shareButtonTopConstraint = shareButton.topAnchor.constraint(equalTo: topControlsView.topAnchor)
#endif
closeButtonTrailingConstraint = topControlsView.trailingAnchor.constraint(equalTo: closeButton.trailingAnchor)
closeButtonTopConstraint = closeButton.topAnchor.constraint(equalTo: topControlsView.topAnchor)
shareButtonLeadingConstraint = shareButton.leadingAnchor.constraint(equalTo: topControlsView.leadingAnchor)
shareButtonTopConstraint = shareButton.topAnchor.constraint(equalTo: topControlsView.topAnchor)
NSLayoutConstraint.activate([
scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
@ -198,8 +191,6 @@ class GalleryItemViewController: UIViewController {
doubleTap = UITapGestureRecognizer(target: self, action: #selector(viewDoublePressed))
doubleTap.delegate = self
doubleTap.numberOfTapsRequired = 2
// This is needed to prevent a delay between tapping a button on and the action firing on Catalyst and Designed for iPad
doubleTap.delaysTouchesEnded = false
// this requirement is needed to make sure the double tap is ever recognized
singleTap.require(toFail: doubleTap)
view.addGestureRecognizer(singleTap)

View File

@ -86,8 +86,8 @@ class GalleryPresentationAnimationController: NSObject, UIViewControllerAnimated
itemViewController.setControlsVisible(false, animated: false)
let duration = self.transitionDuration(using: transitionContext)
// rougly equivalent to duration: 0.35, bounce: 0.3
let spring = UISpringTimingParameters(mass: 1, stiffness: 322, damping: 25, initialVelocity: .zero)
// rougly equivalent to duration: 0.4, bounce: 0.3
let spring = UISpringTimingParameters(mass: 1, stiffness: 247, damping: 22, initialVelocity: .zero)
let animator = UIViewPropertyAnimator(duration: duration, timingParameters: spring)
animator.addAnimations {

View File

@ -57,6 +57,7 @@ class AttachmentsContainerView: UIView {
private func commonInit() {
self.isUserInteractionEnabled = true
self.layer.cornerRadius = 5
self.layer.masksToBounds = true
createBlurView()
createHideButton()

View File

@ -66,9 +66,8 @@ class ProfileHeaderView: UIView {
backgroundColor = .appBackground
avatarContainerView.backgroundColor = .appBackground
avatarContainerView.layer.masksToBounds = true
avatarContainerView.layer.cornerCurve = .continuous
// Set zPositions so the gallery presentation/dismissal animation looks correct.
avatarContainerView.layer.zPosition = 2
avatarImageView.layer.masksToBounds = true
avatarImageView.layer.cornerCurve = .continuous
avatarImageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(avatarPressed)))
@ -76,7 +75,6 @@ class ProfileHeaderView: UIView {
headerImageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(headerPressed)))
headerImageView.isUserInteractionEnabled = true
headerImageView.layer.zPosition = 1
var config = UIButton.Configuration.plain()
config.image = UIImage(systemName: "ellipsis")
@ -85,11 +83,9 @@ class ProfileHeaderView: UIView {
moreButton.addInteraction(UIPointerInteraction(delegate: self))
moreButton.showsMenuAsPrimaryAction = true
moreButton.isContextMenuInteractionEnabled = true
moreButton.layer.zPosition = 2
followButton.setNeedsUpdateConfiguration()
followButton.addInteraction(UIPointerInteraction(delegate: self))
followButton.layer.zPosition = 2
displayNameLabel.font = UIFontMetrics(forTextStyle: .title1).scaledFont(for: .systemFont(ofSize: 24, weight: .semibold))
displayNameLabel.adjustsFontForContentSizeCategory = true

View File

@ -131,8 +131,6 @@ class ConversationMainStatusCollectionViewCell: UICollectionViewListCell, Status
pollView,
] as! [any StatusContentView], useTopSpacer: true).configure {
$0.setContentHuggingPriority(.defaultLow, for: .vertical)
// So that during gallery presentation/dismissal animations, the attachment view appears over everything else.
$0.layer.zPosition = 1
}
let contentTextView = StatusContentTextView().configure {

View File

@ -84,8 +84,6 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
metaIndicatorsView.trailingAnchor.constraint(equalTo: avatarImageView.trailingAnchor),
metaIndicatorsTopConstraint,
])
// So that during gallery presentation/dismissal animations, the attachment view appears over everything else.
$0.layer.zPosition = 1
}
private static let avatarImageViewSize: CGFloat = 50