diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 697721b12d..a1150c5303 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -7546,4 +7546,5 @@ Sorry for the inconvenience."; "AccessDenied.LocationPreciseDenied" = "To share your specific location in this chat, please go to Settings > Privacy > Location Services > Telegram and set Precise Location to On."; "Chat.MultipleTypingPair" = "%@ and %@ "; +"Chat.MultipleTypingPair" = "%@ and %@"; "Chat.MultipleTypingMore" = "%@ and %@ others"; diff --git a/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift b/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift index 9ee76ef24a..7f3e7d7660 100644 --- a/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift +++ b/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift @@ -319,6 +319,7 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { private let topSeparatorNode: ASDisplayNode private let separatorNode: ASDisplayNode private let highlightedBackgroundNode: ASDisplayNode + private let maskNode: ASImageNode private let extractedBackgroundImageNode: ASImageNode @@ -378,6 +379,9 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { self.extractedBackgroundImageNode.displaysAsynchronously = false self.extractedBackgroundImageNode.alpha = 0.0 + self.maskNode = ASImageNode() + self.maskNode.isUserInteractionEnabled = false + self.contextSourceNode = ContextExtractedContentContainingNode() self.containerNode = ContextControllerSourceNode() @@ -409,6 +413,8 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { self.offsetContainerNode.addSubnode(self.titleNode) self.offsetContainerNode.addSubnode(self.statusNode) + self.addSubnode(self.maskNode) + self.peerPresenceManager = PeerPresenceStatusManager(update: { [weak self] in if let strongSelf = self, let layoutParams = strongSelf.layoutParams { let (_, apply) = strongSelf.asyncLayout()(layoutParams.0, layoutParams.1, layoutParams.2, layoutParams.3, layoutParams.4, layoutParams.5) @@ -867,6 +873,9 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } + let hasCorners = itemListHasRoundedBlockLayout(params) + var hasTopCorners = false + var hasBottomCorners = false switch item.style { case .plain: strongSelf.topSeparatorNode.isHidden = true @@ -875,10 +884,19 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { case .sameSection(false): strongSelf.topSeparatorNode.isHidden = true default: - strongSelf.topSeparatorNode.isHidden = false + hasTopCorners = true + strongSelf.topSeparatorNode.isHidden = hasCorners } } + switch neighbors.bottom { + case .sameSection(false): + strongSelf.separatorNode.isHidden = false + default: + hasBottomCorners = true + strongSelf.separatorNode.isHidden = hasCorners + } + transition.updateFrame(node: strongSelf.avatarNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset - 50.0, y: floor((nodeLayout.contentSize.height - avatarDiameter) / 2.0)), size: CGSize(width: avatarDiameter, height: avatarDiameter))) let _ = titleApply() @@ -1043,8 +1061,11 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { let separatorHeight = UIScreenPixel + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + let topHighlightInset: CGFloat = (first || !nodeLayout.insets.top.isZero) ? 0.0 : separatorHeight strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: nodeLayout.contentSize.width, height: nodeLayout.contentSize.height)) + strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) strongSelf.highlightedBackgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -nodeLayout.insets.top - topHighlightInset), size: CGSize(width: nodeLayout.size.width, height: nodeLayout.size.height + topHighlightInset)) strongSelf.topSeparatorNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(nodeLayout.insets.top, separatorHeight)), size: CGSize(width: nodeLayout.contentSize.width, height: separatorHeight)) strongSelf.separatorNode.frame = CGRect(origin: CGPoint(x: leftInset, y: nodeLayout.contentSize.height - separatorHeight), size: CGSize(width: max(0.0, nodeLayout.size.width - leftInset), height: separatorHeight)) diff --git a/submodules/TelegramUI/Sources/ChatTitleView.swift b/submodules/TelegramUI/Sources/ChatTitleView.swift index 27cbc1b92c..bf12760857 100644 --- a/submodules/TelegramUI/Sources/ChatTitleView.swift +++ b/submodules/TelegramUI/Sources/ChatTitleView.swift @@ -375,17 +375,6 @@ final class ChatTitleView: UIView, NavigationBarTitleView { } else if let (peer, _) = inputActivities.first { stringValue = EnginePeer(peer).compactDisplayTitle } - for (peer, _) in inputActivities { - let title = EnginePeer(peer).compactDisplayTitle - if !title.isEmpty { - if first { - first = false - } else { - stringValue += ", " - } - stringValue += title - } - } } let color = titleTheme.rootController.navigationBar.accentTextColor let string = NSAttributedString(string: stringValue, font: subtitleFont, textColor: color)