mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
UI fixes
This commit is contained in:
@@ -557,6 +557,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
private var freezeOverscrollControl: Bool = false
|
||||
private var feedback: HapticFeedback?
|
||||
var openNextChannelToRead: ((EnginePeer, TelegramEngine.NextUnreadChannelLocation) -> Void)?
|
||||
private var contentInsetAnimator: DisplayLinkAnimator?
|
||||
|
||||
private let adMessagesContext: AdMessagesHistoryContext?
|
||||
|
||||
@@ -1267,9 +1268,30 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
if let nextChannelToRead = strongSelf.nextChannelToRead, strongSelf.currentOverscrollExpandProgress >= 0.99 {
|
||||
strongSelf.freezeOverscrollControl = true
|
||||
strongSelf.openNextChannelToRead?(nextChannelToRead.peer, nextChannelToRead.location)
|
||||
if strongSelf.offerNextChannelToRead, strongSelf.currentOverscrollExpandProgress >= 0.99 {
|
||||
if let nextChannelToRead = strongSelf.nextChannelToRead {
|
||||
strongSelf.freezeOverscrollControl = true
|
||||
strongSelf.openNextChannelToRead?(nextChannelToRead.peer, nextChannelToRead.location)
|
||||
} else {
|
||||
strongSelf.scroller.contentInset = UIEdgeInsets(top: 94.0 + 12.0, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
Queue.mainQueue().after(0.5, {
|
||||
let animator = DisplayLinkAnimator(duration: 0.2, from: 1.0, to: 0.0, update: { rawT in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
let t = listViewAnimationCurveEaseInOut(rawT)
|
||||
let value = (94.0 + 12.0) * t
|
||||
strongSelf.scroller.contentInset = UIEdgeInsets(top: value, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
}, completion: {
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
strongSelf.contentInsetAnimator = nil
|
||||
strongSelf.scroller.contentInset = UIEdgeInsets()
|
||||
})
|
||||
strongSelf.contentInsetAnimator = animator
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user