mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Voice Chat UI improvements
This commit is contained in:
parent
954768fb00
commit
0dbabb2db1
@ -422,7 +422,7 @@ open class ListViewItemNode: ASDisplayNode, AccessibilityFocusableNode {
|
||||
}
|
||||
|
||||
public func addInsetsAnimationToValue(_ value: UIEdgeInsets, duration: Double, beginAt: Double) {
|
||||
let animation = ListViewAnimation(from: self.insets, to: value, duration: duration, curve: listViewAnimationCurveSystem, beginAt: beginAt, update: { [weak self] _, currentValue in
|
||||
let animation = ListViewAnimation(from: self.insets, to: value, duration: duration, curve: self.preferredAnimationCurve, beginAt: beginAt, update: { [weak self] _, currentValue in
|
||||
if let strongSelf = self {
|
||||
strongSelf.insets = currentValue
|
||||
}
|
||||
@ -483,7 +483,7 @@ open class ListViewItemNode: ASDisplayNode, AccessibilityFocusableNode {
|
||||
duration = 0.0
|
||||
}
|
||||
|
||||
let animation = ListViewAnimation(from: self.apparentHeight, to: value, duration: duration, curve: listViewAnimationCurveSystem, beginAt: beginAt, update: { [weak self] _, currentValue in
|
||||
let animation = ListViewAnimation(from: self.apparentHeight, to: value, duration: duration, curve: self.preferredAnimationCurve, beginAt: beginAt, update: { [weak self] _, currentValue in
|
||||
if let strongSelf = self {
|
||||
strongSelf.apparentHeight = currentValue
|
||||
}
|
||||
|
@ -257,8 +257,4 @@ class VoiceChatActionItemNode: ListViewItemNode {
|
||||
override public func header() -> ListViewItemHeader? {
|
||||
return nil
|
||||
}
|
||||
|
||||
override var preferredAnimationCurve: (CGFloat) -> CGFloat {
|
||||
return listViewAnimationCurveEaseInOut
|
||||
}
|
||||
}
|
||||
|
@ -942,9 +942,9 @@ public final class VoiceChatController: ViewController {
|
||||
self.call.members,
|
||||
invitedPeers
|
||||
)
|
||||
|> mapToSignal { values in
|
||||
|> mapToThrottled { values in
|
||||
return .single(values)
|
||||
|> delay(0.0, queue: .mainQueue())
|
||||
|> then(.complete() |> delay(0.1, queue: Queue.mainQueue()))
|
||||
}).start(next: { [weak self] state, callMembers, invitedPeers in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
@ -1850,8 +1850,6 @@ public final class VoiceChatController: ViewController {
|
||||
}
|
||||
|
||||
let topPanelFrame = self.topPanelNode.view.convert(self.topPanelNode.bounds, to: self.view)
|
||||
let offset: CGFloat = self.contentContainer.bounds.minY
|
||||
|
||||
self.contentContainer.layer.animateBoundsOriginYAdditive(from: self.contentContainer.bounds.origin.y, to: -(layout.size.height - topPanelFrame.minY) - 44.0, duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring, removeOnCompletion: false, completion: { _ in
|
||||
offsetCompleted = true
|
||||
internalCompletion()
|
||||
@ -1885,7 +1883,7 @@ public final class VoiceChatController: ViewController {
|
||||
if transition.crossFade {
|
||||
options.insert(.AnimateCrossfade)
|
||||
}
|
||||
if transition.animated {
|
||||
if transition.animated && self.animation == nil {
|
||||
options.insert(.AnimateInsertion)
|
||||
}
|
||||
}
|
||||
@ -1921,7 +1919,7 @@ public final class VoiceChatController: ViewController {
|
||||
self.listNode.frame = frame
|
||||
} else if !self.isExpanded {
|
||||
if self.listNode.frame.minY != targetY && !self.animatingExpansion && self.panGestureArguments == nil {
|
||||
self.animation = ListViewAnimation(from: self.listNode.frame.minY, to: targetY, duration: 0.4, curve: listViewAnimationCurveEaseInOut, beginAt: CACurrentMediaTime(), update: { [weak self] _, currentValue in
|
||||
self.animation = ListViewAnimation(from: self.listNode.frame.minY, to: targetY, duration: 0.4, curve: listViewAnimationCurveSystem, beginAt: CACurrentMediaTime(), update: { [weak self] _, currentValue in
|
||||
if let strongSelf = self {
|
||||
var frame = strongSelf.listNode.frame
|
||||
frame.origin.y = currentValue
|
||||
@ -2193,16 +2191,16 @@ public final class VoiceChatController: ViewController {
|
||||
self.controller?.dismiss(closing: false, manual: true)
|
||||
dismissing = true
|
||||
} else if velocity.y < -300.0 || offset < topInset / 2.0 {
|
||||
self.isExpanded = true
|
||||
self.updateIsFullscreen(true)
|
||||
self.animatingExpansion = true
|
||||
|
||||
if velocity.y > -1500.0 {
|
||||
if velocity.y > -1500.0 && !self.isFullscreen {
|
||||
DispatchQueue.main.async {
|
||||
self.listNode.transaction(deleteIndices: [], insertIndicesAndItems: [], updateIndicesAndItems: [], options: [.Synchronous, .LowLatency], scrollToItem: ListViewScrollToItem(index: 0, position: .top(0.0), animated: true, curve: .Default(duration: nil), directionHint: .Up), updateSizeAndInsets: nil, stationaryItemRange: nil, updateOpaqueState: nil, completion: { _ in })
|
||||
}
|
||||
}
|
||||
|
||||
self.isExpanded = true
|
||||
self.updateIsFullscreen(true)
|
||||
self.animatingExpansion = true
|
||||
|
||||
if let (layout, navigationHeight) = self.validLayout {
|
||||
self.containerLayoutUpdated(layout, navigationHeight: navigationHeight, transition: .animated(duration: 0.3, curve: .easeInOut))
|
||||
}
|
||||
|
@ -787,8 +787,4 @@ class VoiceChatParticipantItemNode: ItemListRevealOptionsItemNode {
|
||||
self.setRevealOptionsOpened(false, animated: true)
|
||||
self.revealOptionsInteractivelyClosed()
|
||||
}
|
||||
|
||||
override var preferredAnimationCurve: (CGFloat) -> CGFloat {
|
||||
return listViewAnimationCurveEaseInOut
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user