From 55da083bb09ad635ef68f0abd8688cb3b57f9ab5 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 27 Feb 2022 04:17:12 +0400 Subject: [PATCH] Attachment menu improvements --- .../Sources/LocationPickerController.swift | 6 ------ .../Sources/LocationPickerControllerNode.swift | 12 ++++++++---- .../MediaPickerUI/Sources/MediaPickerScreen.swift | 2 +- .../Sources/AttachmentFileController.swift | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/submodules/LocationUI/Sources/LocationPickerController.swift b/submodules/LocationUI/Sources/LocationPickerController.swift index 8c3a441075..90d643b12e 100644 --- a/submodules/LocationUI/Sources/LocationPickerController.swift +++ b/submodules/LocationUI/Sources/LocationPickerController.swift @@ -324,8 +324,6 @@ public final class LocationPickerController: ViewController, AttachmentContainab }) self.navigationBar?.passthroughTouches = false - - self.updateTabBarAlpha(1.0, .immediate) } override public func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) { @@ -349,8 +347,4 @@ public final class LocationPickerController: ViewController, AttachmentContainab self.interaction?.dismissSearch() self.scrollToTop?() } - - public func prepareForReuse() { - self.updateTabBarAlpha(1.0, .immediate) - } } diff --git a/submodules/LocationUI/Sources/LocationPickerControllerNode.swift b/submodules/LocationUI/Sources/LocationPickerControllerNode.swift index 72508b23da..e539daae1d 100644 --- a/submodules/LocationUI/Sources/LocationPickerControllerNode.swift +++ b/submodules/LocationUI/Sources/LocationPickerControllerNode.swift @@ -953,7 +953,7 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM if self.locationAccessDenied { self.controller?.navigationBar?.updateBackgroundAlpha(0.0, transition: .immediate) - Queue.mainQueue().after(0.2) { + Queue.mainQueue().after(0.25) { self.controller?.updateTabBarAlpha(0.0, .immediate) } @@ -989,10 +989,14 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM let placeholderFrame = CGRect(origin: CGPoint(), size: layout.size) backgroundNode.update(size: placeholderFrame.size, transition: placeholderTransition) placeholderTransition.updateFrame(node: placeholderNode, frame: placeholderFrame) - } else if let placeholderNode = self.placeholderNode { - self.placeholderNode = nil - placeholderNode.removeFromSupernode() + } else { + if let placeholderNode = self.placeholderNode { + self.placeholderNode = nil + placeholderNode.removeFromSupernode() + } + self.controller?.updateTabBarAlpha(1.0, .immediate) } + } func updateSendActionHighlight(_ highlighted: Bool) { diff --git a/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift b/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift index 8deae3cf55..c8b5f74c42 100644 --- a/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift +++ b/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift @@ -630,7 +630,7 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable { self.controller?.navigationBar?.updateBackgroundAlpha(0.0, transition: .immediate) if delayDisappear { - Queue.mainQueue().after(0.2) { + Queue.mainQueue().after(0.25) { self.controller?.updateTabBarAlpha(0.0, transition) } } else { diff --git a/submodules/TelegramUI/Sources/AttachmentFileController.swift b/submodules/TelegramUI/Sources/AttachmentFileController.swift index aa980b9d50..f39f6cdf7a 100644 --- a/submodules/TelegramUI/Sources/AttachmentFileController.swift +++ b/submodules/TelegramUI/Sources/AttachmentFileController.swift @@ -310,7 +310,7 @@ public func attachmentFileController(context: AccountContext, updatedPresentatio case let .known(value): let backgroundAlpha: CGFloat = min(30.0, max(0.0, value)) / 30.0 if backgroundAlpha.isZero && controller?.delayDisappear == true { - Queue.mainQueue().after(0.2, { + Queue.mainQueue().after(0.25, { controller?.updateTabBarAlpha(backgroundAlpha, .animated(duration: 0.1, curve: .easeInOut)) }) } else {