mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix chat bubble media badge layout
This commit is contained in:
parent
7235006321
commit
b6d84038f1
@ -188,7 +188,7 @@ public final class ChatMessageInteractiveMediaBadge: ASDisplayNode {
|
||||
transition.updateAlpha(node: statusNode, alpha: active ? 1.0 : 0.0)
|
||||
}
|
||||
|
||||
let durationFrame = CGRect(x: active ? 42.0 : 7.0, y: active ? 6.0 : 3.0, width: durationSize.width, height: durationSize.height)
|
||||
let durationFrame = CGRect(x: active ? 42.0 : 7.0, y: active ? 6.0 : 2.0 + UIScreenPixel, width: durationSize.width, height: durationSize.height)
|
||||
self.durationNode.bounds = CGRect(origin: CGPoint(), size: durationFrame.size)
|
||||
textTransition.updatePosition(node: self.durationNode, position: durationFrame.center)
|
||||
|
||||
|
@ -1096,10 +1096,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio
|
||||
if wideLayout {
|
||||
if let size = file.size {
|
||||
let sizeString = "\(dataSizeString(Int(Float(size) * progress), forceDecimal: true, formatting: formatting)) / \(dataSizeString(size, forceDecimal: true, formatting: formatting))"
|
||||
if file.isAnimated {
|
||||
badgeContent = .mediaDownload(backgroundColor: messageTheme.mediaDateAndStatusFillColor, foregroundColor: messageTheme.mediaDateAndStatusTextColor, duration: "\(gifTitle)", size: nil, muted: false, active: false)
|
||||
}
|
||||
else if let duration = file.duration, !message.flags.contains(.Unsent) {
|
||||
if let duration = file.duration, !message.flags.contains(.Unsent) {
|
||||
let durationString = file.isAnimated ? gifTitle : stringForDuration(playerDuration > 0 ? playerDuration : duration, position: playerPosition)
|
||||
if isMediaStreamable(message: message, media: file) {
|
||||
badgeContent = .mediaDownload(backgroundColor: messageTheme.mediaDateAndStatusFillColor, foregroundColor: messageTheme.mediaDateAndStatusTextColor, duration: durationString, size: active ? sizeString : nil, muted: muted, active: active)
|
||||
@ -1207,7 +1204,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio
|
||||
case .Remote:
|
||||
state = .download(messageTheme.mediaOverlayControlColors.foregroundColor)
|
||||
if let file = self.media as? TelegramMediaFile {
|
||||
if file.isAnimated && (!automaticDownload || !automaticPlayback) {
|
||||
if false, file.isAnimated && (!automaticDownload || !automaticPlayback) {
|
||||
let string = "\(gifTitle) " + dataSizeString(file.size ?? 0, formatting: formatting)
|
||||
badgeContent = .mediaDownload(backgroundColor: messageTheme.mediaDateAndStatusFillColor, foregroundColor: messageTheme.mediaDateAndStatusTextColor, duration: string, size: nil, muted: false, active: false)
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user