mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
[WIP] Quotes and link previews
This commit is contained in:
@@ -135,7 +135,7 @@ func preparedChatHistoryViewTransition(from fromView: ChatHistoryView?, to toVie
|
||||
adjustedUpdateItems.append(ChatHistoryViewTransitionUpdateEntry(index: adjustedIndex, previousIndex: adjustedPreviousIndex, entry: entry, directionHint: directionHint))
|
||||
}
|
||||
|
||||
var scrolledToIndex: MessageHistoryAnchorIndex?
|
||||
var scrolledToIndex: MessageHistoryScrollToSubject?
|
||||
var scrolledToSomeIndex = false
|
||||
|
||||
let curve: ListViewAnimationCurve = scrollAnimationCurve ?? .Default(duration: nil)
|
||||
@@ -193,13 +193,14 @@ func preparedChatHistoryViewTransition(from fromView: ChatHistoryView?, to toVie
|
||||
index += 1
|
||||
}
|
||||
}
|
||||
case let .index(scrollIndex, position, directionHint, animated, highlight, displayLink):
|
||||
case let .index(scrollSubject, position, directionHint, animated, highlight, displayLink):
|
||||
let scrollIndex = scrollSubject
|
||||
if case .center = position, highlight {
|
||||
scrolledToIndex = scrollIndex
|
||||
scrolledToIndex = scrollSubject
|
||||
}
|
||||
var index = toView.filteredEntries.count - 1
|
||||
for entry in toView.filteredEntries {
|
||||
if scrollIndex.isLessOrEqual(to: entry.index) {
|
||||
if scrollIndex.index.isLessOrEqual(to: entry.index) {
|
||||
scrollToItem = ListViewScrollToItem(index: index, position: position, animated: animated, curve: curve, directionHint: directionHint, displayLink: displayLink)
|
||||
break
|
||||
}
|
||||
@@ -209,7 +210,7 @@ func preparedChatHistoryViewTransition(from fromView: ChatHistoryView?, to toVie
|
||||
if scrollToItem == nil {
|
||||
var index = 0
|
||||
for entry in toView.filteredEntries.reversed() {
|
||||
if !scrollIndex.isLess(than: entry.index) {
|
||||
if !scrollIndex.index.isLess(than: entry.index) {
|
||||
scrolledToSomeIndex = true
|
||||
scrollToItem = ListViewScrollToItem(index: index, position: position, animated: animated, curve: curve, directionHint: directionHint)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user