diff --git a/submodules/ChatListUI/Sources/Node/ChatListItem.swift b/submodules/ChatListUI/Sources/Node/ChatListItem.swift index 4ec2cf475f..166e9c8659 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItem.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItem.swift @@ -1741,7 +1741,6 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { if let _ = updatedTheme { strongSelf.separatorNode.backgroundColor = item.presentationData.theme.chatList.itemSeparatorColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.chatList.itemHighlightedBackgroundColor } let revealOffset = strongSelf.revealOffset @@ -2115,22 +2114,28 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { transition.updateFrame(node: strongSelf.backgroundNode, frame: CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: layout.contentSize.width, height: itemHeight))) let backgroundColor: UIColor + let highlightedBackgroundColor: UIColor if item.selected { backgroundColor = theme.itemSelectedBackgroundColor + highlightedBackgroundColor = theme.itemHighlightedBackgroundColor } else if item.index.pinningIndex != nil { if case let .groupReference(_, _, _, _, hiddenByDefault) = item.content, hiddenByDefault { backgroundColor = theme.itemBackgroundColor + highlightedBackgroundColor = theme.itemHighlightedBackgroundColor } else { backgroundColor = theme.pinnedItemBackgroundColor + highlightedBackgroundColor = theme.pinnedItemHighlightedBackgroundColor } } else { backgroundColor = theme.itemBackgroundColor + highlightedBackgroundColor = theme.itemHighlightedBackgroundColor } if animated { transition.updateBackgroundColor(node: strongSelf.backgroundNode, color: backgroundColor) } else { strongSelf.backgroundNode.backgroundColor = backgroundColor } + strongSelf.highlightedBackgroundNode.backgroundColor = highlightedBackgroundColor let topNegativeInset: CGFloat = 0.0 strongSelf.highlightedBackgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: layoutOffset - separatorHeight - topNegativeInset), size: CGSize(width: layout.contentSize.width, height: layout.contentSize.height + separatorHeight + topNegativeInset)) diff --git a/submodules/Display/Source/Navigation/NavigationController.swift b/submodules/Display/Source/Navigation/NavigationController.swift index ec043cd07b..df1ff367c5 100644 --- a/submodules/Display/Source/Navigation/NavigationController.swift +++ b/submodules/Display/Source/Navigation/NavigationController.swift @@ -1307,6 +1307,18 @@ open class NavigationController: UINavigationController, ContainableController, completion() } + public func updateContainerPulled(_ pushed: Bool) { + guard self.modalContainers.isEmpty else { + return + } + if let rootContainer = self.rootContainer, case let .flat(container) = rootContainer { + let scale: CGFloat = pushed ? 1.06 : 1.0 + + container.view.layer.transform = CATransform3DMakeScale(scale, scale, 1.0) + container.view.layer.animateScale(from: pushed ? 1.0 : 1.06, to: scale, duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring) + } + } + open override func pushViewController(_ viewController: UIViewController, animated: Bool) { var controllers = self.viewControllers controllers.append(viewController) diff --git a/submodules/GalleryUI/Sources/GalleryControllerNode.swift b/submodules/GalleryUI/Sources/GalleryControllerNode.swift index e41c9e0309..a4d4de802c 100644 --- a/submodules/GalleryUI/Sources/GalleryControllerNode.swift +++ b/submodules/GalleryUI/Sources/GalleryControllerNode.swift @@ -362,9 +362,17 @@ open class GalleryControllerNode: ASDisplayNode, UIScrollViewDelegate, UIGesture } else if useSimpleAnimation { self.scrollView.layer.animateAlpha(from: 0.0, to: 1.0, duration: duration) } + + if let navigationController = self.baseNavigationController() { + navigationController.updateContainerPulled(true) + } } open func animateOut(animateContent: Bool, completion: @escaping () -> Void) { + if let navigationController = self.baseNavigationController() { + navigationController.updateContainerPulled(false) + } + self.isDismissed = true self.pager.isScrollEnabled = false diff --git a/submodules/GalleryUI/Sources/Items/ChatImageGalleryItem.swift b/submodules/GalleryUI/Sources/Items/ChatImageGalleryItem.swift index e78b5bc6fc..fe075fecb1 100644 --- a/submodules/GalleryUI/Sources/Items/ChatImageGalleryItem.swift +++ b/submodules/GalleryUI/Sources/Items/ChatImageGalleryItem.swift @@ -240,6 +240,8 @@ final class ChatImageGalleryItemNode: ZoomableContentGalleryItemNode { super.init() + self.clipsToBounds = true + self.imageNode.imageUpdated = { [weak self] _ in self?._ready.set(.single(Void())) } @@ -290,6 +292,11 @@ final class ChatImageGalleryItemNode: ZoomableContentGalleryItemNode { return self._ready.get() } + override func screenFrameUpdated(_ frame: CGRect) { + let center = frame.midX - self.frame.width / 2.0 + self.subnodeTransform = CATransform3DMakeTranslation(-center * 0.16, 0.0, 0.0) + } + override func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationBarHeight: CGFloat, transition: ContainedViewLayoutTransition) { super.containerLayoutUpdated(layout, navigationBarHeight: navigationBarHeight, transition: transition) diff --git a/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift b/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift index 9f148ea62b..4e933489c2 100644 --- a/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift +++ b/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift @@ -814,6 +814,8 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode { super.init() + self.clipsToBounds = true + self.moreBarButton.addTarget(self, action: #selector(self.moreButtonPressed), forControlEvents: .touchUpInside) self.footerContentNode.interacting = { [weak self] value in @@ -966,6 +968,12 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode { return self._ready.get() } + + override func screenFrameUpdated(_ frame: CGRect) { + let center = frame.midX - self.frame.width / 2.0 + self.subnodeTransform = CATransform3DMakeTranslation(-center * 0.16, 0.0, 0.0) + } + override func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationBarHeight: CGFloat, transition: ContainedViewLayoutTransition) { if let _ = self.customUnembedWhenPortrait, layout.size.width < layout.size.height { self.expandIntoCustomPiP() diff --git a/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift b/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift index 2c1b4d04cb..e499ffd7c9 100644 --- a/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift @@ -465,7 +465,8 @@ public func makeDefaultDarkPresentationTheme(extendingThemeReference: Presentati itemSeparatorColor: UIColor(rgb: 0x545458, alpha: 0.55), itemBackgroundColor: UIColor(rgb: 0x000000), pinnedItemBackgroundColor: UIColor(rgb: 0x1c1c1d), - itemHighlightedBackgroundColor: UIColor(rgb: 0x191919), + itemHighlightedBackgroundColor: UIColor(rgb: 0xffffff, alpha: 0.07), + pinnedItemHighlightedBackgroundColor: UIColor(rgb: 0xffffff, alpha: 0.07), itemSelectedBackgroundColor: UIColor(rgb: 0x191919), titleColor: UIColor(rgb: 0xffffff), secretTitleColor: UIColor(rgb: 0x00b12c), diff --git a/submodules/TelegramPresentationData/Sources/DefaultDarkTintedPresentationTheme.swift b/submodules/TelegramPresentationData/Sources/DefaultDarkTintedPresentationTheme.swift index 493e917ec9..7aa97959c7 100644 --- a/submodules/TelegramPresentationData/Sources/DefaultDarkTintedPresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/DefaultDarkTintedPresentationTheme.swift @@ -685,6 +685,7 @@ public func makeDefaultDarkTintedPresentationTheme(extendingThemeReference: Pres itemBackgroundColor: additionalBackgroundColor, pinnedItemBackgroundColor: mainBackgroundColor, itemHighlightedBackgroundColor: mainSelectionColor, + pinnedItemHighlightedBackgroundColor: mainSelectionColor, itemSelectedBackgroundColor: mainSelectionColor, titleColor: UIColor(rgb: 0xffffff), secretTitleColor: UIColor(rgb: 0x89df9e), diff --git a/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift b/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift index 1d24f2c939..812ade905a 100644 --- a/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift @@ -526,6 +526,7 @@ public func makeDefaultDayPresentationTheme(extendingThemeReference: Presentatio itemBackgroundColor: UIColor(rgb: 0xffffff), pinnedItemBackgroundColor: UIColor(rgb: 0xf7f7f7), itemHighlightedBackgroundColor: UIColor(rgb: 0xe5e5ea), + pinnedItemHighlightedBackgroundColor: UIColor(rgb: 0xe5e5ea), itemSelectedBackgroundColor: UIColor(rgb: 0xe9f0fa), titleColor: UIColor(rgb: 0x000000), secretTitleColor: UIColor(rgb: 0x00b12c), diff --git a/submodules/TelegramPresentationData/Sources/PresentationTheme.swift b/submodules/TelegramPresentationData/Sources/PresentationTheme.swift index c8a62f43f5..62091d16bc 100644 --- a/submodules/TelegramPresentationData/Sources/PresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/PresentationTheme.swift @@ -561,6 +561,7 @@ public final class PresentationThemeChatList { public let itemBackgroundColor: UIColor public let pinnedItemBackgroundColor: UIColor public let itemHighlightedBackgroundColor: UIColor + public let pinnedItemHighlightedBackgroundColor: UIColor public let itemSelectedBackgroundColor: UIColor public let titleColor: UIColor public let secretTitleColor: UIColor @@ -597,6 +598,7 @@ public final class PresentationThemeChatList { itemBackgroundColor: UIColor, pinnedItemBackgroundColor: UIColor, itemHighlightedBackgroundColor: UIColor, + pinnedItemHighlightedBackgroundColor: UIColor, itemSelectedBackgroundColor: UIColor, titleColor: UIColor, secretTitleColor: UIColor, @@ -632,6 +634,7 @@ public final class PresentationThemeChatList { self.itemBackgroundColor = itemBackgroundColor self.pinnedItemBackgroundColor = pinnedItemBackgroundColor self.itemHighlightedBackgroundColor = itemHighlightedBackgroundColor + self.pinnedItemHighlightedBackgroundColor = pinnedItemHighlightedBackgroundColor self.itemSelectedBackgroundColor = itemSelectedBackgroundColor self.titleColor = titleColor self.secretTitleColor = secretTitleColor @@ -669,6 +672,7 @@ public final class PresentationThemeChatList { itemBackgroundColor: UIColor? = nil, pinnedItemBackgroundColor: UIColor? = nil, itemHighlightedBackgroundColor: UIColor? = nil, + pinnedItemHighlightedBackgroundColor: UIColor? = nil, itemSelectedBackgroundColor: UIColor? = nil, titleColor: UIColor? = nil, secretTitleColor: UIColor? = nil, @@ -705,6 +709,7 @@ public final class PresentationThemeChatList { itemBackgroundColor: itemBackgroundColor ?? self.itemBackgroundColor, pinnedItemBackgroundColor: pinnedItemBackgroundColor ?? self.pinnedItemBackgroundColor, itemHighlightedBackgroundColor: itemHighlightedBackgroundColor ?? self.itemHighlightedBackgroundColor, + pinnedItemHighlightedBackgroundColor: pinnedItemHighlightedBackgroundColor ?? self.pinnedItemHighlightedBackgroundColor, itemSelectedBackgroundColor: itemSelectedBackgroundColor ?? self.itemSelectedBackgroundColor, titleColor: titleColor ?? self.titleColor, secretTitleColor: secretTitleColor ?? self.secretTitleColor, diff --git a/submodules/TelegramPresentationData/Sources/PresentationThemeCodable.swift b/submodules/TelegramPresentationData/Sources/PresentationThemeCodable.swift index 5ee859af80..5f2e8ca37b 100644 --- a/submodules/TelegramPresentationData/Sources/PresentationThemeCodable.swift +++ b/submodules/TelegramPresentationData/Sources/PresentationThemeCodable.swift @@ -966,6 +966,7 @@ extension PresentationThemeChatList: Codable { case itemBg case pinnedItemBg case itemHighlightedBg + case pinnedItemHighlightedBg case itemSelectedBg case title case secretTitle @@ -1005,6 +1006,7 @@ extension PresentationThemeChatList: Codable { itemBackgroundColor: try decodeColor(values, .itemBg), pinnedItemBackgroundColor: try decodeColor(values, .pinnedItemBg), itemHighlightedBackgroundColor: try decodeColor(values, .itemHighlightedBg), + pinnedItemHighlightedBackgroundColor: try decodeColor(values, .pinnedItemHighlightedBg, fallbackKey: "\(codingPath).itemHighlightedBg"), itemSelectedBackgroundColor: try decodeColor(values, .itemSelectedBg), titleColor: try decodeColor(values, .title), secretTitleColor: try decodeColor(values, .secretTitle), diff --git a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoPaneContainerNode.swift b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoPaneContainerNode.swift index 3899c04ca0..1633da1ec1 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoPaneContainerNode.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoPaneContainerNode.swift @@ -745,7 +745,7 @@ final class PeerInfoPaneContainerNode: ASDisplayNode, UIGestureRecognizerDelegat transition.updateAlpha(node: self.coveringBackgroundNode, alpha: expansionFraction) - self.backgroundColor = presentationData.theme.list.itemBlocksBackgroundColor + self.backgroundColor = presentationData.theme.list.plainBackgroundColor self.coveringBackgroundNode.updateColor(color: presentationData.theme.rootController.navigationBar.opaqueBackgroundColor, transition: .immediate) self.separatorNode.backgroundColor = presentationData.theme.list.itemBlocksSeparatorColor self.tabsSeparatorNode.backgroundColor = presentationData.theme.list.itemBlocksSeparatorColor