mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Forward UI fixes
This commit is contained in:
parent
c7e558f3ac
commit
b3b2b83365
@ -6760,6 +6760,7 @@ Sorry for the inconvenience.";
|
|||||||
|
|
||||||
"Conversation.ForwardOptions.Text" = "What whould you like to do with %1$@ from %2$@?";
|
"Conversation.ForwardOptions.Text" = "What whould you like to do with %1$@ from %2$@?";
|
||||||
"Conversation.ForwardOptions.TextPersonal" = "What whould you like to do with %1$@ from your chat with %2$@?";
|
"Conversation.ForwardOptions.TextPersonal" = "What whould you like to do with %1$@ from your chat with %2$@?";
|
||||||
|
"Conversation.ForwardOptions.TextSaved" = "What whould you like to do with %1$@ from your Saved Messages?";
|
||||||
"Conversation.ForwardOptions.ShowOptions" = "Show Forwarding Options";
|
"Conversation.ForwardOptions.ShowOptions" = "Show Forwarding Options";
|
||||||
"Conversation.ForwardOptions.CancelForwarding" = "Cancel Forwarding";
|
"Conversation.ForwardOptions.CancelForwarding" = "Cancel Forwarding";
|
||||||
|
|
||||||
|
@ -710,6 +710,9 @@ final class CallListControllerNode: ASDisplayNode {
|
|||||||
self.emptyButtonTextNode.layer.animateAlpha(from: previousAlpha, to: alpha, duration: 0.25)
|
self.emptyButtonTextNode.layer.animateAlpha(from: previousAlpha, to: alpha, duration: 0.25)
|
||||||
self.emptyButtonNode.isUserInteractionEnabled = !isHidden
|
self.emptyButtonNode.isUserInteractionEnabled = !isHidden
|
||||||
|
|
||||||
|
self.listNode.alpha = 1.0 - alpha
|
||||||
|
self.listNode.layer.animateAlpha(from: 1.0 - previousAlpha, to: 1.0 - alpha, duration: 0.25)
|
||||||
|
|
||||||
if !isHidden {
|
if !isHidden {
|
||||||
let type = self.currentLocationAndType.scope
|
let type = self.currentLocationAndType.scope
|
||||||
let emptyText: String
|
let emptyText: String
|
||||||
|
@ -2124,7 +2124,7 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let startCallContacts = startCallContacts {
|
if let startCallContacts = startCallContacts {
|
||||||
let startCall: (PeerId) -> Void = { userId in
|
let startCall: (PeerId) -> Void = { peerId in
|
||||||
self.startCallWhenReady(accountId: nil, peerId: peerId, isVideo: isVideo)
|
self.startCallWhenReady(accountId: nil, peerId: peerId, isVideo: isVideo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6927,7 +6927,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
if (isPremium || maybeSuggestPremium) && !isHidden {
|
if (isPremium || maybeSuggestPremium) && !isHidden {
|
||||||
return chatTranslationState(context: context, peerId: peerId)
|
return chatTranslationState(context: context, peerId: peerId)
|
||||||
|> map { translationState -> ChatPresentationTranslationState? in
|
|> map { translationState -> ChatPresentationTranslationState? in
|
||||||
if let translationState, !translationState.fromLang.isEmpty {
|
if let translationState, !translationState.fromLang.isEmpty && (translationState.fromLang != baseLanguageCode || translationState.isEnabled) {
|
||||||
return ChatPresentationTranslationState(isEnabled: translationState.isEnabled, fromLang: translationState.fromLang, toLang: translationState.toLang ?? baseLanguageCode)
|
return ChatPresentationTranslationState(isEnabled: translationState.isEnabled, fromLang: translationState.fromLang, toLang: translationState.toLang ?? baseLanguageCode)
|
||||||
} else {
|
} else {
|
||||||
return nil
|
return nil
|
||||||
|
@ -1050,6 +1050,10 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let subject = item.associatedData.subject, case .forwardedMessages = subject {
|
||||||
|
needsShareButton = false
|
||||||
|
}
|
||||||
|
|
||||||
var isEmoji = false
|
var isEmoji = false
|
||||||
if let _ = telegramDice {
|
if let _ = telegramDice {
|
||||||
imageSize = displaySize
|
imageSize = displaySize
|
||||||
|
@ -1354,6 +1354,10 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let subject = item.associatedData.subject, case .forwardedMessages = subject {
|
||||||
|
needsShareButton = false
|
||||||
|
}
|
||||||
|
|
||||||
var tmpWidth: CGFloat
|
var tmpWidth: CGFloat
|
||||||
if allowFullWidth {
|
if allowFullWidth {
|
||||||
tmpWidth = baseWidth
|
tmpWidth = baseWidth
|
||||||
|
@ -362,6 +362,10 @@ class ChatMessageInstantVideoItemNode: ChatMessageItemView, UIGestureRecognizerD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let subject = item.associatedData.subject, case .forwardedMessages = subject {
|
||||||
|
needsShareButton = false
|
||||||
|
}
|
||||||
|
|
||||||
var layoutInsets = layoutConstants.instantVideo.insets
|
var layoutInsets = layoutConstants.instantVideo.insets
|
||||||
if dateHeaderAtBottom {
|
if dateHeaderAtBottom {
|
||||||
layoutInsets.top += layoutConstants.timestampHeaderHeight
|
layoutInsets.top += layoutConstants.timestampHeaderHeight
|
||||||
|
@ -513,6 +513,10 @@ class ChatMessageStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let subject = item.associatedData.subject, case .forwardedMessages = subject {
|
||||||
|
needsShareButton = false
|
||||||
|
}
|
||||||
|
|
||||||
var layoutInsets = UIEdgeInsets(top: mergedTop.merged ? layoutConstants.bubble.mergedSpacing : layoutConstants.bubble.defaultSpacing, left: 0.0, bottom: mergedBottom.merged ? layoutConstants.bubble.mergedSpacing : layoutConstants.bubble.defaultSpacing, right: 0.0)
|
var layoutInsets = UIEdgeInsets(top: mergedTop.merged ? layoutConstants.bubble.mergedSpacing : layoutConstants.bubble.defaultSpacing, left: 0.0, bottom: mergedBottom.merged ? layoutConstants.bubble.mergedSpacing : layoutConstants.bubble.defaultSpacing, right: 0.0)
|
||||||
if dateHeaderAtBottom {
|
if dateHeaderAtBottom {
|
||||||
layoutInsets.top += layoutConstants.timestampHeaderHeight
|
layoutInsets.top += layoutConstants.timestampHeaderHeight
|
||||||
|
@ -86,7 +86,7 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
let messageIds: [MessageId]
|
let messageIds: [MessageId]
|
||||||
private var messages: [Message] = []
|
private var messages: [Message] = []
|
||||||
private var authors: String?
|
private var authors: String?
|
||||||
private var sourcePeer: (isPersonal: Bool, displayTitle: String)?
|
private var sourcePeer: (peerId: PeerId, displayTitle: String)?
|
||||||
|
|
||||||
let closeButton: HighlightableButtonNode
|
let closeButton: HighlightableButtonNode
|
||||||
let lineNode: ASImageNode
|
let lineNode: ASImageNode
|
||||||
@ -172,7 +172,7 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
var uniquePeerIds = Set<PeerId>()
|
var uniquePeerIds = Set<PeerId>()
|
||||||
var title = ""
|
var title = ""
|
||||||
var text = NSMutableAttributedString(string: "")
|
var text = NSMutableAttributedString(string: "")
|
||||||
var sourcePeer: (Bool, String)?
|
var sourcePeer: (PeerId, String)?
|
||||||
for message in messages {
|
for message in messages {
|
||||||
if let author = message.forwardInfo?.author ?? message.effectiveAuthor, !uniquePeerIds.contains(author.id) {
|
if let author = message.forwardInfo?.author ?? message.effectiveAuthor, !uniquePeerIds.contains(author.id) {
|
||||||
uniquePeerIds.insert(author.id)
|
uniquePeerIds.insert(author.id)
|
||||||
@ -186,7 +186,7 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let peer = message.peers[message.id.peerId] {
|
if let peer = message.peers[message.id.peerId] {
|
||||||
sourcePeer = (peer.id.namespace == Namespaces.Peer.CloudUser, EnginePeer(peer).displayTitle(strings: strongSelf.strings, displayOrder: strongSelf.nameDisplayOrder))
|
sourcePeer = (peer.id, EnginePeer(peer).displayTitle(strings: strongSelf.strings, displayOrder: strongSelf.nameDisplayOrder))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,12 +361,19 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc func closePressed() {
|
@objc func closePressed() {
|
||||||
guard let (isPersonal, peerDisplayTitle) = self.sourcePeer else {
|
guard let (peerId, peerDisplayTitle) = self.sourcePeer else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let messageCount = Int32(self.messageIds.count)
|
let messageCount = Int32(self.messageIds.count)
|
||||||
let messages = self.strings.Conversation_ForwardOptions_Messages(messageCount)
|
let messages = self.strings.Conversation_ForwardOptions_Messages(messageCount)
|
||||||
let string = isPersonal ? self.strings.Conversation_ForwardOptions_TextPersonal(messages, peerDisplayTitle) : self.strings.Conversation_ForwardOptions_Text(messages, peerDisplayTitle)
|
let string: PresentationStrings.FormattedString
|
||||||
|
if peerId == self.context.account.peerId {
|
||||||
|
string = self.strings.Conversation_ForwardOptions_TextSaved(messages)
|
||||||
|
} else if peerId.namespace == Namespaces.Peer.CloudUser {
|
||||||
|
string = self.strings.Conversation_ForwardOptions_TextPersonal(messages, peerDisplayTitle)
|
||||||
|
} else {
|
||||||
|
string = self.strings.Conversation_ForwardOptions_Text(messages, peerDisplayTitle)
|
||||||
|
}
|
||||||
|
|
||||||
let font = Font.regular(floor(self.fontSize.baseDisplaySize * 15.0 / 17.0))
|
let font = Font.regular(floor(self.fontSize.baseDisplaySize * 15.0 / 17.0))
|
||||||
let boldFont = Font.semibold(floor(self.fontSize.baseDisplaySize * 15.0 / 17.0))
|
let boldFont = Font.semibold(floor(self.fontSize.baseDisplaySize * 15.0 / 17.0))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user