Merge branch 'beta'

This commit is contained in:
Peter
2019-09-07 21:50:32 +04:00
2 changed files with 16 additions and 4 deletions

View File

@@ -119,7 +119,11 @@ final class GlobalOverlayPresentationContext {
}
}
if let presentationView = self.currentPresentationView(underStatusBar: underStatusBar), let initialLayout = self.layout {
controller.view.frame = CGRect(origin: CGPoint(x: presentationView.bounds.width - initialLayout.size.width, y: 0.0), size: initialLayout.size)
if initialLayout.metrics.widthClass == .regular {
controller.view.frame = CGRect(origin: CGPoint(x: presentationView.bounds.width - initialLayout.size.width, y: 0.0), size: initialLayout.size)
} else {
controller.view.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: initialLayout.size)
}
controller.containerLayoutUpdated(initialLayout, transition: .immediate)
self.presentationDisposables.add(controllerReady.start(next: { [weak self] _ in
@@ -137,7 +141,11 @@ final class GlobalOverlayPresentationContext {
}, rootController: nil)
(controller as? UIViewController)?.setIgnoreAppearanceMethodInvocations(true)
if layout != initialLayout {
controller.view.frame = CGRect(origin: CGPoint(x: view.bounds.width - layout.size.width, y: 0.0), size: layout.size)
if layout.metrics.widthClass == .regular {
controller.view.frame = CGRect(origin: CGPoint(x: view.bounds.width - layout.size.width, y: 0.0), size: layout.size)
} else {
controller.view.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: layout.size)
}
view.addSubview(controller.view)
controller.containerLayoutUpdated(layout, transition: .immediate)
} else {
@@ -204,7 +212,11 @@ final class GlobalOverlayPresentationContext {
}
view.addSubview(controller.view)
if !justMove {
controller.view.frame = CGRect(origin: CGPoint(x: view.bounds.width - layout.size.width, y: 0.0), size: layout.size)
if layout.metrics.widthClass == .regular {
controller.view.frame = CGRect(origin: CGPoint(x: view.bounds.width - layout.size.width, y: 0.0), size: layout.size)
} else {
controller.view.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: layout.size)
}
controller.containerLayoutUpdated(layout, transition: .immediate)
controller.viewDidAppear(false)
}

View File

@@ -370,7 +370,7 @@ public final class ChatMessageItem: ListViewItem, CustomStringConvertible {
loop: for media in self.message.media {
if let telegramFile = media as? TelegramMediaFile {
if telegramFile.isAnimatedSticker, !telegramFile.previewRepresentations.isEmpty, let size = telegramFile.size, size > 0 && size <= 128 * 1024 {
if telegramFile.isAnimatedSticker, (self.message.id.peerId.namespace == Namespaces.Peer.SecretChat || !telegramFile.previewRepresentations.isEmpty), let size = telegramFile.size, size > 0 && size <= 128 * 1024 {
if self.message.id.peerId.namespace == Namespaces.Peer.SecretChat {
if telegramFile.fileId.namespace == Namespaces.Media.CloudFile {
viewClassName = ChatMessageAnimatedStickerItemNode.self