mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Add voice search filter
This commit is contained in:
parent
fb0d0cb90f
commit
a05970c379
@ -1643,6 +1643,8 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo
|
||||
messageTags = .file
|
||||
case .music:
|
||||
messageTags = .music
|
||||
case .voice:
|
||||
messageTags = .voiceOrInstantVideo
|
||||
case let .date(date, _):
|
||||
messageTags = strongSelf.currentSearchOptions.messageTags
|
||||
maxDate = date
|
||||
@ -1757,6 +1759,9 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo
|
||||
} else if messageTags == .music {
|
||||
title = self.presentationData.strings.ChatList_Search_FilterMusic
|
||||
icon = UIImage(bundleImageName: "Chat List/Search/Music")
|
||||
} else if messageTags == .voiceOrInstantVideo {
|
||||
title = self.presentationData.strings.ChatList_Search_FilterVoice
|
||||
icon = UIImage(bundleImageName: "Chat List/Search/Voice")
|
||||
}
|
||||
|
||||
if let title = title {
|
||||
@ -2168,7 +2173,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo
|
||||
let title = formatter.string(from: possibleDate)
|
||||
filters = [.date(Int32(possibleDate.timeIntervalSince1970), title)]
|
||||
} else {
|
||||
filters = [.media, .links, .files, .music]
|
||||
filters = [.media, .links, .files, .music, .voice]
|
||||
}
|
||||
|
||||
self.filterContainerNode.update(size: CGSize(width: layout.size.width, height: 37.0), sideInset: layout.safeInsets.left, filters: filters.map { .filter($0) }, presentationData: self.presentationData, transition: .animated(duration: 0.4, curve: .spring))
|
||||
|
@ -12,6 +12,7 @@ enum ChatListSearchFilter: Equatable {
|
||||
case links
|
||||
case files
|
||||
case music
|
||||
case voice
|
||||
case date(Int32, String)
|
||||
|
||||
var id: Int32 {
|
||||
@ -24,6 +25,8 @@ enum ChatListSearchFilter: Equatable {
|
||||
return 2
|
||||
case .music:
|
||||
return 3
|
||||
case .voice:
|
||||
return 4
|
||||
case let .date(date, _):
|
||||
return date
|
||||
}
|
||||
@ -107,6 +110,9 @@ private final class ItemNode: ASDisplayNode {
|
||||
case .music:
|
||||
title = presentationData.strings.ChatList_Search_FilterMusic
|
||||
icon = generateTintedImage(image: UIImage(bundleImageName: "Chat List/Search/Music"), color: color)
|
||||
case .voice:
|
||||
title = presentationData.strings.ChatList_Search_FilterVoice
|
||||
icon = generateTintedImage(image: UIImage(bundleImageName: "Chat List/Search/Voice"), color: color)
|
||||
case let .date(_, dateTitle):
|
||||
title = dateTitle
|
||||
icon = generateTintedImage(image: UIImage(bundleImageName: "Chat List/Search/Calendar"), color: color)
|
||||
|
12
submodules/TelegramUI/Images.xcassets/Chat List/Search/Voice.imageset/Contents.json
vendored
Normal file
12
submodules/TelegramUI/Images.xcassets/Chat List/Search/Voice.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "ic_search_voice.pdf",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
submodules/TelegramUI/Images.xcassets/Chat List/Search/Voice.imageset/ic_search_voice.pdf
vendored
Normal file
BIN
submodules/TelegramUI/Images.xcassets/Chat List/Search/Voice.imageset/ic_search_voice.pdf
vendored
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user