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
455a04c363
commit
68401649bd
@ -3996,7 +3996,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
|
||||
var offset: CGFloat = 6.0
|
||||
if let reorderScrollStartTimestamp = self.reorderScrollStartTimestamp, reorderScrollStartTimestamp + 2.0 < timestamp {
|
||||
offset *= 2.0
|
||||
offset *= 1.5
|
||||
}
|
||||
if reorderOffset < effectiveInsets.top + 10.0 {
|
||||
if self.itemNodes[0].apparentFrame.minY < effectiveInsets.top {
|
||||
|
@ -268,7 +268,7 @@ 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)))
|
||||
|
||||
let titleSize = self.titleNode.updateLayout(CGSize(width: expandedBoundingSize.width, height: expandedBoundingSize.height))
|
||||
let titleSize = self.titleNode.updateLayout(CGSize(width: expandedBoundingSize.width + 10.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)
|
||||
|
@ -1292,6 +1292,7 @@ final class ChatMediaInputNode: ChatInputNode {
|
||||
}
|
||||
if let index = index {
|
||||
strongSelf.panelFocusScrollToIndex = index
|
||||
strongSelf.panelFocusInitialPosition = position
|
||||
}
|
||||
strongSelf.interfaceInteraction?.updateTextInputStateAndMode { inputTextState, inputMode in
|
||||
if case let .media(mode, expanded, _) = inputMode {
|
||||
@ -2257,6 +2258,7 @@ final class ChatMediaInputNode: ChatInputNode {
|
||||
}
|
||||
|
||||
var scrollToItem: ListViewScrollToItem?
|
||||
if self.paneArrangement.currentIndex == 1 {
|
||||
if let targetIndex = self.panelFocusScrollToIndex, !self.listView.isReordering {
|
||||
var position: ListViewScrollPosition
|
||||
if self.panelIsFocused {
|
||||
@ -2276,6 +2278,7 @@ final class ChatMediaInputNode: ChatInputNode {
|
||||
}
|
||||
scrollToItem = ListViewScrollToItem(index: targetIndex, position: position, animated: true, curve: .Spring(duration: 0.4), directionHint: .Down, displayLink: true)
|
||||
}
|
||||
}
|
||||
|
||||
self.listView.transaction(deleteIndices: transition.deletions, insertIndicesAndItems: transition.insertions, updateIndicesAndItems: transition.updates, options: options, scrollToItem: scrollToItem, updateOpaqueState: transition.updateOpaqueState, completion: { [weak self] _ in
|
||||
if let strongSelf = self {
|
||||
@ -2290,9 +2293,37 @@ final class ChatMediaInputNode: ChatInputNode {
|
||||
|
||||
private func enqueueGifPanelTransition(_ transition: ChatMediaInputPanelTransition, firstTime: Bool) {
|
||||
var options = ListViewDeleteAndInsertOptions()
|
||||
if firstTime {
|
||||
options.insert(.Synchronous)
|
||||
options.insert(.LowLatency)
|
||||
self.gifListView.transaction(deleteIndices: transition.deletions, insertIndicesAndItems: transition.insertions, updateIndicesAndItems: transition.updates, options: options, updateOpaqueState: nil, completion: { _ in
|
||||
} else {
|
||||
options.insert(.AnimateInsertion)
|
||||
}
|
||||
|
||||
var scrollToItem: ListViewScrollToItem?
|
||||
if self.paneArrangement.currentIndex == 0 {
|
||||
if let targetIndex = self.panelFocusScrollToIndex {
|
||||
var position: ListViewScrollPosition
|
||||
if self.panelIsFocused {
|
||||
if let initialPosition = self.panelFocusInitialPosition {
|
||||
position = .top(96.0 + (initialPosition.y - self.gifListView.frame.height / 2.0) * 0.5)
|
||||
} else {
|
||||
position = .top(96.0)
|
||||
}
|
||||
} else {
|
||||
if let initialPosition = self.panelFocusInitialPosition {
|
||||
position = .top(self.gifListView.frame.height / 2.0 + 96.0 + (initialPosition.y - self.gifListView.frame.height / 2.0))
|
||||
} else {
|
||||
position = .top(self.gifListView.frame.height / 2.0 + 96.0)
|
||||
}
|
||||
self.panelFocusScrollToIndex = nil
|
||||
self.panelFocusInitialPosition = nil
|
||||
}
|
||||
scrollToItem = ListViewScrollToItem(index: targetIndex, position: position, animated: true, curve: .Spring(duration: 0.4), directionHint: .Down, displayLink: true)
|
||||
}
|
||||
}
|
||||
|
||||
self.gifListView.transaction(deleteIndices: transition.deletions, insertIndicesAndItems: transition.insertions, updateIndicesAndItems: transition.updates, options: options, scrollToItem: scrollToItem, updateOpaqueState: nil, completion: { _ in
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user