mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 19:30:29 +00:00
Various Fixes
This commit is contained in:
parent
96629b3d37
commit
26b0b4021c
@ -1,5 +1,6 @@
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
import SwiftSignalKit
|
||||
|
||||
private let containerInsets = UIEdgeInsets(top: 10.0, left: 10.0, bottom: 10.0, right: 10.0)
|
||||
|
||||
@ -59,6 +60,7 @@ final class ActionSheetControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
self.bottomDimView.isUserInteractionEnabled = false
|
||||
|
||||
self.itemGroupsContainerNode = ActionSheetItemGroupsContainerNode(theme: self.theme)
|
||||
self.itemGroupsContainerNode.isUserInteractionEnabled = false
|
||||
|
||||
super.init()
|
||||
|
||||
@ -128,6 +130,7 @@ final class ActionSheetControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
self.updateScrollDimViews(size: layout.size, insets: insets, transition: transition)
|
||||
}
|
||||
|
||||
|
||||
func animateIn(completion: @escaping () -> Void) {
|
||||
let tempDimView = UIView()
|
||||
tempDimView.backgroundColor = self.theme.dimColor
|
||||
@ -144,6 +147,10 @@ final class ActionSheetControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
tempDimView?.removeFromSuperview()
|
||||
completion()
|
||||
})
|
||||
|
||||
Queue.mainQueue().after(0.3, {
|
||||
self.itemGroupsContainerNode.isUserInteractionEnabled = true
|
||||
})
|
||||
}
|
||||
|
||||
func animateOut(cancelled: Bool) {
|
||||
@ -170,7 +177,7 @@ final class ActionSheetControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
}
|
||||
|
||||
@objc func dimNodeTap(_ recognizer: UITapGestureRecognizer) {
|
||||
if case .ended = recognizer.state {
|
||||
if case .ended = recognizer.state, self.itemGroupsContainerNode.isUserInteractionEnabled {
|
||||
self.view.window?.endEditing(true)
|
||||
self.animateOut(cancelled: true)
|
||||
}
|
||||
|
||||
@ -84,6 +84,9 @@ final class ActionSheetItemGroupsContainerNode: ASDisplayNode {
|
||||
}
|
||||
|
||||
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||
guard self.isUserInteractionEnabled else {
|
||||
return nil
|
||||
}
|
||||
for groupNode in self.groupNodes {
|
||||
if groupNode.frame.contains(point) {
|
||||
return groupNode.hitTest(self.convert(point, to: groupNode), with: event)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user