mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Small adjustments
This commit is contained in:
parent
c8d87f8998
commit
7f99a91a82
12
submodules/TelegramUI/Images.xcassets/Chat/Context Menu/Statistics.imageset/Contents.json
vendored
Normal file
12
submodules/TelegramUI/Images.xcassets/Chat/Context Menu/Statistics.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "ic_stat.pdf",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
submodules/TelegramUI/Images.xcassets/Chat/Context Menu/Statistics.imageset/ic_stat.pdf
vendored
Normal file
BIN
submodules/TelegramUI/Images.xcassets/Chat/Context Menu/Statistics.imageset/ic_stat.pdf
vendored
Normal file
Binary file not shown.
@ -59,6 +59,7 @@ import SettingsUI
|
|||||||
import UrlWhitelist
|
import UrlWhitelist
|
||||||
import TelegramIntents
|
import TelegramIntents
|
||||||
import TooltipUI
|
import TooltipUI
|
||||||
|
import StatisticsUI
|
||||||
|
|
||||||
public enum ChatControllerPeekActions {
|
public enum ChatControllerPeekActions {
|
||||||
case standard
|
case standard
|
||||||
@ -2014,17 +2015,37 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
}, synchronousLoad: true)
|
}, synchronousLoad: true)
|
||||||
galleryController.setHintWillBePresentedInPreviewingContext(true)
|
galleryController.setHintWillBePresentedInPreviewingContext(true)
|
||||||
|
|
||||||
let items: [ContextMenuItem] = [
|
let items: Signal<[ContextMenuItem], NoError> = context.account.postbox.transaction { transaction -> [ContextMenuItem] in
|
||||||
.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.Conversation_LinkDialogOpen, icon: { _ in nil }, action: { _, f in
|
var items: [ContextMenuItem] = [
|
||||||
f(.dismissWithoutContent)
|
.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.Conversation_LinkDialogOpen, icon: { theme in
|
||||||
self?.navigationButtonAction(.openChatInfo(expandAvatar: true))
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Info"), color: theme.actionSheet.primaryTextColor)
|
||||||
})),
|
}, action: { _, f in
|
||||||
.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.Conversation_Search, icon: { _ in nil }, action: { _, f in
|
f(.dismissWithoutContent)
|
||||||
|
self?.navigationButtonAction(.openChatInfo(expandAvatar: true))
|
||||||
|
}))
|
||||||
|
]
|
||||||
|
if let cachedData = transaction.getPeerCachedData(peerId: peer.id) as? CachedChannelData, cachedData.flags.contains(.canViewStats) {
|
||||||
|
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.ChannelInfo_Stats, icon: { theme in
|
||||||
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Statistics"), color: theme.actionSheet.primaryTextColor)
|
||||||
|
}, action: { _, f in
|
||||||
|
f(.dismissWithoutContent)
|
||||||
|
guard let strongSelf = self, let peer = strongSelf.presentationInterfaceState.renderedPeer?.chatMainPeer else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
strongSelf.view.endEditing(true)
|
||||||
|
strongSelf.push(channelStatsController(context: context, peerId: peer.id, cachedPeerData: cachedData))
|
||||||
|
})))
|
||||||
|
}
|
||||||
|
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.Conversation_Search, icon: { theme in
|
||||||
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Statistics"), color: theme.actionSheet.primaryTextColor)
|
||||||
|
}, action: { _, f in
|
||||||
f(.dismissWithoutContent)
|
f(.dismissWithoutContent)
|
||||||
self?.interfaceInteraction?.beginMessageSearch(.everything, "")
|
self?.interfaceInteraction?.beginMessageSearch(.everything, "")
|
||||||
}))
|
})))
|
||||||
]
|
return items
|
||||||
let contextController = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .controller(ContextControllerContentSourceImpl(controller: galleryController, sourceNode: node)), items: .single(items), reactionItems: [], gesture: gesture)
|
}
|
||||||
|
|
||||||
|
let contextController = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .controller(ContextControllerContentSourceImpl(controller: galleryController, sourceNode: node)), items: items, reactionItems: [], gesture: gesture)
|
||||||
strongSelf.presentInGlobalOverlay(contextController)
|
strongSelf.presentInGlobalOverlay(contextController)
|
||||||
}
|
}
|
||||||
chatInfoButtonItem = UIBarButtonItem(customDisplayNode: avatarNode)!
|
chatInfoButtonItem = UIBarButtonItem(customDisplayNode: avatarNode)!
|
||||||
|
@ -403,6 +403,7 @@ final class ChatMediaInputNode: ChatInputNode {
|
|||||||
private let gifPaneIsActiveUpdated: (Bool) -> Void
|
private let gifPaneIsActiveUpdated: (Bool) -> Void
|
||||||
|
|
||||||
private var inputNodeInteraction: ChatMediaInputNodeInteraction!
|
private var inputNodeInteraction: ChatMediaInputNodeInteraction!
|
||||||
|
private var trendingInteraction: TrendingPaneInteraction?
|
||||||
|
|
||||||
private let collectionListPanel: ASDisplayNode
|
private let collectionListPanel: ASDisplayNode
|
||||||
private let collectionListSeparator: ASDisplayNode
|
private let collectionListSeparator: ASDisplayNode
|
||||||
@ -764,6 +765,7 @@ final class ChatMediaInputNode: ChatInputNode {
|
|||||||
return getItemIsPreviewedImpl?(item) ?? false
|
return getItemIsPreviewedImpl?(item) ?? false
|
||||||
}, openSearch: {
|
}, openSearch: {
|
||||||
})
|
})
|
||||||
|
self.trendingInteraction = trendingInteraction
|
||||||
|
|
||||||
let previousView = Atomic<ItemCollectionsView?>(value: nil)
|
let previousView = Atomic<ItemCollectionsView?>(value: nil)
|
||||||
let transitionQueue = Queue()
|
let transitionQueue = Queue()
|
||||||
@ -1495,6 +1497,7 @@ final class ChatMediaInputNode: ChatInputNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.gifPane.updateLayout(size: CGSize(width: width - leftInset - rightInset, height: panelHeight), topInset: 41.0, bottomInset: bottomInset, isExpanded: isExpanded, isVisible: isVisible, deviceMetrics: deviceMetrics, transition: transition)
|
self.gifPane.updateLayout(size: CGSize(width: width - leftInset - rightInset, height: panelHeight), topInset: 41.0, bottomInset: bottomInset, isExpanded: isExpanded, isVisible: isVisible, deviceMetrics: deviceMetrics, transition: transition)
|
||||||
|
self.trendingInteraction?.itemContext.canPlayMedia = isVisible
|
||||||
self.stickerPane.updateLayout(size: CGSize(width: width - leftInset - rightInset, height: panelHeight), topInset: 41.0, bottomInset: bottomInset, isExpanded: isExpanded, isVisible: isVisible && visiblePanes.contains(where: { $0.0 == .stickers }), deviceMetrics: deviceMetrics, transition: transition)
|
self.stickerPane.updateLayout(size: CGSize(width: width - leftInset - rightInset, height: panelHeight), topInset: 41.0, bottomInset: bottomInset, isExpanded: isExpanded, isVisible: isVisible && visiblePanes.contains(where: { $0.0 == .stickers }), deviceMetrics: deviceMetrics, transition: transition)
|
||||||
//self.trendingPane.updateLayout(size: CGSize(width: width - leftInset - rightInset, height: panelHeight), topInset: 41.0, bottomInset: bottomInset, isExpanded: isExpanded, isVisible: isVisible, deviceMetrics: deviceMetrics, transition: transition)
|
//self.trendingPane.updateLayout(size: CGSize(width: width - leftInset - rightInset, height: panelHeight), topInset: 41.0, bottomInset: bottomInset, isExpanded: isExpanded, isVisible: isVisible, deviceMetrics: deviceMetrics, transition: transition)
|
||||||
|
|
||||||
|
@ -171,6 +171,8 @@ final class ChatMediaInputStickerPane: ChatMediaInputPane {
|
|||||||
self.gridNode.forEachItemNode { itemNode in
|
self.gridNode.forEachItemNode { itemNode in
|
||||||
if let itemNode = itemNode as? ChatMediaInputStickerGridItemNode {
|
if let itemNode = itemNode as? ChatMediaInputStickerGridItemNode {
|
||||||
itemNode.updateIsPanelVisible(isVisible)
|
itemNode.updateIsPanelVisible(isVisible)
|
||||||
|
} else if let itemNode = itemNode as? StickerPaneSearchGlobalItemNode {
|
||||||
|
itemNode.updateCanPlayMedia()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ final class TrendingPaneInteraction {
|
|||||||
let openPack: (ItemCollectionInfo) -> Void
|
let openPack: (ItemCollectionInfo) -> Void
|
||||||
let getItemIsPreviewed: (StickerPackItem) -> Bool
|
let getItemIsPreviewed: (StickerPackItem) -> Bool
|
||||||
let openSearch: () -> Void
|
let openSearch: () -> Void
|
||||||
|
let itemContext = StickerPaneSearchGlobalItemContext()
|
||||||
|
|
||||||
init(installPack: @escaping (ItemCollectionInfo) -> Void, openPack: @escaping (ItemCollectionInfo) -> Void, getItemIsPreviewed: @escaping (StickerPackItem) -> Bool, openSearch: @escaping () -> Void) {
|
init(installPack: @escaping (ItemCollectionInfo) -> Void, openPack: @escaping (ItemCollectionInfo) -> Void, getItemIsPreviewed: @escaping (StickerPackItem) -> Bool, openSearch: @escaping () -> Void) {
|
||||||
self.installPack = installPack
|
self.installPack = installPack
|
||||||
@ -87,15 +88,13 @@ final class TrendingPanePackEntry: Identifiable, Comparable {
|
|||||||
|
|
||||||
func item(account: Account, interaction: TrendingPaneInteraction, grid: Bool) -> GridItem {
|
func item(account: Account, interaction: TrendingPaneInteraction, grid: Bool) -> GridItem {
|
||||||
let info = self.info
|
let info = self.info
|
||||||
let itemContext = StickerPaneSearchGlobalItemContext()
|
|
||||||
itemContext.canPlayMedia = true
|
|
||||||
return StickerPaneSearchGlobalItem(account: account, theme: self.theme, strings: self.strings, listAppearance: false, info: self.info, topItems: self.topItems, grid: grid, topSeparator: self.topSeparator, installed: self.installed, unread: self.unread, open: {
|
return StickerPaneSearchGlobalItem(account: account, theme: self.theme, strings: self.strings, listAppearance: false, info: self.info, topItems: self.topItems, grid: grid, topSeparator: self.topSeparator, installed: self.installed, unread: self.unread, open: {
|
||||||
interaction.openPack(info)
|
interaction.openPack(info)
|
||||||
}, install: {
|
}, install: {
|
||||||
interaction.installPack(info)
|
interaction.installPack(info)
|
||||||
}, getItemIsPreviewed: { item in
|
}, getItemIsPreviewed: { item in
|
||||||
return interaction.getItemIsPreviewed(item)
|
return interaction.getItemIsPreviewed(item)
|
||||||
}, itemContext: itemContext)
|
}, itemContext: interaction.itemContext)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,7 +932,7 @@ private final class SearchNavigationContentNode: NavigationBarContentNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override func updateLayout(size: CGSize, leftInset: CGFloat, rightInset: CGFloat, transition: ContainedViewLayoutTransition) {
|
override func updateLayout(size: CGSize, leftInset: CGFloat, rightInset: CGFloat, transition: ContainedViewLayoutTransition) {
|
||||||
let searchBarFrame = CGRect(origin: CGPoint(x: 0.0, y: size.height - self.nominalHeight), size: CGSize(width: size.width, height: 54.0))
|
let searchBarFrame = CGRect(origin: CGPoint(x: 0.0, y: 1.0 + size.height - self.nominalHeight), size: CGSize(width: size.width, height: 54.0))
|
||||||
self.searchBar.frame = searchBarFrame
|
self.searchBar.frame = searchBarFrame
|
||||||
self.searchBar.updateLayout(boundingSize: searchBarFrame.size, leftInset: leftInset, rightInset: rightInset, transition: transition)
|
self.searchBar.updateLayout(boundingSize: searchBarFrame.size, leftInset: leftInset, rightInset: rightInset, transition: transition)
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,12 @@ private final class PeerInfoScreenMemberItemNode: PeerInfoScreenItemNode {
|
|||||||
self.selectionNode.update(size: CGSize(width: width, height: height + highlightNodeOffset), theme: presentationData.theme, transition: transition)
|
self.selectionNode.update(size: CGSize(width: width, height: height + highlightNodeOffset), theme: presentationData.theme, transition: transition)
|
||||||
transition.updateFrame(node: self.selectionNode, frame: CGRect(origin: CGPoint(x: 0.0, y: -highlightNodeOffset), size: CGSize(width: width, height: height + highlightNodeOffset)))
|
transition.updateFrame(node: self.selectionNode, frame: CGRect(origin: CGPoint(x: 0.0, y: -highlightNodeOffset), size: CGSize(width: width, height: height + highlightNodeOffset)))
|
||||||
|
|
||||||
transition.updateFrame(node: self.bottomSeparatorNode, frame: CGRect(origin: CGPoint(x: sideInset, y: height - UIScreenPixel), size: CGSize(width: width - sideInset, height: UIScreenPixel)))
|
var separatorInset: CGFloat = sideInset
|
||||||
|
if bottomItem != nil {
|
||||||
|
separatorInset += 49.0
|
||||||
|
}
|
||||||
|
|
||||||
|
transition.updateFrame(node: self.bottomSeparatorNode, frame: CGRect(origin: CGPoint(x: separatorInset, y: height - UIScreenPixel), size: CGSize(width: width - sideInset, height: UIScreenPixel)))
|
||||||
transition.updateAlpha(node: self.bottomSeparatorNode, alpha: bottomItem == nil ? 0.0 : 1.0)
|
transition.updateAlpha(node: self.bottomSeparatorNode, alpha: bottomItem == nil ? 0.0 : 1.0)
|
||||||
|
|
||||||
return height
|
return height
|
||||||
|
Loading…
x
Reference in New Issue
Block a user