forked from shadowfacts/Tusker
Fix gallery buttons changing position during dismiss animation
Closes #554
This commit is contained in:
parent
5ce9892a9b
commit
4ea61542a0
@ -11,6 +11,7 @@ import AVFoundation
|
||||
@MainActor
|
||||
protocol GalleryItemViewControllerDelegate: AnyObject {
|
||||
func isGalleryBeingPresented() -> Bool
|
||||
func isGalleryBeingDismissed() -> Bool
|
||||
func addPresentationAnimationCompletion(_ block: @escaping () -> Void)
|
||||
func galleryItemClose(_ item: GalleryItemViewController)
|
||||
func galleryItemApplicationActivities(_ item: GalleryItemViewController) -> [UIActivity]?
|
||||
@ -376,6 +377,9 @@ class GalleryItemViewController: UIViewController {
|
||||
}
|
||||
|
||||
private func updateTopControlsInsets() {
|
||||
guard delegate?.isGalleryBeingDismissed() != true else {
|
||||
return
|
||||
}
|
||||
let notchedDeviceTopInsets: [CGFloat] = [
|
||||
44, // iPhone X, Xs, Xs Max, 11 Pro, 11 Pro Max
|
||||
48, // iPhone XR, 11
|
||||
|
@ -139,6 +139,10 @@ extension GalleryViewController: GalleryItemViewControllerDelegate {
|
||||
isBeingPresented
|
||||
}
|
||||
|
||||
func isGalleryBeingDismissed() -> Bool {
|
||||
isBeingDismissed
|
||||
}
|
||||
|
||||
func addPresentationAnimationCompletion(_ block: @escaping () -> Void) {
|
||||
presentationAnimationCompletionHandlers.append(block)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user