mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Various improvements
This commit is contained in:
parent
87ca0f78d6
commit
30ad6807d4
2 changed files with 9 additions and 6 deletions
|
|
@ -657,12 +657,14 @@ public func makeAttachmentFileControllerImpl(
|
|||
let gesture: ContextGesture? = anyRecognizer as? ContextGesture
|
||||
|
||||
var items: [ContextMenuItem] = []
|
||||
items.append(.action(ContextMenuActionItem(text: presentationData.strings.KeyCommand_Play, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Play"), color: theme.contextMenu.primaryColor) }, action: { c, _ in
|
||||
c?.dismiss(completion: {})
|
||||
|
||||
let playlistLocation: PeerMessagesPlaylistLocation = .custom(messages: .single(([message._asMessage()], 0, false)), canReorder: false, at: message.id, loadMore: nil)
|
||||
context.sharedContext.mediaManager.setPlaylist((context, PeerMessagesMediaPlaylist(context: context, location: playlistLocation, chatLocationContextHolder: nil)), type: .music, control: .playback(.togglePlayPause))
|
||||
})))
|
||||
if case .audio = mode {
|
||||
items.append(.action(ContextMenuActionItem(text: "Play", icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Play"), color: theme.contextMenu.primaryColor) }, action: { c, _ in
|
||||
c?.dismiss(completion: {})
|
||||
|
||||
let playlistLocation: PeerMessagesPlaylistLocation = .custom(messages: .single(([message._asMessage()], 0, false)), canReorder: false, at: message.id, loadMore: nil)
|
||||
context.sharedContext.mediaManager.setPlaylist((context, PeerMessagesMediaPlaylist(context: context, location: playlistLocation, chatLocationContextHolder: nil)), type: .music, control: .playback(.togglePlayPause))
|
||||
})))
|
||||
}
|
||||
|
||||
items.append(.action(ContextMenuActionItem(text: presentationData.strings.Conversation_ContextMenuSelect, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Select"), color: theme.contextMenu.primaryColor) }, action: { c, _ in
|
||||
c?.dismiss(completion: {})
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import ItemListPeerActionItem
|
|||
import GlassBackgroundComponent
|
||||
import ActivityIndicator
|
||||
import SearchBarNode
|
||||
import PeerMessagesMediaPlaylist
|
||||
|
||||
final class AttachmentFileSearchItem: ItemListControllerSearch {
|
||||
let context: AccountContext
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue