mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Fix media grid layout on orientation change
This commit is contained in:
parent
cbdfd5ea55
commit
b3037d5f82
@ -798,6 +798,7 @@ final class ChatListSearchMediaNode: ASDisplayNode, UIScrollViewDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func update(size: CGSize, sideInset: CGFloat, bottomInset: CGFloat, visibleHeight: CGFloat, isScrollingLockedAtTop: Bool, expandProgress: CGFloat, presentationData: PresentationData, synchronous: Bool, transition: ContainedViewLayoutTransition) {
|
func update(size: CGSize, sideInset: CGFloat, bottomInset: CGFloat, visibleHeight: CGFloat, isScrollingLockedAtTop: Bool, expandProgress: CGFloat, presentationData: PresentationData, synchronous: Bool, transition: ContainedViewLayoutTransition) {
|
||||||
|
let previousParams = self.currentParams
|
||||||
self.currentParams = (size, sideInset, bottomInset, visibleHeight, isScrollingLockedAtTop, expandProgress, presentationData)
|
self.currentParams = (size, sideInset, bottomInset, visibleHeight, isScrollingLockedAtTop, expandProgress, presentationData)
|
||||||
|
|
||||||
transition.updateFrame(node: self.scrollNode, frame: CGRect(origin: CGPoint(), size: CGSize(width: size.width, height: size.height)))
|
transition.updateFrame(node: self.scrollNode, frame: CGRect(origin: CGPoint(), size: CGSize(width: size.width, height: size.height)))
|
||||||
@ -805,7 +806,7 @@ final class ChatListSearchMediaNode: ASDisplayNode, UIScrollViewDelegate {
|
|||||||
let availableWidth = size.width - sideInset * 2.0
|
let availableWidth = size.width - sideInset * 2.0
|
||||||
|
|
||||||
let itemsLayout: ItemsLayout
|
let itemsLayout: ItemsLayout
|
||||||
if let current = self.itemsLayout {
|
if let current = self.itemsLayout, previousParams?.size.width == size.width {
|
||||||
itemsLayout = current
|
itemsLayout = current
|
||||||
} else {
|
} else {
|
||||||
switch self.contentType {
|
switch self.contentType {
|
||||||
|
@ -1011,6 +1011,7 @@ final class PeerInfoVisualMediaPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScro
|
|||||||
}
|
}
|
||||||
|
|
||||||
func update(size: CGSize, sideInset: CGFloat, bottomInset: CGFloat, visibleHeight: CGFloat, isScrollingLockedAtTop: Bool, expandProgress: CGFloat, presentationData: PresentationData, synchronous: Bool, transition: ContainedViewLayoutTransition) {
|
func update(size: CGSize, sideInset: CGFloat, bottomInset: CGFloat, visibleHeight: CGFloat, isScrollingLockedAtTop: Bool, expandProgress: CGFloat, presentationData: PresentationData, synchronous: Bool, transition: ContainedViewLayoutTransition) {
|
||||||
|
let previousParams = self.currentParams
|
||||||
self.currentParams = (size, sideInset, bottomInset, visibleHeight, isScrollingLockedAtTop, expandProgress, presentationData)
|
self.currentParams = (size, sideInset, bottomInset, visibleHeight, isScrollingLockedAtTop, expandProgress, presentationData)
|
||||||
|
|
||||||
transition.updateFrame(node: self.scrollNode, frame: CGRect(origin: CGPoint(), size: size))
|
transition.updateFrame(node: self.scrollNode, frame: CGRect(origin: CGPoint(), size: size))
|
||||||
@ -1018,7 +1019,7 @@ final class PeerInfoVisualMediaPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScro
|
|||||||
let availableWidth = size.width - sideInset * 2.0
|
let availableWidth = size.width - sideInset * 2.0
|
||||||
|
|
||||||
let itemsLayout: ItemsLayout
|
let itemsLayout: ItemsLayout
|
||||||
if let current = self.itemsLayout {
|
if let current = self.itemsLayout, previousParams?.size.width == size.width {
|
||||||
itemsLayout = current
|
itemsLayout = current
|
||||||
} else {
|
} else {
|
||||||
switch self.contentType {
|
switch self.contentType {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user