mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-06-20 18:24:43 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
@@ -11884,3 +11884,6 @@ Sorry for the inconvenience.";
|
||||
"BusinessLink.ErrorExpired" = "Link Expired";
|
||||
|
||||
"WebApp.AlertBiometryAccessText" = "Do you want to allow %@ to use Face ID?";
|
||||
|
||||
"StoryList.SubtitleArchived_1" = "1 archived post";
|
||||
"StoryList.SubtitleArchived_any" = "%d archived posts";
|
||||
|
||||
Submodule build-system/bazel-rules/apple_support updated: d97e2e3dd4...cf271a330b
Submodule build-system/bazel-rules/rules_apple updated: 3430ddfcb1...345b71fc22
Submodule build-system/bazel-rules/rules_swift updated: f8a04280c1...72347ab6cb
Submodule build-system/bazel-rules/rules_xcodeproj updated: 48c3af2361...77e00ae3fd
@@ -995,4 +995,71 @@ typedef NS_ENUM(NSInteger, ASLayoutEngineType) {
|
||||
@property (nullable, weak) ASDisplayNode *asyncdisplaykit_node;
|
||||
@end
|
||||
|
||||
@protocol ASGestureRecognizerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
// called when a gesture recognizer attempts to transition out of UIGestureRecognizerStatePossible. returning NO causes it to transition to UIGestureRecognizerStateFailed
|
||||
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer;
|
||||
|
||||
// called when the recognition of one of gestureRecognizer or otherGestureRecognizer would be blocked by the other
|
||||
// return YES to allow both to recognize simultaneously. the default implementation returns NO (by default no two gestures can be recognized simultaneously)
|
||||
//
|
||||
// note: returning YES is guaranteed to allow simultaneous recognition. returning NO is not guaranteed to prevent simultaneous recognition, as the other gesture's delegate may return YES
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
|
||||
|
||||
// called once per attempt to recognize, so failure requirements can be determined lazily and may be set up between recognizers across view hierarchies
|
||||
// return YES to set up a dynamic failure requirement between gestureRecognizer and otherGestureRecognizer
|
||||
//
|
||||
// note: returning YES is guaranteed to set up the failure requirement. returning NO does not guarantee that there will not be a failure requirement as the other gesture's counterpart delegate or subclass methods may return YES
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRequireFailureOfGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer API_AVAILABLE(ios(7.0));
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer API_AVAILABLE(ios(7.0));
|
||||
|
||||
// called before touchesBegan:withEvent: is called on the gesture recognizer for a new touch. return NO to prevent the gesture recognizer from seeing this touch
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
|
||||
|
||||
// called before pressesBegan:withEvent: is called on the gesture recognizer for a new press. return NO to prevent the gesture recognizer from seeing this press
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceivePress:(UIPress *)press;
|
||||
|
||||
// called once before either -gestureRecognizer:shouldReceiveTouch: or -gestureRecognizer:shouldReceivePress:
|
||||
// return NO to prevent the gesture recognizer from seeing this event
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveEvent:(UIEvent *)event API_AVAILABLE(ios(13.4), tvos(13.4)) API_UNAVAILABLE(watchos);
|
||||
|
||||
@end
|
||||
|
||||
@protocol ASScrollViewDelegate <NSObject>
|
||||
@optional
|
||||
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView; // any offset changes
|
||||
- (void)scrollViewDidZoom:(UIScrollView *)scrollView API_AVAILABLE(ios(3.2)); // any zoom scale changes
|
||||
|
||||
// called on start of dragging (may require some time and or distance to move)
|
||||
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView;
|
||||
// called on finger up if the user dragged. velocity is in points/millisecond. targetContentOffset may be changed to adjust where the scroll view comes to rest
|
||||
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset API_AVAILABLE(ios(5.0));
|
||||
// called on finger up if the user dragged. decelerate is true if it will continue moving afterwards
|
||||
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate;
|
||||
|
||||
- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView; // called on finger up as we are moving
|
||||
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; // called when scroll view grinds to a halt
|
||||
|
||||
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView; // called when setContentOffset/scrollRectVisible:animated: finishes. not called if not animating
|
||||
|
||||
- (nullable UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView; // return a view that will be scaled. if delegate returns nil, nothing happens
|
||||
- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view API_AVAILABLE(ios(3.2)); // called before the scroll view begins zooming its content
|
||||
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale; // scale between minimum and maximum. called after any 'bounce' animations
|
||||
|
||||
- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView; // return a yes if you want to scroll to the top. if not defined, assumes YES
|
||||
- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView; // called when scrolling animation finished. may be called immediately if already at top
|
||||
|
||||
/* Also see -[UIScrollView adjustedContentInsetDidChange]
|
||||
*/
|
||||
- (void)scrollViewDidChangeAdjustedContentInset:(UIScrollView *)scrollView API_AVAILABLE(ios(11.0), tvos(11.0));
|
||||
|
||||
- (nullable NSString *)accessibilityScrollStatusForScrollView:(UIScrollView *)scrollView;
|
||||
|
||||
// If an object adopting this protocol responds to this method, the system will try sending it before sending its non-attributed version.
|
||||
- (nullable NSAttributedString *)accessibilityAttributedScrollStatusForScrollView:(UIScrollView *)scrollView API_AVAILABLE(ios(11.0), tvos(11.0));
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -25,7 +25,7 @@ public func attachmentDefaultTopInset(layout: ContainerViewLayout?) -> CGFloat {
|
||||
}
|
||||
}
|
||||
|
||||
final class AttachmentContainer: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
final class AttachmentContainer: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
let wrappingNode: ASDisplayNode
|
||||
let clipNode: ASDisplayNode
|
||||
let container: NavigationContainer
|
||||
@@ -112,7 +112,7 @@ final class AttachmentContainer: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
super.didLoad()
|
||||
|
||||
let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.panGesture(_:)))
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panRecognizer.delaysTouchesBegan = false
|
||||
panRecognizer.cancelsTouchesInView = true
|
||||
self.panGestureRecognizer = panRecognizer
|
||||
|
||||
@@ -680,7 +680,7 @@ private final class MainButtonNode: HighlightTrackingButtonNode {
|
||||
}
|
||||
}
|
||||
|
||||
final class AttachmentPanel: ASDisplayNode, UIScrollViewDelegate {
|
||||
final class AttachmentPanel: ASDisplayNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private let isScheduledMessages: Bool
|
||||
private var presentationData: PresentationData
|
||||
@@ -1026,7 +1026,7 @@ final class AttachmentPanel: ASDisplayNode, UIScrollViewDelegate {
|
||||
self.containerNode.layer.cornerCurve = .continuous
|
||||
}
|
||||
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.showsVerticalScrollIndicator = false
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ enum BotCheckoutInfoControllerStatus {
|
||||
case verifying
|
||||
}
|
||||
|
||||
final class BotCheckoutInfoControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
final class BotCheckoutInfoControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private weak var navigationBar: NavigationBar?
|
||||
private let invoice: BotPaymentInvoice
|
||||
@@ -244,7 +244,7 @@ final class BotCheckoutInfoControllerNode: ViewControllerTracingNode, UIScrollVi
|
||||
self.scrollNode.view.alwaysBounceVertical = true
|
||||
self.scrollNode.view.showsVerticalScrollIndicator = false
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
self.addSubnode(self.scrollNode)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ private final class BotCheckoutNativeCardEntryScrollerNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
final class BotCheckoutNativeCardEntryControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
final class BotCheckoutNativeCardEntryControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private weak var navigationBar: NavigationBar?
|
||||
private let provider: BotCheckoutNativeCardEntryController.Provider
|
||||
@@ -183,7 +183,7 @@ final class BotCheckoutNativeCardEntryControllerNode: ViewControllerTracingNode,
|
||||
self.scrollNode.view.alwaysBounceVertical = true
|
||||
self.scrollNode.view.showsVerticalScrollIndicator = false
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
self.addSubnode(self.scrollNode)
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ class StackItemContainerNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
public class StackContainerNode: ASDisplayNode, UIScrollViewDelegate, UIGestureRecognizerDelegate {
|
||||
public class StackContainerNode: ASDisplayNode, ASScrollViewDelegate, ASGestureRecognizerDelegate {
|
||||
private let scrollNode: ASScrollNode
|
||||
private var nodes: [StackItemContainerNode]
|
||||
|
||||
@@ -222,11 +222,11 @@ public class StackContainerNode: ASDisplayNode, UIScrollViewDelegate, UIGestureR
|
||||
self.scrollNode.view.contentInsetAdjustmentBehavior = .never
|
||||
}
|
||||
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollNode.view.alwaysBounceVertical = true
|
||||
|
||||
let deleteGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(didPanToDelete(gestureRecognizer:)))
|
||||
deleteGestureRecognizer.delegate = self
|
||||
deleteGestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
deleteGestureRecognizer.delaysTouchesBegan = true
|
||||
self.scrollNode.view.addGestureRecognizer(deleteGestureRecognizer)
|
||||
self.deleteGestureRecognizer = deleteGestureRecognizer
|
||||
|
||||
@@ -975,7 +975,7 @@ private func monthMetadata(calendar: Calendar, for baseDate: Date, currentYear:
|
||||
}
|
||||
|
||||
public final class CalendarMessageScreen: ViewController {
|
||||
private final class Node: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
private final class Node: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
struct SelectionState {
|
||||
var dayRange: ClosedRange<Int32>?
|
||||
}
|
||||
@@ -1173,7 +1173,7 @@ public final class CalendarMessageScreen: ViewController {
|
||||
|
||||
self.backgroundColor = self.presentationData.theme.list.plainBackgroundColor
|
||||
|
||||
self.scrollView.delegate = self
|
||||
self.scrollView.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.contextGestureContainerNode)
|
||||
self.contextGestureContainerNode.view.addSubview(self.scrollView)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public enum ChatListContainerNodeFilter: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public final class ChatListContainerNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
public final class ChatListContainerNode: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
private let context: AccountContext
|
||||
private weak var controller: ChatListControllerImpl?
|
||||
let location: ChatListControllerLocation
|
||||
@@ -481,7 +481,7 @@ public final class ChatListContainerNode: ASDisplayNode, UIGestureRecognizerDele
|
||||
return [.rightEdge]
|
||||
}
|
||||
}, edgeWidth: .widthMultiplier(factor: 1.0 / 6.0, min: 22.0, max: 80.0))
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panRecognizer.delaysTouchesBegan = false
|
||||
panRecognizer.cancelsTouchesInView = true
|
||||
self.panRecognizer = panRecognizer
|
||||
@@ -1009,7 +1009,7 @@ public final class ChatListContainerNode: ASDisplayNode, UIGestureRecognizerDele
|
||||
}
|
||||
}
|
||||
|
||||
final class ChatListControllerNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
final class ChatListControllerNode: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
private let context: AccountContext
|
||||
private let location: ChatListControllerLocation
|
||||
private var presentationData: PresentationData
|
||||
@@ -1199,7 +1199,7 @@ final class ChatListControllerNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
let directions: InteractiveTransitionGestureRecognizerDirections = [.rightCenter]
|
||||
return directions
|
||||
}, edgeWidth: .widthMultiplier(factor: 1.0 / 6.0, min: 22.0, max: 80.0))
|
||||
inlineContentPanRecognizer.delegate = self
|
||||
inlineContentPanRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
inlineContentPanRecognizer.delaysTouchesBegan = false
|
||||
inlineContentPanRecognizer.cancelsTouchesInView = true
|
||||
self.inlineContentPanRecognizer = inlineContentPanRecognizer
|
||||
|
||||
@@ -594,7 +594,7 @@ private enum ItemsLayout {
|
||||
}
|
||||
}
|
||||
|
||||
final class ChatListSearchMediaNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
final class ChatListSearchMediaNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
enum ContentType {
|
||||
case photoOrVideo
|
||||
case gifs
|
||||
@@ -664,7 +664,7 @@ final class ChatListSearchMediaNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
self.scrollNode.view.contentInsetAdjustmentBehavior = .never
|
||||
}
|
||||
self.scrollNode.view.scrollsToTop = false
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
self.addSubnode(self.scrollNode)
|
||||
self.addSubnode(self.floatingHeaderNode)
|
||||
|
||||
@@ -142,7 +142,7 @@ private final class ChatListSearchPendingPane {
|
||||
}
|
||||
}
|
||||
|
||||
final class ChatListSearchPaneContainerNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
final class ChatListSearchPaneContainerNode: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
private let context: AccountContext
|
||||
private let animationCache: AnimationCache
|
||||
private let animationRenderer: MultiAnimationRenderer
|
||||
@@ -234,7 +234,7 @@ final class ChatListSearchPaneContainerNode: ASDisplayNode, UIGestureRecognizerD
|
||||
}
|
||||
return [.left, .right]
|
||||
})
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panRecognizer.delaysTouchesBegan = false
|
||||
panRecognizer.cancelsTouchesInView = true
|
||||
self.view.addGestureRecognizer(panRecognizer)
|
||||
|
||||
@@ -156,7 +156,7 @@ private final class InfoPageNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
class ChatListArchiveInfoItemNode: ListViewItemNode, UIScrollViewDelegate {
|
||||
class ChatListArchiveInfoItemNode: ListViewItemNode, ASScrollViewDelegate {
|
||||
private var item: ChatListArchiveInfoItem?
|
||||
|
||||
private let scrollNode: ASScrollNode
|
||||
@@ -187,7 +187,7 @@ class ChatListArchiveInfoItemNode: ListViewItemNode, UIScrollViewDelegate {
|
||||
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.isPagingEnabled = true
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.pageControlNode.setPage(0.0)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -155,7 +155,7 @@ private final class ActionSheetItemNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
final class ChatSendMessageActionSheetControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
final class ChatSendMessageActionSheetControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var presentationData: PresentationData
|
||||
private let sourceSendButton: ASDisplayNode
|
||||
@@ -382,7 +382,7 @@ final class ChatSendMessageActionSheetControllerNode: ViewControllerTracingNode,
|
||||
|
||||
self.scrollNode.view.showsVerticalScrollIndicator = false
|
||||
self.scrollNode.view.delaysContentTouches = false
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollNode.view.alwaysBounceVertical = true
|
||||
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
|
||||
self.scrollNode.view.contentInsetAdjustmentBehavior = .never
|
||||
|
||||
+4
-4
@@ -387,7 +387,7 @@ public final class ReactionListContextMenuContent: ContextControllerItemsContent
|
||||
private static let readIconImage: UIImage? = generateTintedImage(image: UIImage(bundleImageName: "Chat/Message/MenuReadIcon"), color: .white)?.withRenderingMode(.alwaysTemplate)
|
||||
private static let reactionIconImage: UIImage? = generateTintedImage(image: UIImage(bundleImageName: "Chat/Message/MenuReactionIcon"), color: .white)?.withRenderingMode(.alwaysTemplate)
|
||||
|
||||
private final class ReactionsTabNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
private final class ReactionsTabNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private final class ItemNode: HighlightTrackingButtonNode {
|
||||
let context: AccountContext
|
||||
let displayReadTimestamps: Bool
|
||||
@@ -868,7 +868,7 @@ public final class ReactionListContextMenuContent: ContextControllerItemsContent
|
||||
super.init()
|
||||
|
||||
self.addSubnode(self.scrollNode)
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
self.clipsToBounds = true
|
||||
|
||||
@@ -1101,7 +1101,7 @@ public final class ReactionListContextMenuContent: ContextControllerItemsContent
|
||||
}
|
||||
}
|
||||
|
||||
final class ItemsNode: ASDisplayNode, ContextControllerItemsNode, UIGestureRecognizerDelegate {
|
||||
final class ItemsNode: ASDisplayNode, ContextControllerItemsNode, ASGestureRecognizerDelegate {
|
||||
private let context: AccountContext
|
||||
private let displayReadTimestamps: Bool
|
||||
private let availableReactions: AvailableReactions?
|
||||
@@ -1266,7 +1266,7 @@ public final class ReactionListContextMenuContent: ContextControllerItemsContent
|
||||
}
|
||||
return [.left, .right]
|
||||
})
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.view.addGestureRecognizer(panRecognizer)
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ private final class ContextControllerContentSourceImpl: ContextControllerContent
|
||||
}
|
||||
}
|
||||
|
||||
final class ContactsControllerNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
final class ContactsControllerNode: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
let contactListNode: ContactListNode
|
||||
|
||||
private let context: AccountContext
|
||||
|
||||
@@ -247,7 +247,7 @@ func convertFrame(_ frame: CGRect, from fromView: UIView, to toView: UIView) ->
|
||||
return targetWindowFrame
|
||||
}
|
||||
|
||||
final class ContextControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
final class ContextControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private weak var controller: ContextController?
|
||||
private var presentationData: PresentationData
|
||||
|
||||
@@ -408,7 +408,7 @@ final class ContextControllerNode: ViewControllerTracingNode, UIScrollViewDelega
|
||||
self?.updateLayout()
|
||||
}
|
||||
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
if blurBackground {
|
||||
self.view.addSubview(self.effectView)
|
||||
|
||||
@@ -1101,7 +1101,7 @@ final class ContextControllerActionsStackNode: ASDisplayNode {
|
||||
case additional
|
||||
}
|
||||
|
||||
final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
final class NavigationContainer: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
let backgroundNode: NavigationBackgroundNode
|
||||
let parentShadowNode: ASImageNode
|
||||
|
||||
@@ -1136,7 +1136,7 @@ final class ContextControllerActionsStackNode: ASDisplayNode {
|
||||
let _ = strongSelf
|
||||
return [.right]
|
||||
})
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.view.addGestureRecognizer(panRecognizer)
|
||||
self.panRecognizer = panRecognizer
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ private extension ContextControllerTakeViewInfo.ContainingItem {
|
||||
}
|
||||
}
|
||||
|
||||
final class ContextControllerExtractedPresentationNode: ASDisplayNode, ContextControllerPresentationNode, UIScrollViewDelegate {
|
||||
final class ContextControllerExtractedPresentationNode: ASDisplayNode, ContextControllerPresentationNode, ASScrollViewDelegate {
|
||||
enum ContentSource {
|
||||
case location(ContextLocationContentSource)
|
||||
case reference(ContextReferenceContentSource)
|
||||
@@ -339,7 +339,7 @@ final class ContextControllerExtractedPresentationNode: ASDisplayNode, ContextCo
|
||||
//self.addSubnode(self.contentRectDebugNode)
|
||||
#endif
|
||||
|
||||
self.scroller.delegate = self
|
||||
self.scroller.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
self.dismissTapNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dismissTapGesture(_:))))
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ private func cancelContextGestures(view: UIView) {
|
||||
}
|
||||
}
|
||||
|
||||
public final class PinchSourceContainerNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
public final class PinchSourceContainerNode: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
public let contentNode: ASDisplayNode
|
||||
public var contentRect: CGRect = CGRect()
|
||||
private(set) var naturalContentFrame: CGRect?
|
||||
|
||||
@@ -4,7 +4,7 @@ import SwiftSignalKit
|
||||
|
||||
private let containerInsets = UIEdgeInsets(top: 10.0, left: 10.0, bottom: 10.0, right: 10.0)
|
||||
|
||||
final class ActionSheetControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
final class ActionSheetControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
var theme: ActionSheetControllerTheme {
|
||||
didSet {
|
||||
self.itemGroupsContainerNode.theme = self.theme
|
||||
@@ -64,7 +64,7 @@ final class ActionSheetControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
|
||||
super.init()
|
||||
|
||||
self.scrollView.delegate = self
|
||||
self.scrollView.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
self.addSubnode(self.scrollNode)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
|
||||
final class ActionSheetItemGroupNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
final class ActionSheetItemGroupNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private let theme: ActionSheetControllerTheme
|
||||
|
||||
private let centerDimView: UIImageView
|
||||
@@ -60,7 +60,7 @@ final class ActionSheetItemGroupNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
self.view.addSubview(self.bottomDimView)
|
||||
self.view.addSubview(self.trailingDimView)
|
||||
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
self.clippingNode.view.addSubview(self.backgroundEffectView)
|
||||
self.clippingNode.addSubnode(self.scrollNode)
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import ObjectiveC
|
||||
import AsyncDisplayKit
|
||||
|
||||
private var ASGestureRecognizerDelegateKey: Int?
|
||||
private var ASScrollViewDelegateKey: Int?
|
||||
|
||||
private final class WrappedGestureRecognizerDelegate: NSObject, UIGestureRecognizerDelegate {
|
||||
private weak var target: ASGestureRecognizerDelegate?
|
||||
|
||||
init(target: ASGestureRecognizerDelegate) {
|
||||
self.target = target
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
|
||||
guard let target = self.target else {
|
||||
return true
|
||||
}
|
||||
return target.gestureRecognizerShouldBegin?(gestureRecognizer) ?? true
|
||||
}
|
||||
|
||||
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
||||
guard let target = self.target else {
|
||||
return false
|
||||
}
|
||||
return target.gestureRecognizer?(gestureRecognizer, shouldRecognizeSimultaneouslyWith: otherGestureRecognizer) ?? false
|
||||
}
|
||||
|
||||
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
||||
guard let target = self.target else {
|
||||
return false
|
||||
}
|
||||
return target.gestureRecognizer?(gestureRecognizer, shouldRequireFailureOf: otherGestureRecognizer) ?? false
|
||||
}
|
||||
|
||||
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
||||
guard let target = self.target else {
|
||||
return false
|
||||
}
|
||||
return target.gestureRecognizer?(gestureRecognizer, shouldBeRequiredToFailBy: otherGestureRecognizer) ?? false
|
||||
}
|
||||
|
||||
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
|
||||
guard let target = self.target else {
|
||||
return true
|
||||
}
|
||||
return target.gestureRecognizer?(gestureRecognizer, shouldReceive: touch) ?? true
|
||||
}
|
||||
|
||||
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive press: UIPress) -> Bool {
|
||||
guard let target = self.target else {
|
||||
return true
|
||||
}
|
||||
return target.gestureRecognizer?(gestureRecognizer, shouldReceive: press) ?? true
|
||||
}
|
||||
|
||||
@available(iOS 13.4, *)
|
||||
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive event: UIEvent) -> Bool {
|
||||
guard let target = self.target else {
|
||||
return true
|
||||
}
|
||||
return target.gestureRecognizer?(gestureRecognizer, shouldReceive: event) ?? true
|
||||
}
|
||||
}
|
||||
|
||||
public extension ASGestureRecognizerDelegate {
|
||||
var wrappedGestureRecognizerDelegate: UIGestureRecognizerDelegate {
|
||||
if let delegate = objc_getAssociatedObject(self, &ASGestureRecognizerDelegateKey) as? WrappedGestureRecognizerDelegate {
|
||||
return delegate
|
||||
} else {
|
||||
let delegate = WrappedGestureRecognizerDelegate(target: self)
|
||||
objc_setAssociatedObject(self, &ASGestureRecognizerDelegateKey, delegate, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
|
||||
return delegate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final class WrappedScrollViewDelegate: NSObject, UIScrollViewDelegate, UIScrollViewAccessibilityDelegate {
|
||||
private weak var target: ASScrollViewDelegate?
|
||||
|
||||
init(target: ASScrollViewDelegate) {
|
||||
self.target = target
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewDidScroll?(scrollView)
|
||||
}
|
||||
|
||||
func scrollViewDidZoom(_ scrollView: UIScrollView) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewDidZoom?(scrollView)
|
||||
}
|
||||
|
||||
func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewWillBeginDragging?(scrollView)
|
||||
}
|
||||
|
||||
func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewWillEndDragging?(scrollView, withVelocity: velocity, targetContentOffset: targetContentOffset)
|
||||
}
|
||||
|
||||
func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewDidEndDragging?(scrollView, willDecelerate: decelerate)
|
||||
}
|
||||
|
||||
func scrollViewWillBeginDecelerating(_ scrollView: UIScrollView) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewWillBeginDecelerating?(scrollView)
|
||||
}
|
||||
|
||||
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewDidEndDecelerating?(scrollView)
|
||||
}
|
||||
|
||||
func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewDidEndScrollingAnimation?(scrollView)
|
||||
}
|
||||
|
||||
func viewForZooming(in scrollView: UIScrollView) -> UIView? {
|
||||
guard let target = self.target else {
|
||||
return nil
|
||||
}
|
||||
return target.viewForZooming?(in: scrollView)
|
||||
}
|
||||
|
||||
func scrollViewWillBeginZooming(_ scrollView: UIScrollView, with view: UIView?) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewWillBeginZooming?(scrollView, with: view)
|
||||
}
|
||||
|
||||
func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewDidEndZooming?(scrollView, with: view, atScale: scale)
|
||||
}
|
||||
|
||||
func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool {
|
||||
guard let target = self.target else {
|
||||
return true
|
||||
}
|
||||
return target.scrollViewShouldScroll?(toTop: scrollView) ?? true
|
||||
}
|
||||
|
||||
func scrollViewDidScrollToTop(_ scrollView: UIScrollView) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewDidScroll?(toTop: scrollView)
|
||||
}
|
||||
|
||||
func scrollViewDidChangeAdjustedContentInset(_ scrollView: UIScrollView) {
|
||||
guard let target = self.target else {
|
||||
return
|
||||
}
|
||||
target.scrollViewDidChangeAdjustedContentInset?(scrollView)
|
||||
}
|
||||
|
||||
func accessibilityScrollStatus(for scrollView: UIScrollView) -> String? {
|
||||
guard let target = self.target else {
|
||||
return nil
|
||||
}
|
||||
return target.accessibilityScrollStatus?(for: scrollView)
|
||||
}
|
||||
|
||||
func accessibilityAttributedScrollStatus(for scrollView: UIScrollView) -> NSAttributedString? {
|
||||
guard let target = self.target else {
|
||||
return nil
|
||||
}
|
||||
return target.accessibilityAttributedScrollStatus?(for: scrollView)
|
||||
}
|
||||
}
|
||||
|
||||
public extension ASScrollViewDelegate {
|
||||
var wrappedScrollViewDelegate: UIScrollViewDelegate & UIScrollViewAccessibilityDelegate {
|
||||
if let delegate = objc_getAssociatedObject(self, &ASScrollViewDelegateKey) as? WrappedScrollViewDelegate {
|
||||
return delegate
|
||||
} else {
|
||||
let delegate = WrappedScrollViewDelegate(target: self)
|
||||
objc_setAssociatedObject(self, &ASScrollViewDelegateKey, delegate, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
|
||||
return delegate
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,7 @@ private struct WrappedGridItemNode: Hashable {
|
||||
}
|
||||
}
|
||||
|
||||
open class GridNode: GridNodeScroller, UIScrollViewDelegate {
|
||||
open class GridNode: GridNodeScroller, ASScrollViewDelegate {
|
||||
public private(set) var gridLayout = GridNodeLayout(size: CGSize(), insets: UIEdgeInsets(), preloadSize: 0.0, type: .fixed(itemSize: CGSize(), fillWidth: nil, lineSpacing: 0.0, itemSpacing: nil))
|
||||
private var firstIndexInSectionOffset: Int = 0
|
||||
public private(set) var items: [GridItem] = []
|
||||
@@ -257,7 +257,7 @@ open class GridNode: GridNodeScroller, UIScrollViewDelegate {
|
||||
self.scrollView.showsVerticalScrollIndicator = false
|
||||
self.scrollView.showsHorizontalScrollIndicator = false
|
||||
self.scrollView.scrollsToTop = false
|
||||
self.scrollView.delegate = self
|
||||
self.scrollView.delegate = self.wrappedScrollViewDelegate
|
||||
}
|
||||
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class GridNodeScrollerView: UIScrollView {
|
||||
}
|
||||
}
|
||||
|
||||
open class GridNodeScroller: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
open class GridNodeScroller: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
public var scrollView: UIScrollView {
|
||||
return self.view as! UIScrollView
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ private func cancelContextGestures(view: UIView) {
|
||||
}
|
||||
}
|
||||
|
||||
open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGestureRecognizerDelegate {
|
||||
open class ListView: ASDisplayNode, ASScrollViewDelegate, ASGestureRecognizerDelegate {
|
||||
public struct ScrollingIndicatorState {
|
||||
public struct Item {
|
||||
public var index: Int
|
||||
@@ -494,13 +494,13 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
self.scroller.alwaysBounceVertical = true
|
||||
self.scroller.contentSize = CGSize(width: 0.0, height: infiniteScrollSize * 2.0)
|
||||
self.scroller.isHidden = true
|
||||
self.scroller.delegate = self
|
||||
self.scroller.delegate = self.wrappedScrollViewDelegate
|
||||
self.view.addSubview(self.scroller)
|
||||
self.scroller.panGestureRecognizer.cancelsTouchesInView = true
|
||||
self.view.addGestureRecognizer(self.scroller.panGestureRecognizer)
|
||||
|
||||
let trackingRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.trackingGesture(_:)))
|
||||
trackingRecognizer.delegate = self
|
||||
trackingRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
trackingRecognizer.cancelsTouchesInView = false
|
||||
self.view.addGestureRecognizer(trackingRecognizer)
|
||||
|
||||
@@ -534,7 +534,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
|
||||
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.tapGesture(_:)))
|
||||
tapGestureRecognizer.isEnabled = false
|
||||
tapGestureRecognizer.delegate = self
|
||||
tapGestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.view.addGestureRecognizer(tapGestureRecognizer)
|
||||
self.tapGestureRecognizer = tapGestureRecognizer
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import UIKit
|
||||
import AsyncDisplayKit
|
||||
import SwiftSignalKit
|
||||
|
||||
public final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
public final class NavigationContainer: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
private final class Child {
|
||||
let value: ViewController
|
||||
var layout: ContainerViewLayout
|
||||
@@ -151,7 +151,7 @@ public final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelega
|
||||
if #available(iOS 13.4, *) {
|
||||
panRecognizer.allowedScrollTypesMask = .continuous
|
||||
}
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panRecognizer.delaysTouchesBegan = false
|
||||
panRecognizer.cancelsTouchesInView = true
|
||||
self.panRecognizer = panRecognizer
|
||||
|
||||
@@ -4,7 +4,7 @@ import AsyncDisplayKit
|
||||
import SwiftSignalKit
|
||||
import UIKitRuntimeUtils
|
||||
|
||||
final class NavigationModalContainer: ASDisplayNode, UIScrollViewDelegate, UIGestureRecognizerDelegate {
|
||||
final class NavigationModalContainer: ASDisplayNode, ASScrollViewDelegate, ASGestureRecognizerDelegate {
|
||||
private var theme: NavigationControllerTheme
|
||||
let isFlat: Bool
|
||||
|
||||
@@ -89,7 +89,7 @@ final class NavigationModalContainer: ASDisplayNode, UIScrollViewDelegate, UIGes
|
||||
}
|
||||
self.scrollNode.view.delaysContentTouches = false
|
||||
self.scrollNode.view.clipsToBounds = false
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
let panRecognizer = InteractiveTransitionGestureRecognizer(target: self, action: #selector(self.panGesture(_:)), allowedDirections: { [weak self] _ in
|
||||
guard let strongSelf = self, !strongSelf.isDismissed else {
|
||||
@@ -109,7 +109,7 @@ final class NavigationModalContainer: ASDisplayNode, UIScrollViewDelegate, UIGes
|
||||
panRecognizer.isEnabled = false
|
||||
}
|
||||
}
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panRecognizer.delaysTouchesBegan = false
|
||||
panRecognizer.cancelsTouchesInView = true
|
||||
if !self.isFlat {
|
||||
@@ -312,7 +312,7 @@ final class NavigationModalContainer: ASDisplayNode, UIScrollViewDelegate, UIGes
|
||||
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
|
||||
}
|
||||
|
||||
func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool {
|
||||
func scrollViewShouldScroll(toTop scrollView: UIScrollView) -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ class CaptionScrollWrapperNode: ASDisplayNode {
|
||||
|
||||
|
||||
|
||||
final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScrollViewDelegate {
|
||||
final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var presentationData: PresentationData
|
||||
private var theme: PresentationTheme
|
||||
@@ -638,7 +638,7 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScroll
|
||||
|
||||
override func didLoad() {
|
||||
super.didLoad()
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollNode.view.showsVerticalScrollIndicator = false
|
||||
|
||||
let backwardLongPressGestureRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(self.seekBackwardLongPress(_:)))
|
||||
|
||||
@@ -6,7 +6,7 @@ import Postbox
|
||||
import SwipeToDismissGesture
|
||||
import AccountContext
|
||||
|
||||
open class GalleryControllerNode: ASDisplayNode, UIScrollViewDelegate, UIGestureRecognizerDelegate {
|
||||
open class GalleryControllerNode: ASDisplayNode, ASScrollViewDelegate, ASGestureRecognizerDelegate {
|
||||
public var statusBar: StatusBar?
|
||||
public var navigationBar: NavigationBar? {
|
||||
didSet {
|
||||
@@ -143,7 +143,7 @@ open class GalleryControllerNode: ASDisplayNode, UIScrollViewDelegate, UIGesture
|
||||
self.scrollView.alwaysBounceHorizontal = false
|
||||
self.scrollView.alwaysBounceVertical = false
|
||||
self.scrollView.clipsToBounds = false
|
||||
self.scrollView.delegate = self
|
||||
self.scrollView.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollView.scrollsToTop = false
|
||||
self.view.addSubview(self.scrollView)
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public struct GalleryPagerTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
public final class GalleryPagerNode: ASDisplayNode, UIScrollViewDelegate, UIGestureRecognizerDelegate {
|
||||
public final class GalleryPagerNode: ASDisplayNode, ASScrollViewDelegate, ASGestureRecognizerDelegate {
|
||||
private let pageGap: CGFloat
|
||||
private let disableTapNavigation: Bool
|
||||
|
||||
@@ -142,7 +142,7 @@ public final class GalleryPagerNode: ASDisplayNode, UIScrollViewDelegate, UIGest
|
||||
self.scrollView.alwaysBounceHorizontal = !pageGap.isZero
|
||||
self.scrollView.bounces = !pageGap.isZero
|
||||
self.scrollView.isPagingEnabled = true
|
||||
self.scrollView.delegate = self
|
||||
self.scrollView.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollView.clipsToBounds = false
|
||||
self.scrollView.scrollsToTop = false
|
||||
self.scrollView.delaysContentTouches = false
|
||||
@@ -167,7 +167,7 @@ public final class GalleryPagerNode: ASDisplayNode, UIScrollViewDelegate, UIGest
|
||||
super.didLoad()
|
||||
|
||||
let recognizer = TapLongTapOrDoubleTapGestureRecognizer(target: self, action: #selector(self.tapLongTapOrDoubleTapGesture(_:)))
|
||||
recognizer.delegate = self
|
||||
recognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.tapRecognizer = recognizer
|
||||
recognizer.tapActionAtPoint = { [weak self] point in
|
||||
guard let strongSelf = self, strongSelf.pagingEnabled else {
|
||||
|
||||
@@ -48,7 +48,7 @@ private final class GalleryThumbnailItemNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
public final class GalleryThumbnailContainerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
public final class GalleryThumbnailContainerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
public let groupId: Int64
|
||||
private let scrollNode: ASScrollNode
|
||||
|
||||
@@ -69,7 +69,7 @@ public final class GalleryThumbnailContainerNode: ASDisplayNode, UIScrollViewDel
|
||||
|
||||
super.init()
|
||||
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.tapGesture(_:))))
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.showsVerticalScrollIndicator = false
|
||||
|
||||
@@ -3,7 +3,7 @@ import UIKit
|
||||
import Display
|
||||
import AsyncDisplayKit
|
||||
|
||||
open class ZoomableContentGalleryItemNode: GalleryItemNode, UIScrollViewDelegate {
|
||||
open class ZoomableContentGalleryItemNode: GalleryItemNode, ASScrollViewDelegate {
|
||||
public let scrollNode: ASScrollNode
|
||||
|
||||
private var containerLayout: ContainerViewLayout?
|
||||
@@ -34,7 +34,7 @@ open class ZoomableContentGalleryItemNode: GalleryItemNode, UIScrollViewDelegate
|
||||
|
||||
super.init()
|
||||
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollNode.view.showsVerticalScrollIndicator = false
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.clipsToBounds = false
|
||||
|
||||
@@ -48,7 +48,7 @@ private struct StickerPackPreviewGridTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
final class ImportStickerPackControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
final class ImportStickerPackControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var presentationData: PresentationData
|
||||
private var stickerPack: ImportStickerPack?
|
||||
@@ -194,7 +194,7 @@ final class ImportStickerPackControllerNode: ViewControllerTracingNode, UIScroll
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.wrappingScrollNode.addSubnode(self.cancelButtonNode)
|
||||
|
||||
@@ -18,7 +18,7 @@ import UndoUI
|
||||
import ContextUI
|
||||
import TranslateUI
|
||||
|
||||
final class InstantPageControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
final class InstantPageControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private weak var controller: InstantPageController?
|
||||
private let context: AccountContext
|
||||
private var settings: InstantPagePresentationSettings?
|
||||
@@ -137,7 +137,7 @@ final class InstantPageControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
self.scrollNode.addSubnode(self.scrollNodeFooter)
|
||||
self.addSubnode(self.navigationBar)
|
||||
self.scrollNode.view.delaysContentTouches = false
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
self.navigationBar.back = navigateBack
|
||||
self.navigationBar.share = { [weak self] in
|
||||
|
||||
@@ -10,7 +10,7 @@ import ShareController
|
||||
import OpenInExternalAppUI
|
||||
import TelegramUIPreferences
|
||||
|
||||
class InstantPageReferenceControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
class InstantPageReferenceControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private let sourceLocation: InstantPageSourceLocation
|
||||
private let theme: InstantPageTheme
|
||||
@@ -84,7 +84,7 @@ class InstantPageReferenceControllerNode: ViewControllerTracingNode, UIScrollVie
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.wrappingScrollNode.addSubnode(self.contentBackgroundNode)
|
||||
|
||||
@@ -63,7 +63,7 @@ private final class InstantPageSlideshowItemNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
private final class InstantPageSlideshowPagerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
private final class InstantPageSlideshowPagerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private let sourceLocation: InstantPageSourceLocation
|
||||
private let theme: InstantPageTheme
|
||||
@@ -123,7 +123,7 @@ private final class InstantPageSlideshowPagerNode: ASDisplayNode, UIScrollViewDe
|
||||
self.scrollView.alwaysBounceHorizontal = !pageGap.isZero
|
||||
self.scrollView.bounces = !pageGap.isZero
|
||||
self.scrollView.isPagingEnabled = true
|
||||
self.scrollView.delegate = self
|
||||
self.scrollView.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollView.clipsToBounds = false
|
||||
self.scrollView.scrollsToTop = false
|
||||
self.view.addSubview(self.scrollView)
|
||||
|
||||
@@ -247,7 +247,7 @@ public final class InviteLinkInviteController: ViewController {
|
||||
self.controllerNode.containerLayoutUpdated(layout, transition: transition)
|
||||
}
|
||||
|
||||
class Node: ViewControllerTracingNode, UIGestureRecognizerDelegate {
|
||||
class Node: ViewControllerTracingNode, ASGestureRecognizerDelegate {
|
||||
private weak var controller: InviteLinkInviteController?
|
||||
|
||||
private let context: AccountContext
|
||||
@@ -574,7 +574,7 @@ public final class InviteLinkInviteController: ViewController {
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
|
||||
let panRecognizer = DirectionalPanGestureRecognizer(target: self, action: #selector(self.panGesture(_:)))
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panRecognizer.delaysTouchesBegan = false
|
||||
panRecognizer.cancelsTouchesInView = true
|
||||
self.view.addGestureRecognizer(panRecognizer)
|
||||
|
||||
@@ -380,7 +380,7 @@ public final class InviteLinkViewController: ViewController {
|
||||
self.controllerNode.containerLayoutUpdated(layout, transition: transition)
|
||||
}
|
||||
|
||||
class Node: ViewControllerTracingNode, UIGestureRecognizerDelegate {
|
||||
class Node: ViewControllerTracingNode, ASGestureRecognizerDelegate {
|
||||
private weak var controller: InviteLinkViewController?
|
||||
|
||||
private let context: AccountContext
|
||||
@@ -855,7 +855,7 @@ public final class InviteLinkViewController: ViewController {
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
|
||||
let panRecognizer = DirectionalPanGestureRecognizer(target: self, action: #selector(self.panGesture(_:)))
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panRecognizer.delaysTouchesBegan = false
|
||||
panRecognizer.cancelsTouchesInView = true
|
||||
self.view.addGestureRecognizer(panRecognizer)
|
||||
|
||||
@@ -58,7 +58,7 @@ public final class ItemListRevealOptionsGestureRecognizer: UIPanGestureRecognize
|
||||
}
|
||||
}
|
||||
|
||||
open class ItemListRevealOptionsItemNode: ListViewItemNode, UIGestureRecognizerDelegate {
|
||||
open class ItemListRevealOptionsItemNode: ListViewItemNode, ASGestureRecognizerDelegate {
|
||||
private var validLayout: (CGSize, CGFloat, CGFloat)?
|
||||
|
||||
private var leftRevealNode: ItemListRevealOptionsNode?
|
||||
@@ -96,13 +96,13 @@ open class ItemListRevealOptionsItemNode: ListViewItemNode, UIGestureRecognizerD
|
||||
|
||||
let recognizer = ItemListRevealOptionsGestureRecognizer(target: self, action: #selector(self.revealGesture(_:)))
|
||||
self.recognizer = recognizer
|
||||
recognizer.delegate = self
|
||||
recognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
recognizer.allowAnyDirection = self.allowAnyDirection
|
||||
self.view.addGestureRecognizer(recognizer)
|
||||
|
||||
let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.revealTapGesture(_:)))
|
||||
self.tapRecognizer = tapRecognizer
|
||||
tapRecognizer.delegate = self
|
||||
tapRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.view.addGestureRecognizer(tapRecognizer)
|
||||
|
||||
self.view.disablesInteractiveTransitionGestureRecognizer = self.allowAnyDirection
|
||||
|
||||
@@ -34,7 +34,7 @@ struct JoinLinkPreviewData {
|
||||
let isJoined: Bool
|
||||
}
|
||||
|
||||
final class JoinLinkPreviewControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
final class JoinLinkPreviewControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var presentationData: PresentationData
|
||||
|
||||
@@ -110,7 +110,7 @@ final class JoinLinkPreviewControllerNode: ViewControllerTracingNode, UIScrollVi
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.cancelButton.addTarget(self, action: #selector(self.cancelButtonPressed), forControlEvents: .touchUpInside)
|
||||
|
||||
@@ -9,7 +9,7 @@ import ActivityIndicator
|
||||
import AccountContext
|
||||
import ShareController
|
||||
|
||||
final class LanguageLinkPreviewControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
final class LanguageLinkPreviewControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var presentationData: PresentationData
|
||||
|
||||
@@ -121,7 +121,7 @@ final class LanguageLinkPreviewControllerNode: ViewControllerTracingNode, UIScro
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.cancelButtonNode.setTitle(self.presentationData.strings.Common_Cancel, with: Font.medium(20.0), with: self.presentationData.theme.actionSheet.standardActionTextColor, for: .normal)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
@property (nonatomic, assign) bool displayEdges;
|
||||
@property (nonatomic, assign) bool useLinesForPositions;
|
||||
@property (nonatomic, assign) bool markPositions;
|
||||
|
||||
@property (nonatomic, readonly) bool knobStartedDragging;
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ const CGFloat TGPhotoEditorSliderViewInternalMargin = 7.0f;
|
||||
_value = _startValue;
|
||||
_dotSize = 10.5f;
|
||||
_minimumUndottedValue = -1;
|
||||
_markPositions = true;
|
||||
|
||||
_lineSize = TGPhotoEditorSliderViewLineSize;
|
||||
_knobPadding = TGPhotoEditorSliderViewInternalMargin;
|
||||
@@ -214,6 +215,12 @@ const CGFloat TGPhotoEditorSliderViewInternalMargin = 7.0f;
|
||||
{
|
||||
for (NSInteger i = 0; i < self.positionsCount; i++)
|
||||
{
|
||||
if (!self.markPositions) {
|
||||
if (i != 0 && i != self.positionsCount - 1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (self.useLinesForPositions) {
|
||||
CGSize lineSize = CGSizeMake(4.0, 12.0);
|
||||
CGRect lineRect = CGRectMake(margin - lineSize.width / 2.0f + totalLength / (self.positionsCount - 1) * i, (sideLength - lineSize.height) / 2, lineSize.width, lineSize.height);
|
||||
|
||||
@@ -169,7 +169,7 @@ private var smallUnitValues: [Int32] = {
|
||||
return values
|
||||
}()
|
||||
|
||||
class LocationDistancePickerScreenNode: ViewControllerTracingNode, UIScrollViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate {
|
||||
class LocationDistancePickerScreenNode: ViewControllerTracingNode, ASScrollViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate {
|
||||
private let context: AccountContext
|
||||
private let controllerStyle: LocationDistancePickerScreenStyle
|
||||
private var presentationData: PresentationData
|
||||
@@ -277,7 +277,7 @@ class LocationDistancePickerScreenNode: ViewControllerTracingNode, UIScrollViewD
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.wrappingScrollNode.addSubnode(self.backgroundNode)
|
||||
|
||||
@@ -14,7 +14,7 @@ struct MediaGroupItem {
|
||||
}
|
||||
|
||||
final class MediaGroupsContextMenuContent: ContextControllerItemsContent {
|
||||
private final class GroupsListNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
private final class GroupsListNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private final class ItemNode: HighlightTrackingButtonNode {
|
||||
let context: AccountContext
|
||||
let highlightBackgroundNode: ASDisplayNode
|
||||
@@ -170,7 +170,7 @@ final class MediaGroupsContextMenuContent: ContextControllerItemsContent {
|
||||
super.init()
|
||||
|
||||
self.addSubnode(self.scrollNode)
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
self.clipsToBounds = true
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
|
||||
|
||||
var dismissAll: () -> Void = { }
|
||||
|
||||
private class Node: ViewControllerTracingNode, UIGestureRecognizerDelegate {
|
||||
private class Node: ViewControllerTracingNode, ASGestureRecognizerDelegate {
|
||||
enum DisplayMode {
|
||||
case all
|
||||
case selected
|
||||
@@ -440,7 +440,7 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
|
||||
|
||||
} else {
|
||||
let selectionGesture = MediaPickerGridSelectionGesture<TGMediaSelectableItem>()
|
||||
selectionGesture.delegate = self
|
||||
selectionGesture.delegate = self.wrappedGestureRecognizerDelegate
|
||||
selectionGesture.began = { [weak self] in
|
||||
self?.controller?.cancelPanGesture()
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ private class MessageBackgroundNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
final class MediaPickerSelectedListNode: ASDisplayNode, UIScrollViewDelegate, UIGestureRecognizerDelegate {
|
||||
final class MediaPickerSelectedListNode: ASDisplayNode, ASScrollViewDelegate, ASGestureRecognizerDelegate {
|
||||
private let context: AccountContext
|
||||
private let persistentItems: Bool
|
||||
|
||||
@@ -539,7 +539,7 @@ final class MediaPickerSelectedListNode: ASDisplayNode, UIScrollViewDelegate, UI
|
||||
self.scrollNode.view.contentInsetAdjustmentBehavior = .never
|
||||
}
|
||||
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollNode.view.panGestureRecognizer.cancelsTouchesInView = true
|
||||
self.scrollNode.view.showsVerticalScrollIndicator = false
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public func parseMediaPlayerChapters(_ string: NSAttributedString) -> [MediaPlay
|
||||
return chapters
|
||||
}
|
||||
|
||||
private final class MediaPlayerScrubbingNodeButton: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
private final class MediaPlayerScrubbingNodeButton: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
var beginScrubbing: (() -> Void)?
|
||||
var endScrubbing: ((Bool) -> Void)?
|
||||
var updateScrubbing: ((CGFloat, Double) -> Void)?
|
||||
@@ -83,7 +83,7 @@ private final class MediaPlayerScrubbingNodeButton: ASDisplayNode, UIGestureReco
|
||||
self.view.disablesInteractiveTransitionGestureRecognizer = true
|
||||
|
||||
let gestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.panGesture(_:)))
|
||||
gestureRecognizer.delegate = self
|
||||
gestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.view.addGestureRecognizer(gestureRecognizer)
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ private enum FilteredItemNeighbor {
|
||||
case item(FormControllerItem)
|
||||
}
|
||||
|
||||
public class FormControllerNode<InitParams, InnerState: FormControllerInnerState>: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
public class FormControllerNode<InitParams, InnerState: FormControllerInnerState>: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private typealias InternalState = FormControllerInternalState<InnerState>
|
||||
typealias State = FormControllerState<InnerState>
|
||||
typealias Entry = InnerState.Entry
|
||||
@@ -142,7 +142,7 @@ public class FormControllerNode<InitParams, InnerState: FormControllerInnerState
|
||||
|
||||
self.scrollNode.backgroundColor = nil
|
||||
self.scrollNode.isOpaque = false
|
||||
self.scrollNode.delegate = self
|
||||
self.scrollNode.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.scrollNode)
|
||||
|
||||
self.scrollNode.view.delaysContentTouches = true
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
import Display
|
||||
|
||||
final class FormControllerScrollerNodeView: UIScrollView {
|
||||
weak var target: FormControllerScrollerNode?
|
||||
@@ -46,7 +47,7 @@ final class FormControllerScrollerNodeView: UIScrollView {
|
||||
}
|
||||
}
|
||||
|
||||
final class FormControllerScrollerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
final class FormControllerScrollerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
override var view: FormControllerScrollerNodeView {
|
||||
return super.view as! FormControllerScrollerNodeView
|
||||
}
|
||||
@@ -66,7 +67,7 @@ final class FormControllerScrollerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
|
||||
override func didLoad() {
|
||||
super.didLoad()
|
||||
self.view.delegate = self
|
||||
self.view.delegate = self.wrappedScrollViewDelegate
|
||||
}
|
||||
|
||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import TelegramPresentationData
|
||||
import ItemListUI
|
||||
import PresentationDataUtils
|
||||
|
||||
class FormEditableBlockItemNode<Item: FormControllerItem>: ASDisplayNode, FormControllerItemNode, FormBlockItemNodeProto, UIGestureRecognizerDelegate {
|
||||
class FormEditableBlockItemNode<Item: FormControllerItem>: ASDisplayNode, FormControllerItemNode, FormBlockItemNodeProto, ASGestureRecognizerDelegate {
|
||||
private let topSeparatorInset: FormBlockItemInset
|
||||
|
||||
private let highlightedBackgroundNode: ASDisplayNode
|
||||
|
||||
@@ -1268,7 +1268,7 @@ private final class TwoFactorDataInputTextNode: ASDisplayNode, UITextFieldDelega
|
||||
}
|
||||
}
|
||||
|
||||
private final class TwoFactorDataInputScreenNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
private final class TwoFactorDataInputScreenNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private var presentationData: PresentationData
|
||||
private let mode: TwoFactorDataInputMode
|
||||
private let action: () -> Void
|
||||
@@ -1818,7 +1818,7 @@ private final class TwoFactorDataInputScreenNode: ViewControllerTracingNode, UIS
|
||||
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
|
||||
self.scrollNode.view.contentInsetAdjustmentBehavior = .never
|
||||
}
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
}
|
||||
|
||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||
|
||||
@@ -1596,7 +1596,7 @@ public class PremiumBoostLevelsScreen: ViewController {
|
||||
case features
|
||||
}
|
||||
|
||||
final class Node: ViewControllerTracingNode, UIScrollViewDelegate, UIGestureRecognizerDelegate {
|
||||
final class Node: ViewControllerTracingNode, ASScrollViewDelegate, ASGestureRecognizerDelegate {
|
||||
private var presentationData: PresentationData
|
||||
private weak var controller: PremiumBoostLevelsScreen?
|
||||
|
||||
@@ -1727,7 +1727,7 @@ public class PremiumBoostLevelsScreen: ViewController {
|
||||
super.didLoad()
|
||||
|
||||
let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.panGesture(_:)))
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panRecognizer.delaysTouchesBegan = false
|
||||
panRecognizer.cancelsTouchesInView = true
|
||||
self.panGestureRecognizer = panRecognizer
|
||||
|
||||
@@ -18,7 +18,7 @@ import SolidRoundedButtonNode
|
||||
import BlurredBackgroundComponent
|
||||
|
||||
public class PremiumLimitsListScreen: ViewController {
|
||||
final class Node: ViewControllerTracingNode, UIScrollViewDelegate, UIGestureRecognizerDelegate {
|
||||
final class Node: ViewControllerTracingNode, ASScrollViewDelegate, ASGestureRecognizerDelegate {
|
||||
private var presentationData: PresentationData
|
||||
private weak var controller: PremiumLimitsListScreen?
|
||||
|
||||
@@ -188,7 +188,7 @@ public class PremiumLimitsListScreen: ViewController {
|
||||
super.didLoad()
|
||||
|
||||
let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.panGesture(_:)))
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panRecognizer.delaysTouchesBegan = false
|
||||
panRecognizer.cancelsTouchesInView = true
|
||||
self.panGestureRecognizer = panRecognizer
|
||||
|
||||
@@ -294,7 +294,7 @@ private final class ReplaceBoostScreenComponent: CombinedComponent {
|
||||
}
|
||||
|
||||
public class ReplaceBoostScreen: ViewController {
|
||||
final class Node: ViewControllerTracingNode, UIScrollViewDelegate, UIGestureRecognizerDelegate {
|
||||
final class Node: ViewControllerTracingNode, ASScrollViewDelegate, ASGestureRecognizerDelegate {
|
||||
private var presentationData: PresentationData
|
||||
private weak var controller: ReplaceBoostScreen?
|
||||
|
||||
@@ -345,7 +345,7 @@ public class ReplaceBoostScreen: ViewController {
|
||||
|
||||
super.init()
|
||||
|
||||
self.scrollView.delegate = self
|
||||
self.scrollView.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollView.showsVerticalScrollIndicator = false
|
||||
|
||||
self.containerView.clipsToBounds = true
|
||||
@@ -373,7 +373,7 @@ public class ReplaceBoostScreen: ViewController {
|
||||
super.didLoad()
|
||||
|
||||
let panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.panGesture(_:)))
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panRecognizer.delaysTouchesBegan = false
|
||||
panRecognizer.cancelsTouchesInView = true
|
||||
self.panGestureRecognizer = panRecognizer
|
||||
|
||||
@@ -279,7 +279,7 @@ private class StickerNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
private class StickersCarouselNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
private class StickersCarouselNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private let stickers: [TelegramMediaFile]
|
||||
private let tapAction: () -> Void
|
||||
@@ -331,7 +331,7 @@ private class StickersCarouselNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
override func didLoad() {
|
||||
super.didLoad()
|
||||
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.showsVerticalScrollIndicator = false
|
||||
self.scrollNode.view.canCancelContentTouches = true
|
||||
|
||||
@@ -387,7 +387,7 @@ private final class FrameNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
private final class QrCodeScanScreenNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
private final class QrCodeScanScreenNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var presentationData: PresentationData
|
||||
private weak var controller: QrCodeScanScreen?
|
||||
|
||||
@@ -182,7 +182,7 @@ public final class QrCodeScreen: ViewController {
|
||||
self.controllerNode.containerLayoutUpdated(layout, navigationBarHeight: self.navigationLayout(layout: layout).navigationFrame.maxY, transition: transition)
|
||||
}
|
||||
|
||||
class Node: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
class Node: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private let subject: QrCodeScreen.Subject
|
||||
private var presentationData: PresentationData
|
||||
@@ -279,7 +279,7 @@ public final class QrCodeScreen: ViewController {
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.wrappingScrollNode.addSubnode(self.backgroundNode)
|
||||
|
||||
@@ -241,7 +241,7 @@ private final class TitleLabelView: UIView {
|
||||
}
|
||||
}
|
||||
|
||||
public final class ReactionContextNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
public final class ReactionContextNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private struct ItemLayout {
|
||||
var itemSize: CGFloat
|
||||
var visibleItemCount: Int
|
||||
@@ -590,7 +590,7 @@ public final class ReactionContextNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
|
||||
self.addSubnode(self.backgroundNode)
|
||||
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
self.addSubnode(self.contentContainer)
|
||||
self.addSubnode(self.previewingItemContainer)
|
||||
|
||||
@@ -83,7 +83,7 @@ private class SegmentedControlItemNode: HighlightTrackingButtonNode {
|
||||
}
|
||||
}
|
||||
|
||||
public final class SegmentedControlNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
public final class SegmentedControlNode: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
private var theme: SegmentedControlTheme
|
||||
private var _items: [SegmentedControlItem]
|
||||
private var _selectedIndex: Int = 0
|
||||
@@ -224,7 +224,7 @@ public final class SegmentedControlNode: ASDisplayNode, UIGestureRecognizerDeleg
|
||||
self.view.disablesInteractiveTransitionGestureRecognizer = true
|
||||
|
||||
let gestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.panGesture(_:)))
|
||||
gestureRecognizer.delegate = self
|
||||
gestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.view.addGestureRecognizer(gestureRecognizer)
|
||||
self.gestureRecognizer = gestureRecognizer
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ private func generateMaskImage(color: UIColor) -> UIImage? {
|
||||
})
|
||||
}
|
||||
|
||||
private final class BubbleSettingsControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
private final class BubbleSettingsControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var presentationThemeSettings: PresentationThemeSettings
|
||||
private var presentationData: PresentationData
|
||||
@@ -132,7 +132,7 @@ private final class BubbleSettingsControllerNode: ASDisplayNode, UIScrollViewDel
|
||||
self.scrollNode.view.disablesInteractiveTransitionGestureRecognizer = true
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.isPagingEnabled = true
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollNode.view.alwaysBounceHorizontal = false
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ final class RecentSessionScreen: ViewController {
|
||||
}
|
||||
}
|
||||
|
||||
private class RecentSessionScreenNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
private class RecentSessionScreenNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var presentationData: PresentationData
|
||||
private weak var controller: RecentSessionScreen?
|
||||
@@ -459,7 +459,7 @@ private class RecentSessionScreenNode: ViewControllerTracingNode, UIScrollViewDe
|
||||
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.wrappingScrollNode.addSubnode(self.backgroundNode)
|
||||
|
||||
@@ -31,7 +31,7 @@ private func generateMaskImage(color: UIColor) -> UIImage? {
|
||||
})
|
||||
}
|
||||
|
||||
private final class TextSizeSelectionControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
private final class TextSizeSelectionControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var presentationThemeSettings: PresentationThemeSettings
|
||||
private var presentationData: PresentationData
|
||||
@@ -173,7 +173,7 @@ private final class TextSizeSelectionControllerNode: ASDisplayNode, UIScrollView
|
||||
self.scrollNode.view.disablesInteractiveTransitionGestureRecognizer = true
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.isPagingEnabled = true
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.pageControlNode.setPage(0.0)
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ private func generateMaskImage(color: UIColor) -> UIImage? {
|
||||
})
|
||||
}
|
||||
|
||||
final class ThemePreviewControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
final class ThemePreviewControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var previewTheme: PresentationTheme
|
||||
private var presentationData: PresentationData
|
||||
@@ -318,7 +318,7 @@ final class ThemePreviewControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
self.scrollNode.view.disablesInteractiveTransitionGestureRecognizer = true
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.isPagingEnabled = true
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.pageControlNode.setPage(0.0)
|
||||
}
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ private final class ShareContentInfoView: UIView {
|
||||
}
|
||||
}
|
||||
|
||||
final class ShareControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
final class ShareControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private weak var controller: ShareController?
|
||||
private let environment: ShareControllerEnvironment
|
||||
private var context: ShareControllerAccountContext?
|
||||
@@ -624,7 +624,7 @@ final class ShareControllerNode: ViewControllerTracingNode, UIScrollViewDelegate
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.cancelButtonNode.setTitle(self.presentationData.strings.Common_Cancel, with: Font.medium(20.0), with: self.presentationData.theme.actionSheet.standardActionTextColor, for: .normal)
|
||||
|
||||
@@ -338,7 +338,7 @@ public final class SparseItemGrid: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
private final class Viewport: ASDisplayNode, UIScrollViewDelegate {
|
||||
private final class Viewport: ASDisplayNode, ASScrollViewDelegate {
|
||||
final class VisibleItem: SparseItemGridDisplayItem {
|
||||
let layer: SparseItemGridLayer?
|
||||
let view: SparseItemGridView?
|
||||
@@ -527,7 +527,7 @@ public final class SparseItemGrid: ASDisplayNode {
|
||||
|
||||
self.anchorPoint = CGPoint()
|
||||
|
||||
self.scrollView.delegate = self
|
||||
self.scrollView.delegate = self.wrappedScrollViewDelegate
|
||||
self.view.addSubview(self.scrollView)
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ private struct StickerPackPreviewGridTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
final class StickerPackPreviewControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
final class StickerPackPreviewControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private let openShare: (() -> Void)?
|
||||
private var presentationData: PresentationData
|
||||
@@ -152,7 +152,7 @@ final class StickerPackPreviewControllerNode: ViewControllerTracingNode, UIScrol
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.wrappingScrollNode.addSubnode(self.cancelButtonNode)
|
||||
|
||||
@@ -9,7 +9,7 @@ import TelegramPresentationData
|
||||
import AccountContext
|
||||
import StickerResources
|
||||
|
||||
final class StickerPreviewControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
final class StickerPreviewControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private let presentationData: PresentationData
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ final class TabBarNodeItem {
|
||||
}
|
||||
}
|
||||
|
||||
class TabBarNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
class TabBarNode: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
var tabBarItems: [TabBarNodeItem] = [] {
|
||||
didSet {
|
||||
self.reloadTabBarItems()
|
||||
@@ -389,7 +389,7 @@ class TabBarNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
super.didLoad()
|
||||
|
||||
let recognizer = TapLongTapOrDoubleTapGestureRecognizer(target: self, action: #selector(self.tapLongTapOrDoubleTapGesture(_:)))
|
||||
recognizer.delegate = self
|
||||
recognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
recognizer.tapActionAtPoint = { _ in
|
||||
return .keepWithSingleTap
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import TelegramCore
|
||||
import TelegramPresentationData
|
||||
import AccountContext
|
||||
|
||||
public final class MediaNavigationAccessoryContainerNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
public final class MediaNavigationAccessoryContainerNode: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
private let displayBackground: Bool
|
||||
|
||||
public let backgroundNode: ASDisplayNode
|
||||
|
||||
@@ -140,7 +140,7 @@ private func generateMaskImage(color: UIColor) -> UIImage? {
|
||||
})
|
||||
}
|
||||
|
||||
public final class MediaNavigationAccessoryHeaderNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
public final class MediaNavigationAccessoryHeaderNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
public static let minimizedHeight: CGFloat = 37.0
|
||||
|
||||
private let context: AccountContext
|
||||
@@ -345,7 +345,7 @@ public final class MediaNavigationAccessoryHeaderNode: ASDisplayNode, UIScrollVi
|
||||
|
||||
self.view.disablesInteractiveTransitionGestureRecognizer = true
|
||||
self.scrollNode.view.alwaysBounceHorizontal = true
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollNode.view.isPagingEnabled = true
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.showsVerticalScrollIndicator = false
|
||||
|
||||
@@ -112,7 +112,7 @@ final class VoiceChatCameraPreviewController: ViewController {
|
||||
}
|
||||
}
|
||||
|
||||
private class VoiceChatCameraPreviewControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
private class VoiceChatCameraPreviewControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private weak var controller: VoiceChatCameraPreviewController?
|
||||
private let sharedContext: SharedAccountContext
|
||||
private var presentationData: PresentationData
|
||||
@@ -223,7 +223,7 @@ private class VoiceChatCameraPreviewControllerNode: ViewControllerTracingNode, U
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.wrappingScrollNode.addSubnode(self.backgroundNode)
|
||||
@@ -510,7 +510,7 @@ private class VoiceChatCameraPreviewControllerNode: ViewControllerTracingNode, U
|
||||
private let textFont = Font.with(size: 14.0, design: .camera, weight: .regular)
|
||||
private let selectedTextFont = Font.with(size: 14.0, design: .camera, weight: .semibold)
|
||||
|
||||
private class WheelControlNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
private class WheelControlNode: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
struct Item: Equatable {
|
||||
public let title: String
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ public final class VoiceChatControllerImpl: ViewController, VoiceChatController
|
||||
case fullscreen(controlsHidden: Bool)
|
||||
}
|
||||
|
||||
fileprivate final class Node: ViewControllerTracingNode, UIGestureRecognizerDelegate {
|
||||
fileprivate final class Node: ViewControllerTracingNode, ASGestureRecognizerDelegate {
|
||||
private struct ListTransition {
|
||||
let deletions: [ListViewDeleteItem]
|
||||
let insertions: [ListViewInsertItem]
|
||||
@@ -3022,11 +3022,11 @@ public final class VoiceChatControllerImpl: ViewController, VoiceChatController
|
||||
|
||||
let longTapRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(self.actionButtonPressGesture(_:)))
|
||||
longTapRecognizer.minimumPressDuration = 0.001
|
||||
longTapRecognizer.delegate = self
|
||||
longTapRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.actionButton.view.addGestureRecognizer(longTapRecognizer)
|
||||
|
||||
let panRecognizer = DirectionalPanGestureRecognizer(target: self, action: #selector(self.panGesture(_:)))
|
||||
panRecognizer.delegate = self
|
||||
panRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panRecognizer.delaysTouchesBegan = false
|
||||
panRecognizer.cancelsTouchesInView = true
|
||||
self.view.addGestureRecognizer(panRecognizer)
|
||||
@@ -6747,7 +6747,7 @@ public final class VoiceChatControllerImpl: ViewController, VoiceChatController
|
||||
self.updateDecorationsLayout(transition: transition)
|
||||
}
|
||||
}
|
||||
if false, let (peerId, _) = minimalVisiblePeerid {
|
||||
if !"".isEmpty, let (peerId, _) = minimalVisiblePeerid {
|
||||
var index = 0
|
||||
for item in self.currentEntries {
|
||||
if case let .peer(entry, _) = item, entry.peer.id == peerId {
|
||||
|
||||
@@ -176,7 +176,7 @@ public final class VoiceChatJoinScreen: ViewController {
|
||||
self.controllerNode.containerLayoutUpdated(layout, navigationBarHeight: self.navigationLayout(layout: layout).navigationFrame.maxY, transition: transition)
|
||||
}
|
||||
|
||||
class Node: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
class Node: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var presentationData: PresentationData
|
||||
private let asSpeaker: Bool
|
||||
@@ -285,7 +285,7 @@ public final class VoiceChatJoinScreen: ViewController {
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.cancelButtonNode.setTitle(self.presentationData.strings.Common_Cancel, with: Font.medium(20.0), with: self.presentationData.theme.actionSheet.standardActionTextColor, for: .normal)
|
||||
|
||||
@@ -17,7 +17,7 @@ import TooltipUI
|
||||
private let slideOffset: CGFloat = 80.0 + 44.0
|
||||
|
||||
public final class VoiceChatOverlayController: ViewController {
|
||||
private final class Node: ViewControllerTracingNode, UIGestureRecognizerDelegate {
|
||||
private final class Node: ViewControllerTracingNode, ASGestureRecognizerDelegate {
|
||||
private weak var controller: VoiceChatOverlayController?
|
||||
|
||||
private var validLayout: ContainerViewLayout?
|
||||
|
||||
@@ -90,7 +90,7 @@ final class VoiceChatRecordingSetupController: ViewController {
|
||||
}
|
||||
}
|
||||
|
||||
private class VoiceChatRecordingSetupControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
private class VoiceChatRecordingSetupControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
enum MediaMode {
|
||||
case videoAndAudio
|
||||
case audioOnly
|
||||
@@ -263,7 +263,7 @@ private class VoiceChatRecordingSetupControllerNode: ViewControllerTracingNode,
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.wrappingScrollNode.addSubnode(self.backgroundNode)
|
||||
|
||||
+1
@@ -73,6 +73,7 @@ public struct PresentationResourcesSettings {
|
||||
public static let stories = renderIcon(name: "Settings/Menu/Stories")
|
||||
public static let premiumGift = renderIcon(name: "Settings/Menu/Gift")
|
||||
public static let business = renderIcon(name: "Settings/Menu/Business", backgroundColors: [UIColor(rgb: 0xA95CE3), UIColor(rgb: 0xF16B80)])
|
||||
public static let myProfile = renderIcon(name: "Settings/Menu/Profile")
|
||||
|
||||
public static let premium = generateImage(CGSize(width: 29.0, height: 29.0), contextGenerator: { size, context in
|
||||
let bounds = CGRect(origin: CGPoint(), size: size)
|
||||
|
||||
@@ -1389,7 +1389,7 @@ public class CameraScreen: ViewController {
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate final class Node: ViewControllerTracingNode, UIGestureRecognizerDelegate {
|
||||
fileprivate final class Node: ViewControllerTracingNode, ASGestureRecognizerDelegate {
|
||||
private weak var controller: CameraScreen?
|
||||
private let context: AccountContext
|
||||
fileprivate var camera: Camera?
|
||||
@@ -1700,7 +1700,7 @@ public class CameraScreen: ViewController {
|
||||
self.previewContainerView.addGestureRecognizer(pinchGestureRecognizer)
|
||||
|
||||
let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.handlePan(_:)))
|
||||
panGestureRecognizer.delegate = self
|
||||
panGestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panGestureRecognizer.maximumNumberOfTouches = 1
|
||||
self.panGestureRecognizer = panGestureRecognizer
|
||||
self.previewContainerView.addGestureRecognizer(panGestureRecognizer)
|
||||
@@ -1713,7 +1713,7 @@ public class CameraScreen: ViewController {
|
||||
self.previewContainerView.addGestureRecognizer(doubleGestureRecognizer)
|
||||
|
||||
let pipPanGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.handlePipPan(_:)))
|
||||
pipPanGestureRecognizer.delegate = self
|
||||
pipPanGestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.previewContainerView.addGestureRecognizer(pipPanGestureRecognizer)
|
||||
self.pipPanGestureRecognizer = pipPanGestureRecognizer
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public protocol ChatEmptyNodeStickerContentNode: ASDisplayNode {
|
||||
var stickerNode: ChatMediaInputStickerGridItemNode { get }
|
||||
}
|
||||
|
||||
public final class ChatEmptyNodeGreetingChatContent: ASDisplayNode, ChatEmptyNodeStickerContentNode, ChatEmptyNodeContent, UIGestureRecognizerDelegate {
|
||||
public final class ChatEmptyNodeGreetingChatContent: ASDisplayNode, ChatEmptyNodeStickerContentNode, ChatEmptyNodeContent, ASGestureRecognizerDelegate {
|
||||
private let context: AccountContext
|
||||
private let interaction: ChatPanelInterfaceInteraction?
|
||||
|
||||
@@ -134,7 +134,7 @@ public final class ChatEmptyNodeGreetingChatContent: ASDisplayNode, ChatEmptyNod
|
||||
super.didLoad()
|
||||
|
||||
let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.stickerTapGesture(_:)))
|
||||
tapRecognizer.delegate = self
|
||||
tapRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.stickerNode.view.addGestureRecognizer(tapRecognizer)
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ public final class ChatEmptyNodeGreetingChatContent: ASDisplayNode, ChatEmptyNod
|
||||
}
|
||||
}
|
||||
|
||||
public final class ChatEmptyNodeNearbyChatContent: ASDisplayNode, ChatEmptyNodeStickerContentNode, ChatEmptyNodeContent, UIGestureRecognizerDelegate {
|
||||
public final class ChatEmptyNodeNearbyChatContent: ASDisplayNode, ChatEmptyNodeStickerContentNode, ChatEmptyNodeContent, ASGestureRecognizerDelegate {
|
||||
private let context: AccountContext
|
||||
private let interaction: ChatPanelInterfaceInteraction?
|
||||
|
||||
@@ -342,7 +342,7 @@ public final class ChatEmptyNodeNearbyChatContent: ASDisplayNode, ChatEmptyNodeS
|
||||
super.didLoad()
|
||||
|
||||
let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.stickerTapGesture(_:)))
|
||||
tapRecognizer.delegate = self
|
||||
tapRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.stickerNode.view.addGestureRecognizer(tapRecognizer)
|
||||
}
|
||||
|
||||
@@ -1082,7 +1082,7 @@ private final class ChatEmptyNodeCloudChatContent: ASDisplayNode, ChatEmptyNodeC
|
||||
}
|
||||
}
|
||||
|
||||
public final class ChatEmptyNodeTopicChatContent: ASDisplayNode, ChatEmptyNodeContent, UIGestureRecognizerDelegate {
|
||||
public final class ChatEmptyNodeTopicChatContent: ASDisplayNode, ChatEmptyNodeContent, ASGestureRecognizerDelegate {
|
||||
private let context: AccountContext
|
||||
|
||||
private let titleNode: ImmediateTextNode
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ private let titleFont = Font.medium(15.0)
|
||||
private let textFont = Font.regular(13.0)
|
||||
private let boldTextFont = Font.semibold(13.0)
|
||||
|
||||
public class ChatMessageGiveawayBubbleContentNode: ChatMessageBubbleContentNode, UIGestureRecognizerDelegate {
|
||||
public class ChatMessageGiveawayBubbleContentNode: ChatMessageBubbleContentNode, ASGestureRecognizerDelegate {
|
||||
private let dateAndStatusNode: ChatMessageDateAndStatusNode
|
||||
|
||||
private let placeholderNode: StickerShimmerEffectNode
|
||||
@@ -170,7 +170,7 @@ public class ChatMessageGiveawayBubbleContentNode: ChatMessageBubbleContentNode,
|
||||
super.didLoad()
|
||||
|
||||
let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.bubbleTap(_:)))
|
||||
tapRecognizer.delegate = self
|
||||
tapRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.view.addGestureRecognizer(tapRecognizer)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ private let nameFont = Font.medium(14.0)
|
||||
private let inlineBotPrefixFont = Font.regular(14.0)
|
||||
private let inlineBotNameFont = nameFont
|
||||
|
||||
public class ChatMessageInstantVideoItemNode: ChatMessageItemView, UIGestureRecognizerDelegate {
|
||||
public class ChatMessageInstantVideoItemNode: ChatMessageItemView, ASGestureRecognizerDelegate {
|
||||
public let contextSourceNode: ContextExtractedContentContainingNode
|
||||
public let containerNode: ContextControllerSourceNode
|
||||
public let interactiveVideoNode: ChatMessageInteractiveInstantVideoNode
|
||||
|
||||
+2
-2
@@ -751,7 +751,7 @@ private func generateShadowImage() -> UIImage? {
|
||||
})?.stretchableImage(withLeftCapWidth: 20, topCapHeight: 0)
|
||||
}
|
||||
|
||||
private class ChatQrCodeScreenNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
private class ChatQrCodeScreenNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private var presentationData: PresentationData
|
||||
private weak var controller: ChatQrCodeScreen?
|
||||
@@ -1285,7 +1285,7 @@ private class ChatQrCodeScreenNode: ViewControllerTracingNode, UIScrollViewDeleg
|
||||
override public func didLoad() {
|
||||
super.didLoad()
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
|
||||
self.wrappingScrollNode.view.contentInsetAdjustmentBehavior = .never
|
||||
}
|
||||
|
||||
+3
-3
@@ -62,7 +62,7 @@ private extension CGPoint {
|
||||
}
|
||||
}
|
||||
|
||||
public final class InstantVideoRadialStatusNode: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
public final class InstantVideoRadialStatusNode: ASDisplayNode, ASGestureRecognizerDelegate {
|
||||
private let color: UIColor
|
||||
private let hasSeek: Bool
|
||||
private let sparks: Bool
|
||||
@@ -177,11 +177,11 @@ public final class InstantVideoRadialStatusNode: ASDisplayNode, UIGestureRecogni
|
||||
}
|
||||
|
||||
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.tapGesture(_:)))
|
||||
tapGestureRecognizer.delegate = self
|
||||
tapGestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.view.addGestureRecognizer(tapGestureRecognizer)
|
||||
|
||||
let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.panGesture(_:)))
|
||||
panGestureRecognizer.delegate = self
|
||||
panGestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.view.addGestureRecognizer(panGestureRecognizer)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ import SolidRoundedButtonNode
|
||||
import PresentationDataUtils
|
||||
import UIKitRuntimeUtils
|
||||
|
||||
class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
class ChatScheduleTimeControllerNode: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private let context: AccountContext
|
||||
private let mode: ChatScheduleTimeControllerMode
|
||||
private let controllerStyle: ChatScheduleTimeControllerStyle
|
||||
@@ -128,7 +128,7 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.wrappingScrollNode.addSubnode(self.backgroundNode)
|
||||
|
||||
@@ -259,7 +259,7 @@ private var timerValues: [Int32] = {
|
||||
return values
|
||||
}()
|
||||
|
||||
class ChatTimerScreenNode: ViewControllerTracingNode, UIScrollViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate {
|
||||
class ChatTimerScreenNode: ViewControllerTracingNode, ASScrollViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate {
|
||||
private let context: AccountContext
|
||||
private let controllerStyle: ChatTimerScreenStyle
|
||||
private var presentationData: PresentationData
|
||||
@@ -400,7 +400,7 @@ class ChatTimerScreenNode: ViewControllerTracingNode, UIScrollViewDelegate, UIPi
|
||||
self.dimNode.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimTapGesture(_:))))
|
||||
self.addSubnode(self.dimNode)
|
||||
|
||||
self.wrappingScrollNode.view.delegate = self
|
||||
self.wrappingScrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.addSubnode(self.wrappingScrollNode)
|
||||
|
||||
self.wrappingScrollNode.addSubnode(self.backgroundNode)
|
||||
|
||||
+17
-2
@@ -15,6 +15,7 @@ public final class EmptyStateIndicatorComponent: Component {
|
||||
public let title: String
|
||||
public let text: String
|
||||
public let actionTitle: String?
|
||||
public let fitToHeight: Bool
|
||||
public let action: () -> Void
|
||||
public let additionalActionTitle: String?
|
||||
public let additionalAction: () -> Void
|
||||
@@ -22,6 +23,7 @@ public final class EmptyStateIndicatorComponent: Component {
|
||||
public init(
|
||||
context: AccountContext,
|
||||
theme: PresentationTheme,
|
||||
fitToHeight: Bool,
|
||||
animationName: String,
|
||||
title: String,
|
||||
text: String,
|
||||
@@ -32,6 +34,7 @@ public final class EmptyStateIndicatorComponent: Component {
|
||||
) {
|
||||
self.context = context
|
||||
self.theme = theme
|
||||
self.fitToHeight = fitToHeight
|
||||
self.animationName = animationName
|
||||
self.title = title
|
||||
self.text = text
|
||||
@@ -48,6 +51,9 @@ public final class EmptyStateIndicatorComponent: Component {
|
||||
if lhs.theme !== rhs.theme {
|
||||
return false
|
||||
}
|
||||
if lhs.fitToHeight != rhs.fitToHeight {
|
||||
return false
|
||||
}
|
||||
if lhs.animationName != rhs.animationName {
|
||||
return false
|
||||
}
|
||||
@@ -205,7 +211,12 @@ public final class EmptyStateIndicatorComponent: Component {
|
||||
totalHeight += buttonSpacing + additionalButtonSize.height
|
||||
}
|
||||
|
||||
var contentY = floor((availableSize.height - totalHeight) * 0.5)
|
||||
var contentY: CGFloat
|
||||
if component.fitToHeight {
|
||||
contentY = 0.0
|
||||
} else {
|
||||
contentY = floor((availableSize.height - totalHeight) * 0.5)
|
||||
}
|
||||
|
||||
if let animationView = self.animation.view {
|
||||
if animationView.superview == nil {
|
||||
@@ -243,7 +254,11 @@ public final class EmptyStateIndicatorComponent: Component {
|
||||
contentY += additionalButtonSize.height
|
||||
}
|
||||
|
||||
return availableSize
|
||||
if component.fitToHeight {
|
||||
return CGSize(width: availableSize.width, height: totalHeight)
|
||||
} else {
|
||||
return availableSize
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public final class EntitySearchContainerController: ViewController {
|
||||
self.node.containerLayoutUpdated(layout, transition: transition)
|
||||
}
|
||||
|
||||
private class Node: ViewControllerTracingNode, UIScrollViewDelegate {
|
||||
private class Node: ViewControllerTracingNode, ASScrollViewDelegate {
|
||||
private weak var controller: EntitySearchContainerController?
|
||||
|
||||
private let containerNode: EntitySearchContainerNode
|
||||
|
||||
+68
-8
@@ -11,18 +11,24 @@ import SliderComponent
|
||||
public final class ListItemSliderSelectorComponent: Component {
|
||||
public let theme: PresentationTheme
|
||||
public let values: [String]
|
||||
public let markPositions: Bool
|
||||
public let selectedIndex: Int
|
||||
public let title: String?
|
||||
public let selectedIndexUpdated: (Int) -> Void
|
||||
|
||||
public init(
|
||||
theme: PresentationTheme,
|
||||
values: [String],
|
||||
markPositions: Bool,
|
||||
selectedIndex: Int,
|
||||
title: String?,
|
||||
selectedIndexUpdated: @escaping (Int) -> Void
|
||||
) {
|
||||
self.theme = theme
|
||||
self.values = values
|
||||
self.markPositions = markPositions
|
||||
self.selectedIndex = selectedIndex
|
||||
self.title = title
|
||||
self.selectedIndexUpdated = selectedIndexUpdated
|
||||
}
|
||||
|
||||
@@ -33,14 +39,21 @@ public final class ListItemSliderSelectorComponent: Component {
|
||||
if lhs.values != rhs.values {
|
||||
return false
|
||||
}
|
||||
if lhs.markPositions != rhs.markPositions {
|
||||
return false
|
||||
}
|
||||
if lhs.selectedIndex != rhs.selectedIndex {
|
||||
return false
|
||||
}
|
||||
if lhs.title != rhs.title {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
public final class View: UIView, ListSectionComponent.ChildView {
|
||||
private var titles: [ComponentView<Empty>] = []
|
||||
private var titles: [Int: ComponentView<Empty>] = [:]
|
||||
private var mainTitle: ComponentView<Empty>?
|
||||
private var slider = ComponentView<Empty>()
|
||||
|
||||
private var component: ListItemSliderSelectorComponent?
|
||||
@@ -67,15 +80,24 @@ public final class ListItemSliderSelectorComponent: Component {
|
||||
|
||||
let titleAreaWidth: CGFloat = availableSize.width - titleSideInset * 2.0
|
||||
|
||||
var validIds: [Int] = []
|
||||
for i in 0 ..< component.values.count {
|
||||
if component.title != nil {
|
||||
if i != 0 && i != component.values.count - 1 {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
validIds.append(i)
|
||||
|
||||
var titleTransition = transition
|
||||
let title: ComponentView<Empty>
|
||||
if self.titles.count > i {
|
||||
title = self.titles[i]
|
||||
if let current = self.titles[i] {
|
||||
title = current
|
||||
} else {
|
||||
titleTransition = titleTransition.withAnimation(.none)
|
||||
title = ComponentView()
|
||||
self.titles.append(title)
|
||||
self.titles[i] = title
|
||||
}
|
||||
let titleSize = title.update(
|
||||
transition: .immediate,
|
||||
@@ -103,11 +125,48 @@ public final class ListItemSliderSelectorComponent: Component {
|
||||
titleTransition.setPosition(view: titleView, position: titleFrame.center)
|
||||
}
|
||||
}
|
||||
if self.titles.count > component.values.count {
|
||||
for i in component.values.count ..< self.titles.count {
|
||||
self.titles[i].view?.removeFromSuperview()
|
||||
var removeIds: [Int] = []
|
||||
for (id, title) in self.titles {
|
||||
if !validIds.contains(id) {
|
||||
removeIds.append(id)
|
||||
title.view?.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
for id in removeIds {
|
||||
self.titles.removeValue(forKey: id)
|
||||
}
|
||||
|
||||
if let title = component.title {
|
||||
let mainTitle: ComponentView<Empty>
|
||||
var mainTitleTransition = transition
|
||||
if let current = self.mainTitle {
|
||||
mainTitle = current
|
||||
} else {
|
||||
mainTitleTransition = mainTitleTransition.withAnimation(.none)
|
||||
mainTitle = ComponentView()
|
||||
self.mainTitle = mainTitle
|
||||
}
|
||||
let mainTitleSize = mainTitle.update(
|
||||
transition: .immediate,
|
||||
component: AnyComponent(MultilineTextComponent(
|
||||
text: .plain(NSAttributedString(string: title, font: Font.regular(16.0), textColor: component.theme.list.itemPrimaryTextColor))
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: CGSize(width: 100.0, height: 100.0)
|
||||
)
|
||||
let mainTitleFrame = CGRect(origin: CGPoint(x: floor((availableSize.width - mainTitleSize.width) * 0.5), y: 10.0), size: mainTitleSize)
|
||||
if let mainTitleView = mainTitle.view {
|
||||
if mainTitleView.superview == nil {
|
||||
self.addSubview(mainTitleView)
|
||||
}
|
||||
mainTitleView.bounds = CGRect(origin: CGPoint(), size: mainTitleFrame.size)
|
||||
mainTitleTransition.setPosition(view: mainTitleView, position: mainTitleFrame.center)
|
||||
}
|
||||
} else {
|
||||
if let mainTitle = self.mainTitle {
|
||||
self.mainTitle = nil
|
||||
mainTitle.view?.removeFromSuperview()
|
||||
}
|
||||
self.titles.removeLast(self.titles.count - component.values.count)
|
||||
}
|
||||
|
||||
let sliderSize = self.slider.update(
|
||||
@@ -115,6 +174,7 @@ public final class ListItemSliderSelectorComponent: Component {
|
||||
component: AnyComponent(SliderComponent(
|
||||
valueCount: component.values.count,
|
||||
value: component.selectedIndex,
|
||||
markPositions: component.markPositions,
|
||||
trackBackgroundColor: component.theme.list.controlSecondaryColor,
|
||||
trackForegroundColor: component.theme.list.itemAccentColor,
|
||||
valueUpdated: { [weak self] value in
|
||||
|
||||
@@ -288,7 +288,7 @@ private final class MediaCutoutScreenComponent: Component {
|
||||
}
|
||||
|
||||
public final class MediaCutoutScreen: ViewController {
|
||||
fileprivate final class Node: ViewControllerTracingNode, UIGestureRecognizerDelegate {
|
||||
fileprivate final class Node: ViewControllerTracingNode, ASGestureRecognizerDelegate {
|
||||
private weak var controller: MediaCutoutScreen?
|
||||
private let context: AccountContext
|
||||
|
||||
|
||||
@@ -2121,7 +2121,7 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
||||
}
|
||||
}
|
||||
|
||||
final class Node: ViewControllerTracingNode, UIGestureRecognizerDelegate {
|
||||
final class Node: ViewControllerTracingNode, ASGestureRecognizerDelegate {
|
||||
private weak var controller: MediaEditorScreen?
|
||||
private let context: AccountContext
|
||||
fileprivate var interaction: DrawingToolsInteraction?
|
||||
@@ -2750,28 +2750,28 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
||||
self.view.disablesInteractiveKeyboardGestureRecognizer = true
|
||||
|
||||
let dismissPanGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.handleDismissPan(_:)))
|
||||
dismissPanGestureRecognizer.delegate = self
|
||||
dismissPanGestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
dismissPanGestureRecognizer.maximumNumberOfTouches = 1
|
||||
self.previewContainerView.addGestureRecognizer(dismissPanGestureRecognizer)
|
||||
self.dismissPanGestureRecognizer = dismissPanGestureRecognizer
|
||||
|
||||
let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(self.handlePan(_:)))
|
||||
panGestureRecognizer.delegate = self
|
||||
panGestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
panGestureRecognizer.minimumNumberOfTouches = 1
|
||||
panGestureRecognizer.maximumNumberOfTouches = 2
|
||||
self.view.addGestureRecognizer(panGestureRecognizer)
|
||||
self.panGestureRecognizer = panGestureRecognizer
|
||||
|
||||
let pinchGestureRecognizer = UIPinchGestureRecognizer(target: self, action: #selector(self.handlePinch(_:)))
|
||||
pinchGestureRecognizer.delegate = self
|
||||
pinchGestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.previewContainerView.addGestureRecognizer(pinchGestureRecognizer)
|
||||
|
||||
let rotateGestureRecognizer = UIRotationGestureRecognizer(target: self, action: #selector(self.handleRotate(_:)))
|
||||
rotateGestureRecognizer.delegate = self
|
||||
rotateGestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.previewContainerView.addGestureRecognizer(rotateGestureRecognizer)
|
||||
|
||||
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.handleTap(_:)))
|
||||
tapGestureRecognizer.delegate = self
|
||||
tapGestureRecognizer.delegate = self.wrappedGestureRecognizerDelegate
|
||||
self.previewContainerView.addGestureRecognizer(tapGestureRecognizer)
|
||||
|
||||
self.interaction = DrawingToolsInteraction(
|
||||
|
||||
@@ -954,7 +954,7 @@ private final class MediaToolsScreenComponent: Component {
|
||||
}
|
||||
|
||||
public final class MediaToolsScreen: ViewController {
|
||||
fileprivate final class Node: ViewControllerTracingNode, UIGestureRecognizerDelegate {
|
||||
fileprivate final class Node: ViewControllerTracingNode, ASGestureRecognizerDelegate {
|
||||
private weak var controller: MediaToolsScreen?
|
||||
private let context: AccountContext
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ public final class SaveProgressScreenComponent: Component {
|
||||
}
|
||||
|
||||
public final class SaveProgressScreen: ViewController {
|
||||
fileprivate final class Node: ViewControllerTracingNode, UIGestureRecognizerDelegate {
|
||||
fileprivate final class Node: ViewControllerTracingNode, ASGestureRecognizerDelegate {
|
||||
private weak var controller: SaveProgressScreen?
|
||||
private let context: AccountContext
|
||||
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ final class StickerPackListContextItem: ContextMenuCustomItem {
|
||||
}
|
||||
}
|
||||
|
||||
private final class StickerPackListContextItemNode: ASDisplayNode, ContextMenuCustomNode, ContextActionNodeProtocol, UIScrollViewDelegate {
|
||||
private final class StickerPackListContextItemNode: ASDisplayNode, ContextMenuCustomNode, ContextActionNodeProtocol, ASScrollViewDelegate {
|
||||
private let item: StickerPackListContextItem
|
||||
private let presentationData: PresentationData
|
||||
private let getController: () -> ContextControllerProtocol?
|
||||
@@ -105,7 +105,7 @@ private final class StickerPackListContextItemNode: ASDisplayNode, ContextMenuCu
|
||||
override func didLoad() {
|
||||
super.didLoad()
|
||||
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
self.scrollNode.view.alwaysBounceVertical = false
|
||||
self.scrollNode.view.showsHorizontalScrollIndicator = false
|
||||
self.scrollNode.view.scrollIndicatorInsets = UIEdgeInsets(top: 0.0, left: 0.0, bottom: 5.0, right: 0.0)
|
||||
|
||||
+2
-2
@@ -100,7 +100,7 @@ public final class MultiplexedVideoNodeFiles {
|
||||
}
|
||||
}
|
||||
|
||||
public final class MultiplexedVideoNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
public final class MultiplexedVideoNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
private let account: Account
|
||||
private var theme: PresentationTheme
|
||||
private var strings: PresentationStrings
|
||||
@@ -236,7 +236,7 @@ public final class MultiplexedVideoNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
self.scrollNode.view.delegate = self
|
||||
self.scrollNode.view.delegate = self.wrappedScrollViewDelegate
|
||||
|
||||
let recognizer = UITapGestureRecognizer(target: self, action: #selector(self.tapGesture(_:)))
|
||||
self.view.addGestureRecognizer(recognizer)
|
||||
|
||||
@@ -33,6 +33,8 @@ swift_library(
|
||||
"//submodules/UndoUI",
|
||||
"//submodules/TextFormat",
|
||||
"//submodules/Components/HierarchyTrackingLayer",
|
||||
"//submodules/TelegramUI/Components/ListSectionComponent",
|
||||
"//submodules/TelegramUI/Components/ListItemSliderSelectorComponent",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
|
||||
+98
@@ -21,6 +21,8 @@ import AnimatedTextComponent
|
||||
import TextFormat
|
||||
import AudioToolbox
|
||||
import PremiumLockButtonSubtitleComponent
|
||||
import ListSectionComponent
|
||||
import ListItemSliderSelectorComponent
|
||||
|
||||
final class PeerAllowedReactionsScreenComponent: Component {
|
||||
typealias EnvironmentType = ViewControllerComponentContainer.Environment
|
||||
@@ -57,6 +59,7 @@ final class PeerAllowedReactionsScreenComponent: Component {
|
||||
private var reactionsTitleText: ComponentView<Empty>?
|
||||
private var reactionsInfoText: ComponentView<Empty>?
|
||||
private var reactionInput: ComponentView<Empty>?
|
||||
private var reactionCountSection: ComponentView<Empty>?
|
||||
private let actionButton = ComponentView<Empty>()
|
||||
|
||||
private var reactionSelectionControl: ComponentView<Empty>?
|
||||
@@ -82,6 +85,8 @@ final class PeerAllowedReactionsScreenComponent: Component {
|
||||
private var displayInput: Bool = false
|
||||
private var recenterOnCaret: Bool = false
|
||||
|
||||
private var allowedReactionCount: Int = 11
|
||||
|
||||
private var isApplyingSettings: Bool = false
|
||||
private var applyDisposable: Disposable?
|
||||
|
||||
@@ -775,6 +780,86 @@ final class PeerAllowedReactionsScreenComponent: Component {
|
||||
}
|
||||
contentHeight += reactionsInfoTextSize.height
|
||||
contentHeight += 6.0
|
||||
|
||||
contentHeight += 32.0
|
||||
|
||||
let reactionCountSection: ComponentView<Empty>
|
||||
if let current = self.reactionCountSection {
|
||||
reactionCountSection = current
|
||||
} else {
|
||||
reactionCountSection = ComponentView()
|
||||
self.reactionCountSection = reactionCountSection
|
||||
}
|
||||
|
||||
let reactionCountValueList = (1 ... 11).map { i -> String in
|
||||
return "\(i)"
|
||||
}
|
||||
//TODO:localize
|
||||
let sliderTitle: String
|
||||
if self.allowedReactionCount == 1 {
|
||||
sliderTitle = "1 reaction"
|
||||
} else {
|
||||
sliderTitle = "\(self.allowedReactionCount) reactions"
|
||||
}
|
||||
let reactionCountSectionSize = reactionCountSection.update(
|
||||
transition: transition,
|
||||
component: AnyComponent(ListSectionComponent(
|
||||
theme: environment.theme,
|
||||
header: AnyComponent(MultilineTextComponent(
|
||||
text: .plain(NSAttributedString(
|
||||
string: "MAXIMUM REACTIONS PER POST",
|
||||
font: Font.regular(13.0),
|
||||
textColor: environment.theme.list.freeTextColor
|
||||
)),
|
||||
maximumNumberOfLines: 0
|
||||
)),
|
||||
footer: AnyComponent(MultilineTextComponent(
|
||||
text: .plain(NSAttributedString(
|
||||
string: "Limit the number of different reactions that can be added to a post, including already published posts.",
|
||||
font: Font.regular(13.0),
|
||||
textColor: environment.theme.list.freeTextColor
|
||||
)),
|
||||
maximumNumberOfLines: 0
|
||||
)),
|
||||
items: [
|
||||
AnyComponentWithIdentity(id: 0, component: AnyComponent(ListItemSliderSelectorComponent(
|
||||
theme: environment.theme,
|
||||
values: reactionCountValueList.map { item in
|
||||
return item
|
||||
},
|
||||
markPositions: false,
|
||||
selectedIndex: max(0, min(reactionCountValueList.count - 1, self.allowedReactionCount - 1)),
|
||||
title: sliderTitle,
|
||||
selectedIndexUpdated: { [weak self] index in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
let index = max(1, min(reactionCountValueList.count, index + 1))
|
||||
self.allowedReactionCount = index
|
||||
self.state?.updated(transition: .immediate)
|
||||
}
|
||||
)))
|
||||
],
|
||||
displaySeparators: false
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: CGSize(width: availableSize.width - sideInset * 2.0, height: 10000.0)
|
||||
)
|
||||
let reactionCountSectionFrame = CGRect(origin: CGPoint(x: sideInset, y: contentHeight), size: reactionCountSectionSize)
|
||||
if let reactionCountSectionView = reactionCountSection.view {
|
||||
if reactionCountSectionView.superview == nil {
|
||||
self.scrollView.addSubview(reactionCountSectionView)
|
||||
}
|
||||
if animateIn {
|
||||
reactionCountSectionView.frame = reactionCountSectionFrame
|
||||
if !transition.animation.isImmediate {
|
||||
reactionCountSectionView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||
}
|
||||
} else {
|
||||
transition.setFrame(view: reactionCountSectionView, frame: reactionCountSectionFrame)
|
||||
}
|
||||
}
|
||||
contentHeight += reactionCountSectionSize.height
|
||||
} else {
|
||||
if let reactionsTitleText = self.reactionsTitleText {
|
||||
self.reactionsTitleText = nil
|
||||
@@ -814,6 +899,19 @@ final class PeerAllowedReactionsScreenComponent: Component {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let reactionCountSection = self.reactionCountSection {
|
||||
self.reactionCountSection = nil
|
||||
if let reactionCountSectionView = reactionCountSection.view {
|
||||
if !transition.animation.isImmediate {
|
||||
reactionCountSectionView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak reactionCountSectionView] _ in
|
||||
reactionCountSectionView?.removeFromSuperview()
|
||||
})
|
||||
} else {
|
||||
reactionCountSectionView.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var buttonContents: [AnyComponentWithIdentity<Empty>] = []
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user