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
|
var offset: CGFloat = 6.0
|
||||||
if let reorderScrollStartTimestamp = self.reorderScrollStartTimestamp, reorderScrollStartTimestamp + 2.0 < timestamp {
|
if let reorderScrollStartTimestamp = self.reorderScrollStartTimestamp, reorderScrollStartTimestamp + 2.0 < timestamp {
|
||||||
offset *= 2.0
|
offset *= 1.5
|
||||||
}
|
}
|
||||||
if reorderOffset < effectiveInsets.top + 10.0 {
|
if reorderOffset < effectiveInsets.top + 10.0 {
|
||||||
if self.itemNodes[0].apparentFrame.minY < effectiveInsets.top {
|
if self.itemNodes[0].apparentFrame.minY < effectiveInsets.top {
|
||||||
|
@ -268,7 +268,7 @@ final class ChatMediaInputMetaSectionItemNode: ListViewItemNode {
|
|||||||
expandTransition.updateTransformScale(node: self.scalingNode, scale: expandScale)
|
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.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 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)
|
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 {
|
if let index = index {
|
||||||
strongSelf.panelFocusScrollToIndex = index
|
strongSelf.panelFocusScrollToIndex = index
|
||||||
|
strongSelf.panelFocusInitialPosition = position
|
||||||
}
|
}
|
||||||
strongSelf.interfaceInteraction?.updateTextInputStateAndMode { inputTextState, inputMode in
|
strongSelf.interfaceInteraction?.updateTextInputStateAndMode { inputTextState, inputMode in
|
||||||
if case let .media(mode, expanded, _) = inputMode {
|
if case let .media(mode, expanded, _) = inputMode {
|
||||||
@ -2257,24 +2258,26 @@ final class ChatMediaInputNode: ChatInputNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var scrollToItem: ListViewScrollToItem?
|
var scrollToItem: ListViewScrollToItem?
|
||||||
if let targetIndex = self.panelFocusScrollToIndex, !self.listView.isReordering {
|
if self.paneArrangement.currentIndex == 1 {
|
||||||
var position: ListViewScrollPosition
|
if let targetIndex = self.panelFocusScrollToIndex, !self.listView.isReordering {
|
||||||
if self.panelIsFocused {
|
var position: ListViewScrollPosition
|
||||||
if let initialPosition = self.panelFocusInitialPosition {
|
if self.panelIsFocused {
|
||||||
position = .top(96.0 + (initialPosition.y - self.listView.frame.height / 2.0) * 0.5)
|
if let initialPosition = self.panelFocusInitialPosition {
|
||||||
|
position = .top(96.0 + (initialPosition.y - self.listView.frame.height / 2.0) * 0.5)
|
||||||
|
} else {
|
||||||
|
position = .top(96.0)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
position = .top(96.0)
|
if let initialPosition = self.panelFocusInitialPosition {
|
||||||
|
position = .top(self.listView.frame.height / 2.0 + 96.0 + (initialPosition.y - self.listView.frame.height / 2.0))
|
||||||
|
} else {
|
||||||
|
position = .top(self.listView.frame.height / 2.0 + 96.0)
|
||||||
|
}
|
||||||
|
self.panelFocusScrollToIndex = nil
|
||||||
|
self.panelFocusInitialPosition = nil
|
||||||
}
|
}
|
||||||
} else {
|
scrollToItem = ListViewScrollToItem(index: targetIndex, position: position, animated: true, curve: .Spring(duration: 0.4), directionHint: .Down, displayLink: true)
|
||||||
if let initialPosition = self.panelFocusInitialPosition {
|
|
||||||
position = .top(self.listView.frame.height / 2.0 + 96.0 + (initialPosition.y - self.listView.frame.height / 2.0))
|
|
||||||
} else {
|
|
||||||
position = .top(self.listView.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.listView.transaction(deleteIndices: transition.deletions, insertIndicesAndItems: transition.insertions, updateIndicesAndItems: transition.updates, options: options, scrollToItem: scrollToItem, updateOpaqueState: transition.updateOpaqueState, completion: { [weak self] _ in
|
self.listView.transaction(deleteIndices: transition.deletions, insertIndicesAndItems: transition.insertions, updateIndicesAndItems: transition.updates, options: options, scrollToItem: scrollToItem, updateOpaqueState: transition.updateOpaqueState, completion: { [weak self] _ in
|
||||||
@ -2290,9 +2293,37 @@ final class ChatMediaInputNode: ChatInputNode {
|
|||||||
|
|
||||||
private func enqueueGifPanelTransition(_ transition: ChatMediaInputPanelTransition, firstTime: Bool) {
|
private func enqueueGifPanelTransition(_ transition: ChatMediaInputPanelTransition, firstTime: Bool) {
|
||||||
var options = ListViewDeleteAndInsertOptions()
|
var options = ListViewDeleteAndInsertOptions()
|
||||||
options.insert(.Synchronous)
|
if firstTime {
|
||||||
options.insert(.LowLatency)
|
options.insert(.Synchronous)
|
||||||
self.gifListView.transaction(deleteIndices: transition.deletions, insertIndicesAndItems: transition.insertions, updateIndicesAndItems: transition.updates, options: options, updateOpaqueState: nil, completion: { _ in
|
options.insert(.LowLatency)
|
||||||
|
} 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