mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Voice Chat UI fixes
This commit is contained in:
parent
df5e9c7cd3
commit
d94f541205
@ -2278,6 +2278,19 @@ Unused sets are archived when you add more.";
|
||||
"Call.Minutes_any" = "%@ minutes";
|
||||
"Call.Minutes_many" = "%@ minutes";
|
||||
"Call.Minutes_0" = "%@ minutes";
|
||||
"Call.Hours_1" = "%@ hour";
|
||||
"Call.Hours_2" = "%@ hours";
|
||||
"Call.Hours_3_10" = "%@ hours";
|
||||
"Call.Hours_any" = "%@ hours";
|
||||
"Call.Hours_many" = "%@ hours";
|
||||
"Call.Hours_0" = "%@ hours";
|
||||
"Call.Days_1" = "%@ day";
|
||||
"Call.Days_2" = "%@ days";
|
||||
"Call.Days_3_10" = "%@ days";
|
||||
"Call.Days_any" = "%@ days";
|
||||
"Call.Days_many" = "%@ days";
|
||||
"Call.Days_0" = "%@ days";
|
||||
|
||||
|
||||
"Call.ShortSeconds_1" = "%@ sec";
|
||||
"Call.ShortSeconds_2" = "%@ sec";
|
||||
@ -5938,3 +5951,20 @@ Sorry for the inconvenience.";
|
||||
"Notification.VoiceChatInvitation" = "%1$@ invited %2$@ to the voice chat";
|
||||
"Notification.VoiceChatInvitationByYou" = "You invited %1$@ to the voice chat";
|
||||
"Notification.VoiceChatInvitationForYou" = "%1$@ invited you to the voice chat";
|
||||
|
||||
"Notification.VoiceChatStarted" = "Voice chat started";
|
||||
"Notification.VoiceChatEnded" = "Voice chat ended (%@)";
|
||||
|
||||
"VoiceChat.Panel.TapToJoin" = "Tap to join";
|
||||
"VoiceChat.Panel.Members_0" = "%@ members";
|
||||
"VoiceChat.Panel.Members_1" = "%@ member";
|
||||
"VoiceChat.Panel.Members_2" = "%@ members";
|
||||
"VoiceChat.Panel.Members_3_10" = "%@ members";
|
||||
"VoiceChat.Panel.Members_many" = "%@ members";
|
||||
"VoiceChat.Panel.Members_any" = "%@ members";
|
||||
"VoiceChat.Panel.MembersSpeaking_0" = "%@ members speaking";
|
||||
"VoiceChat.Panel.MembersSpeaking_1" = "%@ member speaking";
|
||||
"VoiceChat.Panel.MembersSpeaking_2" = "%@ members speaking";
|
||||
"VoiceChat.Panel.MembersSpeaking_3_10" = "%@ members speaking";
|
||||
"VoiceChat.Panel.MembersSpeaking_many" = "%@ members speaking";
|
||||
"VoiceChat.Panel.MembersSpeaking_any" = "%@ members speaking";
|
||||
|
@ -231,9 +231,9 @@ public final class GroupCallNavigationAccessoryPanel: ASDisplayNode {
|
||||
if previousData?.groupCall !== data.groupCall {
|
||||
let membersText: String
|
||||
if data.participantCount == 0 {
|
||||
membersText = self.strings.PeopleNearby_NoMembers
|
||||
membersText = self.strings.VoiceChat_Panel_TapToJoin
|
||||
} else {
|
||||
membersText = self.strings.Conversation_StatusMembers(Int32(data.participantCount))
|
||||
membersText = self.strings.VoiceChat_Panel_Members(Int32(data.participantCount))
|
||||
}
|
||||
|
||||
self.avatarsContent = self.avatarsContext.update(peers: data.topParticipants.map { $0.peer }, animated: false)
|
||||
@ -253,18 +253,13 @@ public final class GroupCallNavigationAccessoryPanel: ASDisplayNode {
|
||||
let membersText: String
|
||||
let membersTextIsActive: Bool
|
||||
if summaryState.numberOfActiveSpeakers != 0 {
|
||||
//TODO:localize
|
||||
if summaryState.numberOfActiveSpeakers == 1 {
|
||||
membersText = "1 member speaking"
|
||||
} else {
|
||||
membersText = "\(summaryState.numberOfActiveSpeakers) members speaking"
|
||||
}
|
||||
membersText = strongSelf.strings.VoiceChat_Panel_MembersSpeaking(Int32(summaryState.numberOfActiveSpeakers))
|
||||
membersTextIsActive = true
|
||||
} else {
|
||||
if summaryState.participantCount == 0 {
|
||||
membersText = strongSelf.strings.PeopleNearby_NoMembers
|
||||
membersText = strongSelf.strings.VoiceChat_Panel_TapToJoin
|
||||
} else {
|
||||
membersText = strongSelf.strings.Conversation_StatusMembers(Int32(summaryState.participantCount))
|
||||
membersText = strongSelf.strings.VoiceChat_Panel_Members(Int32(summaryState.participantCount))
|
||||
}
|
||||
membersTextIsActive = false
|
||||
}
|
||||
@ -290,18 +285,13 @@ public final class GroupCallNavigationAccessoryPanel: ASDisplayNode {
|
||||
let membersText: String
|
||||
let membersTextIsActive: Bool
|
||||
if data.numberOfActiveSpeakers != 0 {
|
||||
//TODO:localize
|
||||
if data.numberOfActiveSpeakers == 1 {
|
||||
membersText = "1 member speaking"
|
||||
} else {
|
||||
membersText = "\(data.numberOfActiveSpeakers) members speaking"
|
||||
}
|
||||
membersText = self.strings.VoiceChat_Panel_MembersSpeaking(Int32(data.numberOfActiveSpeakers))
|
||||
membersTextIsActive = true
|
||||
} else {
|
||||
if data.participantCount == 0 {
|
||||
membersText = self.strings.PeopleNearby_NoMembers
|
||||
membersText = self.strings.VoiceChat_Panel_TapToJoin
|
||||
} else {
|
||||
membersText = self.strings.Conversation_StatusMembers(Int32(data.participantCount))
|
||||
membersText = self.strings.VoiceChat_Panel_Members(Int32(data.participantCount))
|
||||
}
|
||||
membersTextIsActive = false
|
||||
}
|
||||
|
@ -694,7 +694,7 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
self?._canBeRemoved.set(.single(true))
|
||||
}))
|
||||
}
|
||||
} else if case .requesting = self.internalState {
|
||||
} else if case .requesting = self.internalState {
|
||||
self.callContext?.stop()
|
||||
self.callContext = nil
|
||||
self.requestDisposable.set(nil)
|
||||
|
@ -88,7 +88,11 @@ public func unmuteIntervalString(strings: PresentationStrings, value: Int32) ->
|
||||
public func callDurationString(strings: PresentationStrings, value: Int32) -> String {
|
||||
if value < 60 {
|
||||
return strings.Call_Seconds(max(1, value))
|
||||
} else {
|
||||
} else if value < 60 * 60 {
|
||||
return strings.Call_Minutes(max(1, value / 60))
|
||||
} else if value < 60 * 60 * 24 {
|
||||
return strings.Call_Hours(max(1, value / (60 * 60)))
|
||||
} else {
|
||||
return strings.Call_Days(max(1, value / (60 * 60 * 24)))
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -405,12 +405,11 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
|
||||
}
|
||||
attributedString = NSAttributedString(string: titleString, font: titleFont, textColor: primaryTextColor)
|
||||
case let .groupPhoneCall(_, _, duration):
|
||||
//TODO:localize
|
||||
let titleString: String
|
||||
if let duration = duration {
|
||||
titleString = "Voice chat ended (\(duration)s)"
|
||||
titleString = strings.Notification_VoiceChatEnded(callDurationString(strings: strings, value: duration)).0
|
||||
} else {
|
||||
titleString = "Voice chat started"
|
||||
titleString = strings.Notification_VoiceChatStarted
|
||||
}
|
||||
attributedString = NSAttributedString(string: titleString, font: titleFont, textColor: primaryTextColor)
|
||||
case let .customText(text, entities):
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user