Various fixes

This commit is contained in:
Ilya Laktyushin 2025-01-02 14:57:21 +04:00
parent 3512968e0e
commit d9e35e7882
9 changed files with 61 additions and 20 deletions

View File

@ -191,6 +191,14 @@ class ChatListSearchEmptyFooterItemNode: ListViewItemNode {
self.contentNode.frame = contentFrame
}
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let result = super.hitTest(point, with: event)
if let contentResult = self.contentNode.view.hitTest(self.view.convert(point, to: self.contentNode.view), with: event), contentResult === self.searchAllMessagesButton.view {
return contentResult
}
return result
}
func asyncLayout() -> (_ item: ChatListSearchEmptyFooterItem, _ params: ListViewItemLayoutParams) -> (ListViewItemNodeLayout, () -> Void) {
let makeTitleNodeLayout = TextNode.asyncLayout(self.titleNode)
let makeTextNodeLayout = TextNode.asyncLayout(self.textNode)

View File

@ -1225,7 +1225,9 @@ public final class ReactionButtonAsyncNode: ContextControllerSourceView {
let tintColor: UIColor
if layout.backgroundLayout.colors.isSelected {
if layout.spec.component.colors.selectedForeground != 0 {
if layout.spec.component.colors.selectedIconTintColor != 0 {
tintColor = UIColor(argb: layout.spec.component.colors.selectedIconTintColor)
} else if layout.spec.component.colors.selectedForeground != 0 {
tintColor = UIColor(argb: layout.spec.component.colors.selectedForeground)
} else {
tintColor = .white
@ -1352,6 +1354,7 @@ public final class ReactionButtonComponent: Equatable {
public var selectedBackground: UInt32
public var deselectedForeground: UInt32
public var selectedForeground: UInt32
public var selectedIconTintColor: UInt32
public var deselectedStarsBackground: UInt32
public var selectedStarsBackground: UInt32
public var deselectedStarsForeground: UInt32
@ -1367,6 +1370,7 @@ public final class ReactionButtonComponent: Equatable {
selectedBackground: UInt32,
deselectedForeground: UInt32,
selectedForeground: UInt32,
selectedIconTintColor: UInt32,
deselectedStarsBackground: UInt32,
selectedStarsBackground: UInt32,
deselectedStarsForeground: UInt32,
@ -1381,6 +1385,7 @@ public final class ReactionButtonComponent: Equatable {
self.selectedBackground = selectedBackground
self.deselectedForeground = deselectedForeground
self.selectedForeground = selectedForeground
self.selectedIconTintColor = selectedIconTintColor
self.deselectedStarsBackground = deselectedStarsBackground
self.selectedStarsBackground = selectedStarsBackground
self.deselectedStarsForeground = deselectedStarsForeground

View File

@ -2490,6 +2490,7 @@ public final class ContextController: ViewController, StandalonePresentableContr
public var immediateItemsTransitionAnimation = false
let workaroundUseLegacyImplementation: Bool
let disableScreenshots: Bool
let hideReactionPanelTail: Bool
public enum HandledTouchEvent {
case ignore
@ -2505,7 +2506,7 @@ public final class ContextController: ViewController, StandalonePresentableContr
public var getOverlayViews: (() -> [UIView])?
convenience public init(context: AccountContext? = nil, presentationData: PresentationData, source: ContextContentSource, items: Signal<ContextController.Items, NoError>, recognizer: TapLongTapOrDoubleTapGestureRecognizer? = nil, gesture: ContextGesture? = nil, workaroundUseLegacyImplementation: Bool = false, disableScreenshots: Bool = false) {
convenience public init(context: AccountContext? = nil, presentationData: PresentationData, source: ContextContentSource, items: Signal<ContextController.Items, NoError>, recognizer: TapLongTapOrDoubleTapGestureRecognizer? = nil, gesture: ContextGesture? = nil, workaroundUseLegacyImplementation: Bool = false, disableScreenshots: Bool = false, hideReactionPanelTail: Bool = false) {
self.init(
context: context,
presentationData: presentationData,
@ -2521,7 +2522,8 @@ public final class ContextController: ViewController, StandalonePresentableContr
recognizer: recognizer,
gesture: gesture,
workaroundUseLegacyImplementation: workaroundUseLegacyImplementation,
disableScreenshots: disableScreenshots
disableScreenshots: disableScreenshots,
hideReactionPanelTail: hideReactionPanelTail
)
}
@ -2532,7 +2534,8 @@ public final class ContextController: ViewController, StandalonePresentableContr
recognizer: TapLongTapOrDoubleTapGestureRecognizer? = nil,
gesture: ContextGesture? = nil,
workaroundUseLegacyImplementation: Bool = false,
disableScreenshots: Bool = false
disableScreenshots: Bool = false,
hideReactionPanelTail: Bool = false
) {
self.context = context
self.presentationData = presentationData
@ -2541,6 +2544,7 @@ public final class ContextController: ViewController, StandalonePresentableContr
self.gesture = gesture
self.workaroundUseLegacyImplementation = workaroundUseLegacyImplementation
self.disableScreenshots = disableScreenshots
self.hideReactionPanelTail = hideReactionPanelTail
super.init(navigationBarPresentationData: nil)

View File

@ -645,7 +645,7 @@ final class ContextControllerExtractedPresentationNode: ASDisplayNode, ContextCo
var contentTopInset: CGFloat = topInset
var removedReactionContextNode: ReactionContextNode?
if let reactionItems = self.actionsStackNode.topReactionItems, !reactionItems.reactionItems.isEmpty {
if let reactionItems = self.actionsStackNode.topReactionItems, !reactionItems.reactionItems.isEmpty, let controller = self.getController() as? ContextController {
let reactionContextNode: ReactionContextNode
if let current = self.reactionContextNode {
reactionContextNode = current
@ -681,6 +681,7 @@ final class ContextControllerExtractedPresentationNode: ASDisplayNode, ContextCo
strongSelf.requestUpdateOverlayWantsToBeBelowKeyboard(transition)
}
)
reactionContextNode.displayTail = !controller.hideReactionPanelTail
self.reactionContextNode = reactionContextNode
self.addSubnode(reactionContextNode)

View File

@ -306,18 +306,7 @@ private final class StickerPackContainer: ASDisplayNode {
guard let self else {
return
}
if let mainPreviewIconView = self.mainPreviewIcon?.view {
mainPreviewIconView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak self] _ in
guard let self else {
return
}
if let mainPreviewIconView = self.mainPreviewIcon?.view {
self.mainPreviewIcon = nil
mainPreviewIconView.removeFromSuperview()
}
})
mainPreviewIconView.layer.animateScale(from: 1.0, to: 0.5, duration: 0.2, removeOnCompletion: false)
}
self.hideMainPreviewIcon()
}
self.gridNode.interactiveScrollingEnded = { [weak self] in
@ -643,6 +632,8 @@ private final class StickerPackContainer: ASDisplayNode {
return nil
}, present: { [weak self] content, sourceView, sourceRect in
if let strongSelf = self {
strongSelf.hideMainPreviewIcon()
let controller = PeekController(presentationData: strongSelf.presentationData, content: content, sourceView: {
return (sourceView, sourceRect)
})
@ -697,6 +688,21 @@ private final class StickerPackContainer: ASDisplayNode {
self.gridNode.view.addGestureRecognizer(reorderingGestureRecognizer)
}
private func hideMainPreviewIcon() {
if let mainPreviewIconView = self.mainPreviewIcon?.view {
mainPreviewIconView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak self] _ in
guard let self else {
return
}
if let mainPreviewIconView = self.mainPreviewIcon?.view {
self.mainPreviewIcon = nil
mainPreviewIconView.removeFromSuperview()
}
})
mainPreviewIconView.layer.animateScale(from: 1.0, to: 0.5, duration: 0.2, removeOnCompletion: false)
}
}
private var reorderFeedback: HapticFeedback?
private var reorderNode: ReorderingItemNode?
private var reorderInitialIndex: Int?
@ -2184,7 +2190,7 @@ private final class StickerPackContainer: ASDisplayNode {
transition.updateFrame(node: self.backgroundNode, frame: backgroundFrame)
if let previewIconFile = self.previewIconFile, let mainPreviewIcon = self.mainPreviewIcon {
let iconFitSize = CGSize(width: 90.0, height: 90.0)
let iconFitSize = CGSize(width: 120.0, height: 120.0)
let iconSize = mainPreviewIcon.update(
transition: .immediate,
component: AnyComponent(EmojiStatusComponent(

View File

@ -356,6 +356,7 @@ public class ChatMessageDateAndStatusNode: ASDisplayNode {
selectedBackground: themeColors.reactionActiveBackground.argb,
deselectedForeground: themeColors.reactionInactiveForeground.argb,
selectedForeground: themeColors.reactionActiveForeground.argb,
selectedIconTintColor: 0,
deselectedStarsBackground: themeColors.reactionStarsInactiveBackground.argb,
selectedStarsBackground: themeColors.reactionStarsActiveBackground.argb,
deselectedStarsForeground: themeColors.reactionStarsInactiveForeground.argb,
@ -374,6 +375,7 @@ public class ChatMessageDateAndStatusNode: ASDisplayNode {
selectedBackground: themeColors.reactionActiveBackground.argb,
deselectedForeground: themeColors.reactionInactiveForeground.argb,
selectedForeground: themeColors.reactionActiveForeground.argb,
selectedIconTintColor: 0,
deselectedStarsBackground: themeColors.reactionStarsInactiveBackground.argb,
selectedStarsBackground: themeColors.reactionStarsActiveBackground.argb,
deselectedStarsForeground: themeColors.reactionStarsInactiveForeground.argb,

View File

@ -78,6 +78,7 @@ public final class MessageReactionButtonsNode: ASDisplayNode {
selectedBackground: themeColors.reactionActiveBackground.argb,
deselectedForeground: themeColors.reactionInactiveForeground.argb,
selectedForeground: themeColors.reactionActiveForeground.argb,
selectedIconTintColor: 0,
deselectedStarsBackground: themeColors.reactionStarsInactiveBackground.argb,
selectedStarsBackground: themeColors.reactionStarsActiveBackground.argb,
deselectedStarsForeground: themeColors.reactionStarsInactiveForeground.argb,
@ -95,6 +96,7 @@ public final class MessageReactionButtonsNode: ASDisplayNode {
selectedBackground: themeColors.reactionActiveBackground.argb,
deselectedForeground: themeColors.reactionInactiveForeground.argb,
selectedForeground: themeColors.reactionActiveForeground.argb,
selectedIconTintColor: 0,
deselectedStarsBackground: themeColors.reactionStarsInactiveBackground.argb,
selectedStarsBackground: themeColors.reactionStarsActiveBackground.argb,
deselectedStarsForeground: themeColors.reactionStarsInactiveForeground.argb,
@ -117,6 +119,7 @@ public final class MessageReactionButtonsNode: ASDisplayNode {
selectedBackground: themeColors.reactionActiveBackground.argb,
deselectedForeground: themeColors.reactionInactiveForeground.argb,
selectedForeground: themeColors.reactionActiveForeground.argb,
selectedIconTintColor: presentationData.theme.theme.overallDarkAppearance ? 0 : presentationData.theme.theme.chat.message.incoming.accentTextColor.argb,
deselectedStarsBackground: selectReactionFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper, isStars: true).argb,
selectedStarsBackground: themeColors.reactionStarsActiveBackground.argb,
deselectedStarsForeground: themeColors.reactionStarsInactiveForeground.argb,

View File

@ -301,8 +301,20 @@ extension ChatControllerImpl {
self.canReadHistory.set(false)
var hideReactionPanelTail = false
for media in message.media {
if let action = media as? TelegramMediaAction {
switch action.action {
case .phoneCall:
break
default:
hideReactionPanelTail = true
}
}
}
let isSecret = self.presentationInterfaceState.copyProtectionEnabled || self.chatLocation.peerId?.namespace == Namespaces.Peer.SecretChat
let controller = ContextController(presentationData: self.presentationData, source: source, items: actionsSignal, recognizer: recognizer, gesture: gesture, disableScreenshots: isSecret)
let controller = ContextController(presentationData: self.presentationData, source: source, items: actionsSignal, recognizer: recognizer, gesture: gesture, disableScreenshots: isSecret, hideReactionPanelTail: hideReactionPanelTail)
controller.dismissed = { [weak self] in
self?.canReadHistory.set(true)
}

View File

@ -1,5 +1,5 @@
{
"app": "11.6",
"app": "11.6.1",
"xcode": "16.0",
"bazel": "7.3.1:981f82a470bad1349322b6f51c9c6ffa0aa291dab1014fac411543c12e661dff",
"macos": "15.0"