mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
[WIP] Send message effects
This commit is contained in:
@@ -175,12 +175,8 @@ public final class ContextControllerActionsListActionItemNode: HighlightTracking
|
||||
}
|
||||
|
||||
@objc private func pressed() {
|
||||
guard let controller = self.getController() else {
|
||||
return
|
||||
}
|
||||
|
||||
self.item.action?(ContextMenuActionItem.Action(
|
||||
controller: controller,
|
||||
controller: self.getController(),
|
||||
dismissWithResult: { [weak self] result in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
@@ -669,7 +665,7 @@ private final class ContextControllerActionsListCustomItemNode: ASDisplayNode, C
|
||||
}
|
||||
}
|
||||
|
||||
final class ContextControllerActionsListStackItem: ContextControllerActionsStackItem {
|
||||
public final class ContextControllerActionsListStackItem: ContextControllerActionsStackItem {
|
||||
final class Node: ASDisplayNode, ContextControllerActionsStackItemNode {
|
||||
private final class Item {
|
||||
let node: ContextControllerActionsListItemNode
|
||||
@@ -933,14 +929,14 @@ final class ContextControllerActionsListStackItem: ContextControllerActionsStack
|
||||
}
|
||||
}
|
||||
|
||||
let id: AnyHashable?
|
||||
let items: [ContextMenuItem]
|
||||
let reactionItems: ContextControllerReactionItems?
|
||||
let tip: ContextController.Tip?
|
||||
let tipSignal: Signal<ContextController.Tip?, NoError>?
|
||||
let dismissed: (() -> Void)?
|
||||
public let id: AnyHashable?
|
||||
public let items: [ContextMenuItem]
|
||||
public let reactionItems: ContextControllerReactionItems?
|
||||
public let tip: ContextController.Tip?
|
||||
public let tipSignal: Signal<ContextController.Tip?, NoError>?
|
||||
public let dismissed: (() -> Void)?
|
||||
|
||||
init(
|
||||
public init(
|
||||
id: AnyHashable?,
|
||||
items: [ContextMenuItem],
|
||||
reactionItems: ContextControllerReactionItems?,
|
||||
@@ -956,7 +952,7 @@ final class ContextControllerActionsListStackItem: ContextControllerActionsStack
|
||||
self.dismissed = dismissed
|
||||
}
|
||||
|
||||
func node(
|
||||
public func node(
|
||||
getController: @escaping () -> ContextControllerProtocol?,
|
||||
requestDismiss: @escaping (ContextMenuActionResult) -> Void,
|
||||
requestUpdate: @escaping (ContainedViewLayoutTransition) -> Void,
|
||||
@@ -1094,8 +1090,8 @@ func makeContextControllerActionsStackItem(items: ContextController.Items) -> [C
|
||||
}
|
||||
}
|
||||
|
||||
final class ContextControllerActionsStackNode: ASDisplayNode {
|
||||
enum Presentation {
|
||||
public final class ContextControllerActionsStackNode: ASDisplayNode {
|
||||
public enum Presentation {
|
||||
case modal
|
||||
case inline
|
||||
case additional
|
||||
@@ -1372,19 +1368,19 @@ final class ContextControllerActionsStackNode: ASDisplayNode {
|
||||
|
||||
private var selectionPanGesture: UIPanGestureRecognizer?
|
||||
|
||||
var topReactionItems: ContextControllerReactionItems? {
|
||||
public var topReactionItems: ContextControllerReactionItems? {
|
||||
return self.itemContainers.last?.reactionItems
|
||||
}
|
||||
|
||||
var topPositionLock: CGFloat? {
|
||||
public var topPositionLock: CGFloat? {
|
||||
return self.itemContainers.last?.positionLock
|
||||
}
|
||||
|
||||
var storedScrollingState: CGFloat? {
|
||||
public var storedScrollingState: CGFloat? {
|
||||
return self.itemContainers.last?.storedScrollingState
|
||||
}
|
||||
|
||||
init(
|
||||
public init(
|
||||
getController: @escaping () -> ContextControllerProtocol?,
|
||||
requestDismiss: @escaping (ContextMenuActionResult) -> Void,
|
||||
requestUpdate: @escaping (ContainedViewLayoutTransition) -> Void
|
||||
@@ -1434,7 +1430,7 @@ final class ContextControllerActionsStackNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
func replace(item: ContextControllerActionsStackItem, animated: Bool?) {
|
||||
public func replace(item: ContextControllerActionsStackItem, animated: Bool?) {
|
||||
if let item = item as? ContextControllerActionsListStackItem, let topContainer = self.itemContainers.first, let topItem = topContainer.item as? ContextControllerActionsListStackItem, let topId = topItem.id, let id = item.id, topId == id, item.items.count == topItem.items.count {
|
||||
if let topNode = topContainer.node as? ContextControllerActionsListStackItem.Node {
|
||||
var matches = true
|
||||
@@ -1491,7 +1487,7 @@ final class ContextControllerActionsStackNode: ASDisplayNode {
|
||||
self.push(item: item, currentScrollingState: nil, positionLock: nil, animated: resolvedAnimated)
|
||||
}
|
||||
|
||||
func push(item: ContextControllerActionsStackItem, currentScrollingState: CGFloat?, positionLock: CGFloat?, animated: Bool) {
|
||||
public func push(item: ContextControllerActionsStackItem, currentScrollingState: CGFloat?, positionLock: CGFloat?, animated: Bool) {
|
||||
if let itemContainer = self.itemContainers.last {
|
||||
itemContainer.storedScrollingState = currentScrollingState
|
||||
}
|
||||
@@ -1525,11 +1521,11 @@ final class ContextControllerActionsStackNode: ASDisplayNode {
|
||||
self.requestUpdate(transition)
|
||||
}
|
||||
|
||||
func clearStoredScrollingState() {
|
||||
public func clearStoredScrollingState() {
|
||||
self.itemContainers.last?.storedScrollingState = nil
|
||||
}
|
||||
|
||||
func pop() {
|
||||
public func pop() {
|
||||
if self.itemContainers.count == 1 {
|
||||
//dismiss
|
||||
} else {
|
||||
@@ -1546,7 +1542,7 @@ final class ContextControllerActionsStackNode: ASDisplayNode {
|
||||
self.requestUpdate(transition)
|
||||
}
|
||||
|
||||
func update(
|
||||
public func update(
|
||||
presentationData: PresentationData,
|
||||
constrainedSize: CGSize,
|
||||
presentation: Presentation,
|
||||
@@ -1770,37 +1766,37 @@ final class ContextControllerActionsStackNode: ASDisplayNode {
|
||||
return CGSize(width: topItemWidth, height: topItemSize.height)
|
||||
}
|
||||
|
||||
func highlightGestureMoved(location: CGPoint) {
|
||||
public func highlightGestureMoved(location: CGPoint) {
|
||||
if let topItemContainer = self.itemContainers.last {
|
||||
topItemContainer.highlightGestureMoved(location: self.view.convert(location, to: topItemContainer.view))
|
||||
}
|
||||
}
|
||||
|
||||
func highlightGestureFinished(performAction: Bool) {
|
||||
public func highlightGestureFinished(performAction: Bool) {
|
||||
if let topItemContainer = self.itemContainers.last {
|
||||
topItemContainer.highlightGestureFinished(performAction: performAction)
|
||||
}
|
||||
}
|
||||
|
||||
func decreaseHighlightedIndex() {
|
||||
public func decreaseHighlightedIndex() {
|
||||
if let topItemContainer = self.itemContainers.last {
|
||||
topItemContainer.decreaseHighlightedIndex()
|
||||
}
|
||||
}
|
||||
|
||||
func increaseHighlightedIndex() {
|
||||
public func increaseHighlightedIndex() {
|
||||
if let topItemContainer = self.itemContainers.last {
|
||||
topItemContainer.increaseHighlightedIndex()
|
||||
}
|
||||
}
|
||||
|
||||
func updatePanSelection(isEnabled: Bool) {
|
||||
public func updatePanSelection(isEnabled: Bool) {
|
||||
if let selectionPanGesture = self.selectionPanGesture {
|
||||
selectionPanGesture.isEnabled = isEnabled
|
||||
}
|
||||
}
|
||||
|
||||
func animateIn() {
|
||||
public func animateIn() {
|
||||
for itemContainer in self.itemContainers {
|
||||
if let tipNode = itemContainer.tipNode {
|
||||
tipNode.animateIn()
|
||||
|
||||
Reference in New Issue
Block a user