mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 03:09:56 +00:00
Various Fixes
This commit is contained in:
parent
9394d80e4f
commit
1e0e0de7c8
@ -1382,8 +1382,8 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
} else {
|
||||
var outgoingAudioBitrateKbit: Int32?
|
||||
let appConfiguration = self.accountContext.currentAppConfiguration.with({ $0 })
|
||||
if let data = appConfiguration.data, let value = data["voice_chat_send_bitrate"] as? Int32 {
|
||||
outgoingAudioBitrateKbit = value
|
||||
if let data = appConfiguration.data, let value = data["voice_chat_send_bitrate"] as? Double {
|
||||
outgoingAudioBitrateKbit = Int32(value)
|
||||
}
|
||||
|
||||
genericCallContext = OngoingGroupCallContext(video: self.videoCapturer, requestMediaChannelDescriptions: { [weak self] ssrcs, completion in
|
||||
|
||||
@ -3,7 +3,6 @@ import Postbox
|
||||
import TelegramApi
|
||||
import SwiftSignalKit
|
||||
|
||||
|
||||
private struct SearchStickersConfiguration {
|
||||
static var defaultValue: SearchStickersConfiguration {
|
||||
return SearchStickersConfiguration(cacheTimeout: 86400)
|
||||
@ -16,8 +15,8 @@ private struct SearchStickersConfiguration {
|
||||
}
|
||||
|
||||
static func with(appConfiguration: AppConfiguration) -> SearchStickersConfiguration {
|
||||
if let data = appConfiguration.data, let value = data["stickers_emoji_cache_time"] as? Int32 {
|
||||
return SearchStickersConfiguration(cacheTimeout: value)
|
||||
if let data = appConfiguration.data, let value = data["stickers_emoji_cache_time"] as? Double {
|
||||
return SearchStickersConfiguration(cacheTimeout: Int32(value))
|
||||
} else {
|
||||
return .defaultValue
|
||||
}
|
||||
|
||||
@ -224,7 +224,6 @@ final class ChatMediaInputMetaSectionItemNode: ListViewItemNode {
|
||||
expandTransition.updateTransformScale(node: self.scalingNode, scale: expandScale)
|
||||
expandTransition.updatePosition(node: self.scalingNode, position: CGPoint(x: boundsSize.width / 2.0, y: boundsSize.height / 2.0 + (expanded ? -53.0 : -7.0)))
|
||||
|
||||
expandTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0)
|
||||
let titleSize = self.titleNode.updateLayout(CGSize(width: expandedBoundingSize.width - 8.0, height: expandedBoundingSize.height))
|
||||
|
||||
let titleFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((expandedBoundingSize.width - titleSize.width) / 2.0), y: expandedBoundingSize.height - titleSize.height + 6.0), size: titleSize)
|
||||
@ -232,6 +231,9 @@ final class ChatMediaInputMetaSectionItemNode: ListViewItemNode {
|
||||
expandTransition.updateFrameAsPositionAndBounds(node: self.titleNode, frame: displayTitleFrame)
|
||||
expandTransition.updateTransformScale(node: self.titleNode, scale: expanded ? 1.0 : 0.001)
|
||||
|
||||
let alphaTransition: ContainedViewLayoutTransition = self.currentExpanded != expanded ? .animated(duration: expanded ? 0.15 : 0.1, curve: .linear) : .immediate
|
||||
alphaTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0, delay: expanded ? 0.05 : 0.0)
|
||||
|
||||
self.currentExpanded = expanded
|
||||
|
||||
expandTransition.updateFrame(node: self.highlightNode, frame: expanded ? titleFrame.insetBy(dx: -7.0, dy: -2.0) : CGRect(origin: CGPoint(x: self.imageNode.position.x - highlightSize.width / 2.0, y: self.imageNode.position.y - highlightSize.height / 2.0), size: highlightSize))
|
||||
|
||||
@ -66,9 +66,9 @@ func preparedChatMediaInputGridEntryTransition(account: Account, view: ItemColle
|
||||
case .initial:
|
||||
for i in (0 ..< toEntries.count).reversed() {
|
||||
switch toEntries[i] {
|
||||
case .search, .trendingList, .peerSpecificSetup, .trending:
|
||||
case .search, .peerSpecificSetup, .trending:
|
||||
break
|
||||
case .sticker:
|
||||
case .trendingList, .sticker:
|
||||
scrollToItem = GridNodeScrollToItem(index: i, position: .top(0.0), transition: .immediate, directionHint: .down, adjustForSection: true, adjustForTopInset: true)
|
||||
}
|
||||
}
|
||||
@ -248,7 +248,7 @@ func chatMediaInputGridEntries(view: ItemCollectionsView, savedStickers: Ordered
|
||||
}
|
||||
|
||||
var trendingIsDismissed = false
|
||||
if let dismissedTrendingStickerPacks = dismissedTrendingStickerPacks, trendingPacks.map { $0.info.id.id } == dismissedTrendingStickerPacks {
|
||||
if let dismissedTrendingStickerPacks = dismissedTrendingStickerPacks, trendingPacks.map({ $0.info.id.id }) == dismissedTrendingStickerPacks {
|
||||
trendingIsDismissed = true
|
||||
}
|
||||
if !trendingIsDismissed {
|
||||
@ -505,14 +505,12 @@ final class ChatMediaInputNode: ChatInputNode {
|
||||
self.themeAndStringsPromise = Promise((theme, strings))
|
||||
|
||||
self.collectionListPanel = ASDisplayNode()
|
||||
// self.collectionListPanel.clipsToBounds = true
|
||||
|
||||
self.collectionListSeparator = ASDisplayNode()
|
||||
self.collectionListSeparator.isLayerBacked = true
|
||||
self.collectionListSeparator.backgroundColor = theme.chat.inputMediaPanel.panelSeparatorColor
|
||||
|
||||
self.collectionListContainer = CollectionListContainerNode()
|
||||
// self.collectionListContainer.clipsToBounds = true
|
||||
|
||||
self.listView = ListView()
|
||||
self.listView.useSingleDimensionTouchPoint = true
|
||||
@ -961,7 +959,9 @@ final class ChatMediaInputNode: ChatInputNode {
|
||||
if let topVisibleSection = visibleItems.topSectionVisible as? ChatMediaInputStickerGridSection {
|
||||
topVisibleCollectionId = topVisibleSection.collectionId
|
||||
} else if let topVisible = visibleItems.topVisible {
|
||||
if let item = topVisible.1 as? ChatMediaInputStickerGridItem {
|
||||
if let _ = topVisible.1 as? StickerPaneTrendingListGridItem {
|
||||
topVisibleCollectionId = ItemCollectionId(namespace: ChatMediaInputPanelAuxiliaryNamespace.recentStickers.rawValue, id: 0)
|
||||
} else if let item = topVisible.1 as? ChatMediaInputStickerGridItem {
|
||||
topVisibleCollectionId = item.index.collectionId
|
||||
} else if let _ = topVisible.1 as? StickerPanePeerSpecificSetupGridItem {
|
||||
topVisibleCollectionId = ItemCollectionId(namespace: ChatMediaInputPanelAuxiliaryNamespace.peerSpecific.rawValue, id: 0)
|
||||
@ -2179,13 +2179,12 @@ final class ChatMediaInputNode: ChatInputNode {
|
||||
|
||||
private func updatePaneClippingContainer(size: CGSize, offset: CGFloat, transition: ContainedViewLayoutTransition) {
|
||||
var offset = offset
|
||||
var additionalOffset: CGFloat = 0.0
|
||||
if self.panelIsFocused {
|
||||
offset = 0.0
|
||||
}
|
||||
transition.updateFrame(node: self.collectionListSeparator, frame: CGRect(origin: CGPoint(x: 0.0, y: offset + 41.0 + additionalOffset), size: self.collectionListSeparator.bounds.size))
|
||||
transition.updateFrame(node: self.paneClippingContainer, frame: CGRect(origin: CGPoint(x: 0.0, y: offset + 41.0 + additionalOffset), size: size))
|
||||
transition.updateSublayerTransformOffset(layer: self.paneClippingContainer.layer, offset: CGPoint(x: 0.0, y: -offset - 41.0 - additionalOffset))
|
||||
transition.updateFrame(node: self.collectionListSeparator, frame: CGRect(origin: CGPoint(x: 0.0, y: offset + 41.0), size: self.collectionListSeparator.bounds.size))
|
||||
transition.updateFrame(node: self.paneClippingContainer, frame: CGRect(origin: CGPoint(x: 0.0, y: offset + 41.0), size: size))
|
||||
transition.updateSublayerTransformOffset(layer: self.paneClippingContainer.layer, offset: CGPoint(x: 0.0, y: -offset - 41.0))
|
||||
}
|
||||
|
||||
private func fixPaneScroll(pane: ChatMediaInputPane, state: ChatMediaInputPaneScrollState) {
|
||||
|
||||
@ -135,7 +135,6 @@ final class ChatMediaInputPeerSpecificItemNode: ListViewItemNode {
|
||||
expandTransition.updateTransformScale(node: self.scalingNode, scale: expandScale)
|
||||
expandTransition.updatePosition(node: self.scalingNode, position: CGPoint(x: boundsSize.width / 2.0, y: boundsSize.height / 2.0 + (expanded ? -53.0 : -7.0)))
|
||||
|
||||
expandTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0)
|
||||
let titleSize = self.titleNode.updateLayout(CGSize(width: expandedBoundingSize.width - 8.0, height: expandedBoundingSize.height))
|
||||
|
||||
let titleFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((expandedBoundingSize.width - titleSize.width) / 2.0), y: expandedBoundingSize.height - titleSize.height + 6.0), size: titleSize)
|
||||
@ -143,6 +142,9 @@ final class ChatMediaInputPeerSpecificItemNode: ListViewItemNode {
|
||||
expandTransition.updateFrameAsPositionAndBounds(node: self.titleNode, frame: displayTitleFrame)
|
||||
expandTransition.updateTransformScale(node: self.titleNode, scale: expanded ? 1.0 : 0.001)
|
||||
|
||||
let alphaTransition: ContainedViewLayoutTransition = self.currentExpanded != expanded ? .animated(duration: expanded ? 0.15 : 0.1, curve: .linear) : .immediate
|
||||
alphaTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0, delay: expanded ? 0.05 : 0.0)
|
||||
|
||||
self.currentExpanded = expanded
|
||||
|
||||
self.avatarNode.bounds = CGRect(origin: CGPoint(), size: imageSize)
|
||||
|
||||
@ -126,7 +126,6 @@ final class ChatMediaInputRecentGifsItemNode: ListViewItemNode {
|
||||
expandTransition.updateTransformScale(node: self.scalingNode, scale: expandScale)
|
||||
expandTransition.updatePosition(node: self.scalingNode, position: CGPoint(x: boundsSize.width / 2.0, y: boundsSize.height / 2.0 + (expanded ? -53.0 : -7.0)))
|
||||
|
||||
expandTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0)
|
||||
let titleSize = self.titleNode.updateLayout(CGSize(width: expandedBoundingSize.width - 8.0, height: expandedBoundingSize.height))
|
||||
|
||||
let titleFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((expandedBoundingSize.width - titleSize.width) / 2.0), y: expandedBoundingSize.height - titleSize.height + 6.0), size: titleSize)
|
||||
@ -134,6 +133,9 @@ final class ChatMediaInputRecentGifsItemNode: ListViewItemNode {
|
||||
expandTransition.updateFrameAsPositionAndBounds(node: self.titleNode, frame: displayTitleFrame)
|
||||
expandTransition.updateTransformScale(node: self.titleNode, scale: expanded ? 1.0 : 0.001)
|
||||
|
||||
let alphaTransition: ContainedViewLayoutTransition = self.currentExpanded != expanded ? .animated(duration: expanded ? 0.15 : 0.1, curve: .linear) : .immediate
|
||||
alphaTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0, delay: expanded ? 0.05 : 0.0)
|
||||
|
||||
self.currentExpanded = expanded
|
||||
|
||||
expandTransition.updateFrame(node: self.highlightNode, frame: expanded ? titleFrame.insetBy(dx: -7.0, dy: -2.0) : CGRect(origin: CGPoint(x: self.imageNode.position.x - highlightSize.width / 2.0, y: self.imageNode.position.y - highlightSize.height / 2.0), size: highlightSize))
|
||||
|
||||
@ -117,7 +117,6 @@ final class ChatMediaInputSettingsItemNode: ListViewItemNode {
|
||||
expandTransition.updateTransformScale(node: self.scalingNode, scale: expandScale)
|
||||
expandTransition.updatePosition(node: self.scalingNode, position: CGPoint(x: boundsSize.width / 2.0, y: boundsSize.height / 2.0 + (expanded ? -53.0 : -7.0)))
|
||||
|
||||
expandTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0)
|
||||
let titleSize = self.titleNode.updateLayout(CGSize(width: expandedBoundingSize.width - 8.0, height: expandedBoundingSize.height))
|
||||
|
||||
let titleFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((expandedBoundingSize.width - titleSize.width) / 2.0), y: expandedBoundingSize.height - titleSize.height + 6.0), size: titleSize)
|
||||
@ -125,6 +124,9 @@ final class ChatMediaInputSettingsItemNode: ListViewItemNode {
|
||||
expandTransition.updateFrameAsPositionAndBounds(node: self.titleNode, frame: displayTitleFrame)
|
||||
expandTransition.updateTransformScale(node: self.titleNode, scale: expanded ? 1.0 : 0.001)
|
||||
|
||||
let alphaTransition: ContainedViewLayoutTransition = self.currentExpanded != expanded ? .animated(duration: expanded ? 0.15 : 0.1, curve: .linear) : .immediate
|
||||
alphaTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0, delay: expanded ? 0.05 : 0.0)
|
||||
|
||||
self.currentExpanded = expanded
|
||||
}
|
||||
|
||||
|
||||
@ -262,7 +262,6 @@ final class ChatMediaInputStickerPackItemNode: ListViewItemNode {
|
||||
expandTransition.updateTransformScale(node: self.scalingNode, scale: expandScale)
|
||||
expandTransition.updatePosition(node: self.scalingNode, position: CGPoint(x: boundsSize.width / 2.0, y: boundsSize.height / 2.0 + (expanded ? -53.0 : -7.0)))
|
||||
|
||||
expandTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0)
|
||||
let titleSize = self.titleNode.updateLayout(CGSize(width: expandedBoundingSize.width - 8.0, height: expandedBoundingSize.height))
|
||||
|
||||
let titleFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((expandedBoundingSize.width - titleSize.width) / 2.0), y: expandedBoundingSize.height - titleSize.height + 6.0), size: titleSize)
|
||||
@ -270,6 +269,9 @@ final class ChatMediaInputStickerPackItemNode: ListViewItemNode {
|
||||
expandTransition.updateFrameAsPositionAndBounds(node: self.titleNode, frame: displayTitleFrame)
|
||||
expandTransition.updateTransformScale(node: self.titleNode, scale: expanded ? 1.0 : 0.001)
|
||||
|
||||
let alphaTransition: ContainedViewLayoutTransition = self.currentExpanded != expanded ? .animated(duration: expanded ? 0.15 : 0.1, curve: .linear) : .immediate
|
||||
alphaTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0, delay: expanded ? 0.05 : 0.0)
|
||||
|
||||
self.currentExpanded = expanded
|
||||
|
||||
self.imageNode.bounds = CGRect(origin: CGPoint(), size: imageSize)
|
||||
|
||||
@ -145,12 +145,15 @@ final class ChatMediaInputTrendingItemNode: ListViewItemNode {
|
||||
expandTransition.updateTransformScale(node: self.scalingNode, scale: expandScale)
|
||||
expandTransition.updatePosition(node: self.scalingNode, position: CGPoint(x: boundsSize.width / 2.0, y: boundsSize.height / 2.0 + (expanded ? -53.0 : -7.0)))
|
||||
|
||||
expandTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0)
|
||||
let titleSize = self.titleNode.updateLayout(CGSize(width: expandedBoundingSize.width - 8.0, height: expandedBoundingSize.height))
|
||||
|
||||
let titleFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((expandedBoundingSize.width - titleSize.width) / 2.0), y: expandedBoundingSize.height - titleSize.height + 6.0), size: titleSize)
|
||||
let displayTitleFrame = expanded ? titleFrame : CGRect(origin: CGPoint(x: titleFrame.minX, y: self.imageNode.position.y - titleFrame.size.height), size: titleFrame.size)
|
||||
expandTransition.updateFrameAsPositionAndBounds(node: self.titleNode, frame: displayTitleFrame)
|
||||
expandTransition.updateTransformScale(node: self.titleNode, scale: expanded ? 1.0 : 0.001)
|
||||
|
||||
let alphaTransition: ContainedViewLayoutTransition = self.currentExpanded != expanded ? .animated(duration: expanded ? 0.15 : 0.1, curve: .linear) : .immediate
|
||||
alphaTransition.updateAlpha(node: self.titleNode, alpha: expanded ? 1.0 : 0.0, delay: expanded ? 0.05 : 0.0)
|
||||
|
||||
self.currentExpanded = expanded
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user