mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
5c25bca177
@ -373,6 +373,7 @@ public final class StoryPeerListComponent: Component {
|
||||
self.scrollView.clipsToBounds = false
|
||||
|
||||
self.scrollContainerView = UIView()
|
||||
self.scrollContainerView.clipsToBounds = true
|
||||
|
||||
self.titleView = UIImageView()
|
||||
self.titleView.layer.anchorPoint = CGPoint(x: 0.0, y: 0.5)
|
||||
@ -500,7 +501,8 @@ public final class StoryPeerListComponent: Component {
|
||||
return nil
|
||||
}
|
||||
if let visibleItem = self.visibleItems[peerId], let itemView = visibleItem.view.view as? StoryPeerListItemComponent.View {
|
||||
if !self.bounds.intersects(itemView.frame) {
|
||||
let effectiveVisibleBounds = self.bounds.insetBy(dx: 0.0, dy: -10000.0)
|
||||
if !effectiveVisibleBounds.intersects(itemView.frame) {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -774,7 +776,7 @@ public final class StoryPeerListComponent: Component {
|
||||
self.currentActivityFraction = collapsedState.activityFraction
|
||||
|
||||
let effectiveVisibleBounds = self.scrollView.bounds
|
||||
let visibleBounds = effectiveVisibleBounds.insetBy(dx: -200.0, dy: 0.0)
|
||||
let visibleBounds = effectiveVisibleBounds.insetBy(dx: -200.0, dy: -10000.0)
|
||||
|
||||
var effectiveFirstVisibleIndex = 0
|
||||
for i in 0 ..< self.sortedItems.count {
|
||||
@ -797,7 +799,11 @@ public final class StoryPeerListComponent: Component {
|
||||
|
||||
var overscrollFocusIndex: Int?
|
||||
for i in 0 ..< self.sortedItems.count {
|
||||
if self.sortedItems[i].peer.id != component.context.account.peerId {
|
||||
if self.sortedItems[i].peer.id == component.context.account.peerId {
|
||||
continue
|
||||
}
|
||||
let itemFrame = itemLayout.frame(at: i)
|
||||
if effectiveVisibleBounds.contains(itemFrame) {
|
||||
overscrollFocusIndex = i
|
||||
break
|
||||
}
|
||||
@ -1582,7 +1588,12 @@ public final class StoryPeerListComponent: Component {
|
||||
self.ignoreScrolling = true
|
||||
|
||||
transition.setFrame(view: self.scrollView, frame: CGRect(origin: CGPoint(x: 0.0, y: -4.0), size: CGSize(width: availableSize.width, height: availableSize.height + 4.0)))
|
||||
transition.setFrame(view: self.scrollContainerView, frame: CGRect(origin: CGPoint(x: 0.0, y: -4.0), size: CGSize(width: availableSize.width, height: availableSize.height + 4.0)))
|
||||
|
||||
let scrollContainerFrame = CGRect(origin: CGPoint(x: 0.0, y: -4.0), size: CGSize(width: availableSize.width, height: availableSize.height + 4.0))
|
||||
let scrollContainerExpandedFrame = scrollContainerFrame.insetBy(dx: 0.0, dy: -500.0)
|
||||
transition.setPosition(view: self.scrollContainerView, position: scrollContainerExpandedFrame.center)
|
||||
transition.setBounds(view: self.scrollContainerView, bounds: CGRect(origin: CGPoint(x: 0.0, y: scrollContainerExpandedFrame.minY - scrollContainerFrame.minY), size: scrollContainerExpandedFrame.size))
|
||||
|
||||
if self.scrollView.contentSize != itemLayout.contentSize {
|
||||
self.scrollView.contentSize = itemLayout.contentSize
|
||||
}
|
||||
|
@ -5001,6 +5001,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
if storyStats.totalCount == 0 {
|
||||
return nil
|
||||
}
|
||||
if storyStats.unseenCount == 0 {
|
||||
return nil
|
||||
}
|
||||
return AvatarNode.StoryStats(
|
||||
totalCount: storyStats.totalCount,
|
||||
unseenCount: storyStats.unseenCount,
|
||||
|
Loading…
x
Reference in New Issue
Block a user