mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
fce36108da
2 changed files with 10 additions and 2 deletions
|
|
@ -408,7 +408,7 @@ public extension ContainedViewLayoutTransition {
|
|||
}
|
||||
}
|
||||
|
||||
func updateBounds(layer: CALayer, bounds: CGRect, force: Bool = false, completion: ((Bool) -> Void)? = nil) {
|
||||
func updateBounds(layer: CALayer, bounds: CGRect, beginWithCurrentState: Bool = false, force: Bool = false, completion: ((Bool) -> Void)? = nil) {
|
||||
if layer.bounds.equalTo(bounds) && !force {
|
||||
completion?(true)
|
||||
} else {
|
||||
|
|
@ -420,7 +420,12 @@ public extension ContainedViewLayoutTransition {
|
|||
completion(true)
|
||||
}
|
||||
case let .animated(duration, curve):
|
||||
let previousBounds = layer.bounds
|
||||
let previousBounds: CGRect
|
||||
if beginWithCurrentState, layer.animation(forKey: "position") != nil, let presentation = layer.presentation() {
|
||||
previousBounds = presentation.bounds
|
||||
} else {
|
||||
previousBounds = layer.bounds
|
||||
}
|
||||
layer.bounds = bounds
|
||||
layer.animateBounds(from: previousBounds, to: bounds, duration: duration, timingFunction: curve.timingFunction, mediaTimingFunction: curve.mediaTimingFunction, force: force, completion: { result in
|
||||
if let completion = completion {
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ public protocol ListView: ASDisplayNode {
|
|||
additionalScrollDistance: CGFloat,
|
||||
updateSizeAndInsets: ListViewUpdateSizeAndInsets?,
|
||||
stationaryItemRange: (Int, Int)?,
|
||||
customAnimationTransition: ControlledTransition?,
|
||||
updateOpaqueState: Any?,
|
||||
completion: @escaping (ListViewDisplayedItemRange) -> Void
|
||||
)
|
||||
|
|
@ -102,6 +103,7 @@ public extension ListView {
|
|||
additionalScrollDistance: CGFloat = 0.0,
|
||||
updateSizeAndInsets: ListViewUpdateSizeAndInsets? = nil,
|
||||
stationaryItemRange: (Int, Int)? = nil,
|
||||
customAnimationTransition: ControlledTransition? = nil,
|
||||
updateOpaqueState: Any?,
|
||||
completion: @escaping (ListViewDisplayedItemRange) -> Void = { _ in }
|
||||
) {
|
||||
|
|
@ -114,6 +116,7 @@ public extension ListView {
|
|||
additionalScrollDistance: additionalScrollDistance,
|
||||
updateSizeAndInsets: updateSizeAndInsets,
|
||||
stationaryItemRange: stationaryItemRange,
|
||||
customAnimationTransition: customAnimationTransition,
|
||||
updateOpaqueState: updateOpaqueState,
|
||||
completion: completion
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue