mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 08:31:13 +00:00
Voice Chat UI fixes
This commit is contained in:
parent
afc64e092c
commit
5867099883
@ -1013,7 +1013,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
|||||||
completeHeight = max(completeHeight, self.visibleSize.height + keepMinimalScrollHeightWithTopInset - effectiveInsets.bottom - effectiveInsets.top)
|
completeHeight = max(completeHeight, self.visibleSize.height + keepMinimalScrollHeightWithTopInset - effectiveInsets.bottom - effectiveInsets.top)
|
||||||
bottomItemEdge = max(bottomItemEdge, topItemEdge + completeHeight)
|
bottomItemEdge = max(bottomItemEdge, topItemEdge + completeHeight)
|
||||||
} else {
|
} else {
|
||||||
effectiveInsets.top = self.visibleSize.height - completeHeight
|
effectiveInsets.top = max(effectiveInsets.top, self.visibleSize.height - completeHeight)
|
||||||
completeHeight = max(completeHeight, self.visibleSize.height)
|
completeHeight = max(completeHeight, self.visibleSize.height)
|
||||||
bottomItemEdge = max(bottomItemEdge, topItemEdge + completeHeight)
|
bottomItemEdge = max(bottomItemEdge, topItemEdge + completeHeight)
|
||||||
}
|
}
|
||||||
|
@ -200,6 +200,8 @@ public class CallStatusBarNodeImpl: CallStatusBarNode {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let wasEmpty = (self.titleNode.attributedText?.string ?? "").isEmpty
|
||||||
|
|
||||||
if !self.didSetupData {
|
if !self.didSetupData {
|
||||||
switch content {
|
switch content {
|
||||||
case let .call(sharedContext, account, call):
|
case let .call(sharedContext, account, call):
|
||||||
@ -340,11 +342,13 @@ public class CallStatusBarNodeImpl: CallStatusBarNode {
|
|||||||
let contentHeight: CGFloat = 24.0
|
let contentHeight: CGFloat = 24.0
|
||||||
let verticalOrigin: CGFloat = size.height - contentHeight
|
let verticalOrigin: CGFloat = size.height - contentHeight
|
||||||
|
|
||||||
self.microphoneNode.frame = CGRect(origin: CGPoint(x: horizontalOrigin, y: verticalOrigin + floor((contentHeight - animationSize) / 2.0)), size: CGSize(width: animationSize, height: animationSize))
|
let transition: ContainedViewLayoutTransition = wasEmpty ? .immediate : .animated(duration: 0.2, curve: .easeInOut)
|
||||||
|
|
||||||
|
transition.updateFrame(node: self.microphoneNode, frame: CGRect(origin: CGPoint(x: horizontalOrigin, y: verticalOrigin + floor((contentHeight - animationSize) / 2.0)), size: CGSize(width: animationSize, height: animationSize)))
|
||||||
self.microphoneNode.update(state: VoiceChatMicrophoneNode.State(muted: self.currentIsMuted, color: UIColor.white), animated: true)
|
self.microphoneNode.update(state: VoiceChatMicrophoneNode.State(muted: self.currentIsMuted, color: UIColor.white), animated: true)
|
||||||
|
|
||||||
self.titleNode.frame = CGRect(origin: CGPoint(x: horizontalOrigin + animationSize + iconSpacing, y: verticalOrigin + floor((contentHeight - titleSize.height) / 2.0)), size: titleSize)
|
transition.updateFrame(node: self.titleNode, frame: CGRect(origin: CGPoint(x: horizontalOrigin + animationSize + iconSpacing, y: verticalOrigin + floor((contentHeight - titleSize.height) / 2.0)), size: titleSize))
|
||||||
self.subtitleNode.frame = CGRect(origin: CGPoint(x: horizontalOrigin + animationSize + iconSpacing + titleSize.width + spacing, y: verticalOrigin + floor((contentHeight - subtitleSize.height) / 2.0)), size: subtitleSize)
|
transition.updateFrame(node: self.subtitleNode, frame: CGRect(origin: CGPoint(x: horizontalOrigin + animationSize + iconSpacing + titleSize.width + spacing, y: verticalOrigin + floor((contentHeight - subtitleSize.height) / 2.0)), size: subtitleSize))
|
||||||
|
|
||||||
self.backgroundNode.speaking = self.currentIsConnected && !self.currentIsMuted
|
self.backgroundNode.speaking = self.currentIsConnected && !self.currentIsMuted
|
||||||
self.backgroundNode.frame = CGRect(origin: CGPoint(), size: CGSize(width: size.width, height: size.height + 18.0))
|
self.backgroundNode.frame = CGRect(origin: CGPoint(), size: CGSize(width: size.width, height: size.height + 18.0))
|
||||||
|
@ -1248,7 +1248,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
let previousLeftBorderFrame = self.leftBorderNode.frame
|
let previousLeftBorderFrame = self.leftBorderNode.frame
|
||||||
let previousRightBorderFrame = self.rightBorderNode.frame
|
let previousRightBorderFrame = self.rightBorderNode.frame
|
||||||
|
|
||||||
self.updateColors(fullscreen: panelOffset == layoutTopInset)
|
self.updateColors(fullscreen: abs(panelOffset - layoutTopInset) < 1.0)
|
||||||
|
|
||||||
if !backgroundFrame.equalTo(previousBackgroundFrame) {
|
if !backgroundFrame.equalTo(previousBackgroundFrame) {
|
||||||
self.backgroundNode.frame = backgroundFrame
|
self.backgroundNode.frame = backgroundFrame
|
||||||
|
Loading…
x
Reference in New Issue
Block a user