Disable interactive modal dismiss in image pickers

This commit is contained in:
Ali 2019-11-08 17:20:48 +04:00
parent 72c72d283d
commit 16f3cd2a00
3 changed files with 12 additions and 0 deletions

View File

@ -467,6 +467,11 @@ final class NavigationModalContainer: ASDisplayNode, UIScrollViewDelegate, UIGes
} }
currentParent = currentParent?.superview currentParent = currentParent?.superview
} }
if let controller = self.container.controllers.last {
if controller.view.disablesInteractiveModalDismiss {
enableScrolling = false
}
}
self.isInteractiveDimissEnabled = enableScrolling self.isInteractiveDimissEnabled = enableScrolling
if let layout = self.validLayout { if let layout = self.validLayout {
if layout.inputHeight != nil && layout.inputHeight != 0.0 { if layout.inputHeight != nil && layout.inputHeight != 0.0 {

View File

@ -18,6 +18,12 @@ private final class LegacyImagePickerController: LegacyController, TGLegacyCamer
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
override func viewDidLoad() {
super.viewDidLoad()
self.view.disablesInteractiveModalDismiss = true
}
func legacyCameraControllerCompletedWithNoResult() { func legacyCameraControllerCompletedWithNoResult() {
self.completion(nil) self.completion(nil)
} }

View File

@ -5705,6 +5705,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
legacyController.statusBar.statusBarStyle = strongSelf.presentationData.theme.rootController.statusBarStyle.style legacyController.statusBar.statusBarStyle = strongSelf.presentationData.theme.rootController.statusBarStyle.style
legacyController.controllerLoaded = { [weak legacyController] in legacyController.controllerLoaded = { [weak legacyController] in
legacyController?.view.disablesInteractiveTransitionGestureRecognizer = true legacyController?.view.disablesInteractiveTransitionGestureRecognizer = true
legacyController?.view.disablesInteractiveModalDismiss = true
} }
let controller = generator(legacyController.context) let controller = generator(legacyController.context)
legacyController.bind(controller: controller) legacyController.bind(controller: controller)