mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various Fixes
This commit is contained in:
parent
0c9eb7006c
commit
23ec6672c1
@ -858,6 +858,8 @@ public final class VoiceChatController: ViewController {
|
||||
|
||||
private var currentLoadToken: String?
|
||||
|
||||
private var scrollAtTop = true
|
||||
|
||||
private var effectiveMuteState: GroupCallParticipantsContext.Participant.MuteState? {
|
||||
if self.pushingToTalk {
|
||||
return nil
|
||||
@ -2157,6 +2159,22 @@ public final class VoiceChatController: ViewController {
|
||||
}
|
||||
}
|
||||
|
||||
self.listNode.visibleContentOffsetChanged = { [weak self] offset in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
var scrollAtTop = false
|
||||
if case let .known(value) = offset, value < 180.0 {
|
||||
scrollAtTop = true
|
||||
} else {
|
||||
scrollAtTop = false
|
||||
}
|
||||
if scrollAtTop != strongSelf.scrollAtTop {
|
||||
strongSelf.scrollAtTop = scrollAtTop
|
||||
strongSelf.updateTitle(transition: .immediate)
|
||||
}
|
||||
}
|
||||
|
||||
self.listNode.visibleBottomContentOffsetChanged = { [weak self] offset in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
@ -3939,8 +3957,15 @@ public final class VoiceChatController: ViewController {
|
||||
}
|
||||
}
|
||||
|
||||
var subtitle = self.currentSpeakingSubtitle ?? self.currentSubtitle
|
||||
var speaking = self.currentSpeakingSubtitle != nil
|
||||
var subtitle = ""
|
||||
var speaking = false
|
||||
if self.scrollAtTop {
|
||||
subtitle = self.currentSubtitle
|
||||
speaking = false
|
||||
} else {
|
||||
subtitle = self.currentSpeakingSubtitle ?? self.currentSubtitle
|
||||
speaking = self.currentSpeakingSubtitle != nil
|
||||
}
|
||||
if self.isScheduling {
|
||||
subtitle = ""
|
||||
speaking = false
|
||||
|
@ -565,23 +565,35 @@ private class PreviewIconNode: ASDisplayNode {
|
||||
override init() {
|
||||
self.avatar1Node = ASImageNode()
|
||||
self.avatar1Node.cornerRadius = 4.0
|
||||
self.avatar1Node.clipsToBounds = true
|
||||
self.avatar1Node.displaysAsynchronously = false
|
||||
self.avatar1Node.backgroundColor = UIColor(rgb: 0x834fff)
|
||||
self.avatar1Node.image = UIImage(bundleImageName: "Call/Avatar1")
|
||||
self.avatar1Node.contentMode = .bottom
|
||||
|
||||
self.avatar2Node = ASImageNode()
|
||||
self.avatar2Node.cornerRadius = 4.0
|
||||
self.avatar2Node.clipsToBounds = true
|
||||
self.avatar2Node.displaysAsynchronously = false
|
||||
self.avatar2Node.backgroundColor = UIColor(rgb: 0x63d5c9)
|
||||
self.avatar2Node.image = UIImage(bundleImageName: "Call/Avatar2")
|
||||
self.avatar2Node.contentMode = .scaleAspectFit
|
||||
|
||||
self.avatar3Node = ASImageNode()
|
||||
self.avatar3Node.cornerRadius = 4.0
|
||||
self.avatar3Node.clipsToBounds = true
|
||||
self.avatar3Node.displaysAsynchronously = false
|
||||
self.avatar3Node.backgroundColor = UIColor(rgb: 0xccff60)
|
||||
self.avatar3Node.image = UIImage(bundleImageName: "Call/Avatar3")
|
||||
self.avatar3Node.contentMode = .scaleAspectFit
|
||||
|
||||
self.avatar4Node = ASImageNode()
|
||||
self.avatar4Node.cornerRadius = 4.0
|
||||
self.avatar4Node.clipsToBounds = true
|
||||
self.avatar4Node.displaysAsynchronously = false
|
||||
self.avatar4Node.backgroundColor = UIColor(rgb: 0xf5512a)
|
||||
self.avatar4Node.image = UIImage(bundleImageName: "Call/Avatar4")
|
||||
self.avatar4Node.contentMode = .scaleAspectFit
|
||||
|
||||
super.init()
|
||||
|
||||
|
BIN
submodules/TelegramUI/Images.xcassets/Call/Avatar1.imageset/Avatar1.pdf
vendored
Normal file
BIN
submodules/TelegramUI/Images.xcassets/Call/Avatar1.imageset/Avatar1.pdf
vendored
Normal file
Binary file not shown.
12
submodules/TelegramUI/Images.xcassets/Call/Avatar1.imageset/Contents.json
vendored
Normal file
12
submodules/TelegramUI/Images.xcassets/Call/Avatar1.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Avatar1.pdf",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
submodules/TelegramUI/Images.xcassets/Call/Avatar2.imageset/Avatar3.pdf
vendored
Normal file
BIN
submodules/TelegramUI/Images.xcassets/Call/Avatar2.imageset/Avatar3.pdf
vendored
Normal file
Binary file not shown.
12
submodules/TelegramUI/Images.xcassets/Call/Avatar2.imageset/Contents.json
vendored
Normal file
12
submodules/TelegramUI/Images.xcassets/Call/Avatar2.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Avatar3.pdf",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
submodules/TelegramUI/Images.xcassets/Call/Avatar3.imageset/Avatar2.pdf
vendored
Normal file
BIN
submodules/TelegramUI/Images.xcassets/Call/Avatar3.imageset/Avatar2.pdf
vendored
Normal file
Binary file not shown.
12
submodules/TelegramUI/Images.xcassets/Call/Avatar3.imageset/Contents.json
vendored
Normal file
12
submodules/TelegramUI/Images.xcassets/Call/Avatar3.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Avatar2.pdf",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
submodules/TelegramUI/Images.xcassets/Call/Avatar4.imageset/Avatar4.pdf
vendored
Normal file
BIN
submodules/TelegramUI/Images.xcassets/Call/Avatar4.imageset/Avatar4.pdf
vendored
Normal file
Binary file not shown.
12
submodules/TelegramUI/Images.xcassets/Call/Avatar4.imageset/Contents.json
vendored
Normal file
12
submodules/TelegramUI/Images.xcassets/Call/Avatar4.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Avatar4.pdf",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
@ -1058,7 +1058,6 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
accessoryPanelSize = accessoryPanelNode.measure(CGSize(width: layout.size.width, height: layout.size.height))
|
||||
|
||||
accessoryPanelNode.updateState(size: layout.size, inset: layout.safeInsets.left, interfaceState: self.chatPresentationInterfaceState)
|
||||
accessoryPanelNode.animateIn()
|
||||
|
||||
if accessoryPanelNode !== self.accessoryPanelNode {
|
||||
dismissedAccessoryPanelNode = self.accessoryPanelNode
|
||||
@ -1069,6 +1068,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
} else {
|
||||
self.insertSubnode(accessoryPanelNode, aboveSubnode: self.inputPanelBackgroundNode)
|
||||
}
|
||||
accessoryPanelNode.animateIn()
|
||||
|
||||
accessoryPanelNode.dismiss = { [weak self, weak accessoryPanelNode] in
|
||||
if let strongSelf = self, let accessoryPanelNode = accessoryPanelNode, strongSelf.accessoryPanelNode === accessoryPanelNode {
|
||||
|
@ -203,7 +203,6 @@ final class ChatMediaInputMetaSectionItemNode: ListViewItemNode {
|
||||
self.imageNode.image = PresentationResourcesChat.chatInputMediaPanelTrendingGifsIcon(theme)
|
||||
title = "Trending"
|
||||
case let .gifEmoji(emoji, file):
|
||||
var emoji = emoji
|
||||
switch emoji {
|
||||
case "😡":
|
||||
title = "Angry"
|
||||
|
@ -254,7 +254,7 @@ func chatMediaInputPanelGifModeEntries(theme: PresentationTheme, reactions: [Str
|
||||
return entries
|
||||
}
|
||||
|
||||
func chatMediaInputGridEntries(view: ItemCollectionsView, savedStickers: OrderedItemListView?, recentStickers: OrderedItemListView?, peerSpecificPack: PeerSpecificPackData?, canInstallPeerSpecificPack: CanInstallPeerSpecificPack, trendingPacks: [FeaturedStickerPackItem], trendingIsDismissed: Bool = false, hasSearch: Bool = true, hasAccessories: Bool = true, strings: PresentationStrings, theme: PresentationTheme) -> [ChatMediaInputGridEntry] {
|
||||
func chatMediaInputGridEntries(view: ItemCollectionsView, savedStickers: OrderedItemListView?, recentStickers: OrderedItemListView?, peerSpecificPack: PeerSpecificPackData?, canInstallPeerSpecificPack: CanInstallPeerSpecificPack, trendingPacks: [FeaturedStickerPackItem], installedPacks: Set<ItemCollectionId>, trendingIsDismissed: Bool = false, hasSearch: Bool = true, hasAccessories: Bool = true, strings: PresentationStrings, theme: PresentationTheme) -> [ChatMediaInputGridEntry] {
|
||||
var entries: [ChatMediaInputGridEntry] = []
|
||||
|
||||
if hasSearch && view.lower == nil {
|
||||
@ -282,8 +282,9 @@ func chatMediaInputGridEntries(view: ItemCollectionsView, savedStickers: Ordered
|
||||
}
|
||||
}
|
||||
|
||||
if !trendingIsDismissed {
|
||||
entries.append(.trendingList(theme: theme, strings: strings, packs: trendingPacks))
|
||||
let filteredTrending = trendingPacks.filter { !installedPacks.contains($0.info.id) }
|
||||
if !trendingIsDismissed && !filteredTrending.isEmpty {
|
||||
entries.append(.trendingList(theme: theme, strings: strings, packs: filteredTrending))
|
||||
}
|
||||
|
||||
if let recentStickers = recentStickers, !recentStickers.items.isEmpty {
|
||||
@ -1135,7 +1136,7 @@ final class ChatMediaInputNode: ChatInputNode {
|
||||
|
||||
let panelEntries = chatMediaInputPanelEntries(view: view, savedStickers: savedStickers, recentStickers: recentStickers, temporaryPackOrder: temporaryPackOrder, trendingIsDismissed: trendingIsDismissed, peerSpecificPack: peerSpecificPack.0, canInstallPeerSpecificPack: peerSpecificPack.1, theme: theme, expanded: panelExpanded)
|
||||
let gifPaneEntries = chatMediaInputPanelGifModeEntries(theme: theme, reactions: reactions, animatedEmojiStickers: animatedEmojiStickers, expanded: panelExpanded)
|
||||
var gridEntries = chatMediaInputGridEntries(view: view, savedStickers: savedStickers, recentStickers: recentStickers, peerSpecificPack: peerSpecificPack.0, canInstallPeerSpecificPack: peerSpecificPack.1, trendingPacks: trendingPacks, trendingIsDismissed: trendingIsDismissed, strings: strings, theme: theme)
|
||||
var gridEntries = chatMediaInputGridEntries(view: view, savedStickers: savedStickers, recentStickers: recentStickers, peerSpecificPack: peerSpecificPack.0, canInstallPeerSpecificPack: peerSpecificPack.1, trendingPacks: trendingPacks, installedPacks: installedPacks, trendingIsDismissed: trendingIsDismissed, strings: strings, theme: theme)
|
||||
|
||||
if view.higher == nil {
|
||||
var hasTopSeparator = true
|
||||
|
@ -590,7 +590,7 @@ private final class DrawingStickersScreenNode: ViewControllerTracingNode {
|
||||
}
|
||||
|
||||
let panelEntries = chatMediaInputPanelEntries(view: view, savedStickers: savedStickers, recentStickers: recentStickers, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, theme: theme, hasGifs: false, hasSettings: false)
|
||||
let gridEntries = chatMediaInputGridEntries(view: view, savedStickers: savedStickers, recentStickers: recentStickers, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, trendingPacks: trendingPacks, hasSearch: false, hasAccessories: false, strings: strings, theme: theme)
|
||||
let gridEntries = chatMediaInputGridEntries(view: view, savedStickers: savedStickers, recentStickers: recentStickers, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, trendingPacks: trendingPacks, installedPacks: installedPacks, hasSearch: false, hasAccessories: false, strings: strings, theme: theme)
|
||||
|
||||
let (previousPanelEntries, previousGridEntries) = previousStickerEntries.swap((panelEntries, gridEntries))
|
||||
return (view, preparedChatMediaInputPanelEntryTransition(context: context, from: previousPanelEntries, to: panelEntries, inputNodeInteraction: stickersInputNodeInteraction, scrollToItem: nil), previousPanelEntries.isEmpty, preparedChatMediaInputGridEntryTransition(account: context.account, view: view, from: previousGridEntries, to: gridEntries, update: update, interfaceInteraction: controllerInteraction, inputNodeInteraction: stickersInputNodeInteraction, trendingInteraction: trendingInteraction), previousGridEntries.isEmpty)
|
||||
@ -625,7 +625,7 @@ private final class DrawingStickersScreenNode: ViewControllerTracingNode {
|
||||
}
|
||||
|
||||
let panelEntries = chatMediaInputPanelEntries(view: view, savedStickers: nil, recentStickers: nil, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, theme: theme, hasGifs: false, hasSettings: false)
|
||||
let gridEntries = chatMediaInputGridEntries(view: view, savedStickers: nil, recentStickers: nil, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, trendingPacks: [], hasSearch: false, hasAccessories: false, strings: strings, theme: theme)
|
||||
let gridEntries = chatMediaInputGridEntries(view: view, savedStickers: nil, recentStickers: nil, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, trendingPacks: [], installedPacks: installedPacks, hasSearch: false, hasAccessories: false, strings: strings, theme: theme)
|
||||
|
||||
let (previousPanelEntries, previousGridEntries) = previousMaskEntries.swap((panelEntries, gridEntries))
|
||||
return (view, preparedChatMediaInputPanelEntryTransition(context: context, from: previousPanelEntries, to: panelEntries, inputNodeInteraction: masksInputNodeInteraction, scrollToItem: nil), previousPanelEntries.isEmpty, preparedChatMediaInputGridEntryTransition(account: context.account, view: view, from: previousGridEntries, to: gridEntries, update: update, interfaceInteraction: controllerInteraction, inputNodeInteraction: masksInputNodeInteraction, trendingInteraction: trendingInteraction), previousGridEntries.isEmpty)
|
||||
|
Loading…
x
Reference in New Issue
Block a user