diff --git a/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift b/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift index f4397508c4..2c36d7c134 100644 --- a/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift +++ b/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift @@ -1119,8 +1119,8 @@ public final class MessageInputPanelComponent: Component { theme: component.theme, strings: component.strings, presentController: component.presentController, - audioRecorder: component.audioRecorder, - videoRecordingStatus: component.videoRecordingStatus + audioRecorder: nil, + videoRecordingStatus: nil )), environment: {}, containerSize: CGSize(width: 33.0, height: 33.0) diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift index 51ec5cfdaa..a64b8c9ed0 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift @@ -390,6 +390,7 @@ public final class StoryItemSetContainerComponent: Component { private let scroller: Scroller let componentContainerView: UIView + let overlayContainerView: SparseContainerView let itemsContainerView: UIView let controlsContainerView: UIView let controlsClippingView: UIView @@ -474,6 +475,7 @@ public final class StoryItemSetContainerComponent: Component { self.sendMessageContext = StoryItemSetContainerSendMessage() self.componentContainerView = UIView() + self.overlayContainerView = SparseContainerView() self.itemsContainerView = UIView() @@ -515,6 +517,7 @@ public final class StoryItemSetContainerComponent: Component { super.init(frame: frame) self.addSubview(self.componentContainerView) + self.addSubview(self.overlayContainerView) self.itemsContainerView.addSubview(self.scroller) self.scroller.delegate = self @@ -531,7 +534,7 @@ public final class StoryItemSetContainerComponent: Component { self.componentContainerView.addSubview(self.viewListsContainer) self.closeButton.addSubview(self.closeButtonIconView) - self.componentContainerView.addSubview(self.closeButton) + self.overlayContainerView.addSubview(self.closeButton) self.closeButton.addTarget(self, action: #selector(self.closePressed), for: .touchUpInside) let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.tapGesture(_:))) @@ -557,8 +560,11 @@ public final class StoryItemSetContainerComponent: Component { } if self.itemsContainerView.frame.contains(point) { - if !self.isPointInsideContentArea(point: point) { - return [] + if self.viewListDisplayState != .hidden { + } else { + if !self.isPointInsideContentArea(point: point) { + return [] + } } } @@ -2111,6 +2117,12 @@ public final class StoryItemSetContainerComponent: Component { removeOnCompletion: false ) + self.overlayContainerView.clipsToBounds = true + let overlayToFrame = sourceLocalFrame + let overlayToBounds = CGRect(origin: CGPoint(x: overlayToFrame.minX, y: overlayToFrame.minY), size: overlayToFrame.size) + self.overlayContainerView.layer.animatePosition(from: CGPoint(), to: overlayToFrame.center.offsetBy(dx: -self.overlayContainerView.center.x, dy: -self.overlayContainerView.center.y), duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring, removeOnCompletion: false, additive: true) + self.overlayContainerView.layer.animateBounds(from: self.overlayContainerView.bounds, to: overlayToBounds, duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring, removeOnCompletion: false) + if !transitionOut.destinationIsAvatar { let transitionView = transitionOut.transitionView @@ -2379,6 +2391,10 @@ public final class StoryItemSetContainerComponent: Component { transition.setBounds(view: self.componentContainerView, bounds: CGRect(origin: CGPoint(), size: availableSize)) transition.setScale(view: self.componentContainerView, scale: dismissPanScale) + transition.setPosition(view: self.overlayContainerView, position: CGPoint(x: availableSize.width * 0.5, y: availableSize.height * 0.5 + dismissPanOffset)) + transition.setBounds(view: self.overlayContainerView, bounds: CGRect(origin: CGPoint(), size: availableSize)) + transition.setScale(view: self.overlayContainerView, scale: dismissPanScale) + var bottomContentInset: CGFloat if !component.safeInsets.bottom.isZero { bottomContentInset = component.safeInsets.bottom + 1.0 diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift index 34e2ceeefb..f3001d13c1 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift @@ -838,7 +838,12 @@ final class StoryItemSetContainerSendMessage { self.videoRecorder.set(.single(nil)) - self.sendMessages(view: view, peer: peer, messages: [updatedMessage]) + self.performWithPossibleStealthModeConfirmation(view: view, action: { [weak self, weak view] in + guard let self, let view else { + return + } + self.sendMessages(view: view, peer: peer, messages: [updatedMessage]) + }) }, displaySlowmodeTooltip: { [weak self] view, rect in //self?.interfaceInteraction?.displaySlowmodeTooltip(view, rect) let _ = self @@ -883,9 +888,14 @@ final class StoryItemSetContainerSendMessage { let waveformBuffer: Data? = data.waveform - self.sendMessages(view: view, peer: peer, messages: [.message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: TelegramMediaFile(fileId: EngineMedia.Id(namespace: Namespaces.Media.LocalFile, id: randomId), partialReference: nil, resource: resource, previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "audio/ogg", size: Int64(data.compressedData.count), attributes: [.Audio(isVoice: true, duration: Int(data.duration), title: nil, performer: nil, waveform: waveformBuffer)])), replyToMessageId: nil, replyToStoryId: focusedStoryId, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])]) - - HapticFeedback().tap() + self.performWithPossibleStealthModeConfirmation(view: view, action: { [weak self, weak view] in + guard let self, let view else { + return + } + self.sendMessages(view: view, peer: peer, messages: [.message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: TelegramMediaFile(fileId: EngineMedia.Id(namespace: Namespaces.Media.LocalFile, id: randomId), partialReference: nil, resource: resource, previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "audio/ogg", size: Int64(data.compressedData.count), attributes: [.Audio(isVoice: true, duration: Int(data.duration), title: nil, performer: nil, waveform: waveformBuffer)])), replyToMessageId: nil, replyToStoryId: focusedStoryId, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])]) + + HapticFeedback().tap() + }) } }) } else if let videoRecorderValue = self.videoRecorderValue { diff --git a/submodules/TelegramUI/Components/Stories/StoryFooterPanelComponent/Sources/StoryFooterPanelComponent.swift b/submodules/TelegramUI/Components/Stories/StoryFooterPanelComponent/Sources/StoryFooterPanelComponent.swift index 6241d22dc9..6836daf357 100644 --- a/submodules/TelegramUI/Components/Stories/StoryFooterPanelComponent/Sources/StoryFooterPanelComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryFooterPanelComponent/Sources/StoryFooterPanelComponent.swift @@ -419,7 +419,7 @@ public final class StoryFooterPanelComponent: Component { } let minContentX: CGFloat = 16.0 - let maxContentX: CGFloat = floor((availableSize.width - contentWidth) * 0.5) + let maxContentX: CGFloat = (availableSize.width - contentWidth) * 0.5 var contentX: CGFloat = minContentX.interpolate(to: maxContentX, amount: component.expandFraction) let avatarsNodeFrame = CGRect(origin: CGPoint(x: contentX, y: floor((size.height - avatarsSize.height) * 0.5)), size: avatarsSize)