mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 18:12:44 +02:00
Adapt string changes & new icons
This commit is contained in:
+26
-16
@@ -57,6 +57,7 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
private var viewState: ViewState = .unknown {
|
private var viewState: ViewState = .unknown {
|
||||||
didSet {
|
didSet {
|
||||||
updateBottomContentView()
|
updateBottomContentView()
|
||||||
|
updateCallIcon()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,11 +79,24 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
return formatter
|
return formatter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func updateCallIcon() {
|
||||||
|
switch viewState {
|
||||||
|
case .missed:
|
||||||
|
innerContentView.callIconView.image = isVideoCall ?
|
||||||
|
Asset.Images.callMissedVideo.image :
|
||||||
|
Asset.Images.callMissedVoice.image
|
||||||
|
default:
|
||||||
|
innerContentView.callIconView.image = isVideoCall ?
|
||||||
|
Asset.Images.callVideoIcon.image :
|
||||||
|
Asset.Images.voiceCallHangonIcon.image
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private func updateBottomContentView() {
|
private func updateBottomContentView() {
|
||||||
bottomContentView = bottomView(for: viewState)
|
bottomContentView = bottomView(for: viewState)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var callTypeIcon: UIImage {
|
private var callButtonIcon: UIImage {
|
||||||
if isVideoCall {
|
if isVideoCall {
|
||||||
return Asset.Images.callVideoIcon.image
|
return Asset.Images.callVideoIcon.image
|
||||||
} else {
|
} else {
|
||||||
@@ -112,7 +126,7 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
|
|
||||||
view.secondButton.style = .positive
|
view.secondButton.style = .positive
|
||||||
view.secondButton.setTitle(VectorL10n.eventFormatterCallAnswer, for: .normal)
|
view.secondButton.setTitle(VectorL10n.eventFormatterCallAnswer, for: .normal)
|
||||||
view.secondButton.setImage(callTypeIcon, for: .normal)
|
view.secondButton.setImage(callButtonIcon, for: .normal)
|
||||||
view.secondButton.removeTarget(nil, action: nil, for: .touchUpInside)
|
view.secondButton.removeTarget(nil, action: nil, for: .touchUpInside)
|
||||||
view.secondButton.addTarget(self, action: #selector(answerCallAction(_:)), for: .touchUpInside)
|
view.secondButton.addTarget(self, action: #selector(answerCallAction(_:)), for: .touchUpInside)
|
||||||
|
|
||||||
@@ -134,7 +148,7 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
|
|
||||||
view.firstButton.style = .positive
|
view.firstButton.style = .positive
|
||||||
view.firstButton.setTitle(VectorL10n.eventFormatterCallBack, for: .normal)
|
view.firstButton.setTitle(VectorL10n.eventFormatterCallBack, for: .normal)
|
||||||
view.firstButton.setImage(callTypeIcon, for: .normal)
|
view.firstButton.setImage(callButtonIcon, for: .normal)
|
||||||
view.firstButton.removeTarget(nil, action: nil, for: .touchUpInside)
|
view.firstButton.removeTarget(nil, action: nil, for: .touchUpInside)
|
||||||
view.firstButton.addTarget(self, action: #selector(callBackAction(_:)), for: .touchUpInside)
|
view.firstButton.addTarget(self, action: #selector(callBackAction(_:)), for: .touchUpInside)
|
||||||
|
|
||||||
@@ -145,7 +159,7 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
|
|
||||||
view.firstButton.style = .positive
|
view.firstButton.style = .positive
|
||||||
view.firstButton.setTitle(VectorL10n.eventFormatterCallBack, for: .normal)
|
view.firstButton.setTitle(VectorL10n.eventFormatterCallBack, for: .normal)
|
||||||
view.firstButton.setImage(callTypeIcon, for: .normal)
|
view.firstButton.setImage(callButtonIcon, for: .normal)
|
||||||
view.firstButton.removeTarget(nil, action: nil, for: .touchUpInside)
|
view.firstButton.removeTarget(nil, action: nil, for: .touchUpInside)
|
||||||
view.firstButton.addTarget(self, action: #selector(callBackAction(_:)), for: .touchUpInside)
|
view.firstButton.addTarget(self, action: #selector(callBackAction(_:)), for: .touchUpInside)
|
||||||
|
|
||||||
@@ -158,7 +172,7 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
|
|
||||||
view.firstButton.style = .positive
|
view.firstButton.style = .positive
|
||||||
view.firstButton.setTitle(VectorL10n.eventFormatterCallRetry, for: .normal)
|
view.firstButton.setTitle(VectorL10n.eventFormatterCallRetry, for: .normal)
|
||||||
view.firstButton.setImage(callTypeIcon, for: .normal)
|
view.firstButton.setImage(callButtonIcon, for: .normal)
|
||||||
view.firstButton.removeTarget(nil, action: nil, for: .touchUpInside)
|
view.firstButton.removeTarget(nil, action: nil, for: .touchUpInside)
|
||||||
view.firstButton.addTarget(self, action: #selector(callBackAction(_:)), for: .touchUpInside)
|
view.firstButton.addTarget(self, action: #selector(callBackAction(_:)), for: .touchUpInside)
|
||||||
|
|
||||||
@@ -174,13 +188,13 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
.connecting:
|
.connecting:
|
||||||
viewState = .active
|
viewState = .active
|
||||||
if call.isIncoming {
|
if call.isIncoming {
|
||||||
statusText = VectorL10n.eventFormatterCallYouCurrentlyIn
|
statusText = isVideoCall ? VectorL10n.eventFormatterCallActiveVideo : VectorL10n.eventFormatterCallActiveVoice
|
||||||
} else {
|
} else {
|
||||||
statusText = VectorL10n.eventFormatterCallConnecting
|
statusText = VectorL10n.eventFormatterCallConnecting
|
||||||
}
|
}
|
||||||
case .inviteSent:
|
case .inviteSent:
|
||||||
if call.isIncoming {
|
if call.isIncoming {
|
||||||
statusText = VectorL10n.eventFormatterCallYouCurrentlyIn
|
statusText = isVideoCall ? VectorL10n.eventFormatterCallActiveVideo : VectorL10n.eventFormatterCallActiveVoice
|
||||||
} else {
|
} else {
|
||||||
statusText = VectorL10n.eventFormatterCallRinging
|
statusText = VectorL10n.eventFormatterCallRinging
|
||||||
}
|
}
|
||||||
@@ -189,14 +203,14 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
.onHold,
|
.onHold,
|
||||||
.remotelyOnHold:
|
.remotelyOnHold:
|
||||||
viewState = .active
|
viewState = .active
|
||||||
statusText = VectorL10n.eventFormatterCallYouCurrentlyIn
|
statusText = isVideoCall ? VectorL10n.eventFormatterCallActiveVideo : VectorL10n.eventFormatterCallActiveVoice
|
||||||
case .ringing:
|
case .ringing:
|
||||||
if call.isIncoming {
|
if call.isIncoming {
|
||||||
viewState = .ringing
|
viewState = .ringing
|
||||||
statusText = nil
|
statusText = nil
|
||||||
} else {
|
} else {
|
||||||
viewState = .active
|
viewState = .active
|
||||||
statusText = VectorL10n.eventFormatterCallYouCurrentlyIn
|
statusText = isVideoCall ? VectorL10n.eventFormatterCallActiveVideo : VectorL10n.eventFormatterCallActiveVoice
|
||||||
}
|
}
|
||||||
case .ended:
|
case .ended:
|
||||||
switch call.endReason {
|
switch call.endReason {
|
||||||
@@ -210,7 +224,7 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
case .missed:
|
case .missed:
|
||||||
if call.isIncoming {
|
if call.isIncoming {
|
||||||
viewState = .missed
|
viewState = .missed
|
||||||
statusText = VectorL10n.eventFormatterCallYouMissed
|
statusText = isVideoCall ? VectorL10n.eventFormatterCallMissedVideo : VectorL10n.eventFormatterCallMissedVoice
|
||||||
} else {
|
} else {
|
||||||
statusText = VectorL10n.eventFormatterCallHasEnded(callDurationString)
|
statusText = VectorL10n.eventFormatterCallHasEnded(callDurationString)
|
||||||
}
|
}
|
||||||
@@ -272,7 +286,7 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
if isIncoming {
|
if isIncoming {
|
||||||
// missed call
|
// missed call
|
||||||
viewState = .missed
|
viewState = .missed
|
||||||
statusText = VectorL10n.eventFormatterCallYouMissed
|
statusText = isVideoCall ? VectorL10n.eventFormatterCallMissedVideo : VectorL10n.eventFormatterCallMissedVoice
|
||||||
} else {
|
} else {
|
||||||
// outgoing unanswered call
|
// outgoing unanswered call
|
||||||
viewState = .ended
|
viewState = .ended
|
||||||
@@ -366,11 +380,7 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
callDurationString = readableCallDuration(from: events)
|
callDurationString = readableCallDuration(from: events)
|
||||||
isIncoming = inviteEvent.sender != bubbleCellData.mxSession.myUserId
|
isIncoming = inviteEvent.sender != bubbleCellData.mxSession.myUserId
|
||||||
callInviteEvent = inviteEvent
|
callInviteEvent = inviteEvent
|
||||||
innerContentView.callIconView.image = self.callTypeIcon
|
updateCallIcon()
|
||||||
innerContentView.callTypeLabel.text = isVideoCall ?
|
|
||||||
VectorL10n.eventFormatterCallVideo :
|
|
||||||
VectorL10n.eventFormatterCallVoice
|
|
||||||
|
|
||||||
let callId = callInviteEventContent.callId
|
let callId = callInviteEventContent.callId
|
||||||
guard let call = bubbleCellData.mxSession.callManager.call(withCallId: callId) else {
|
guard let call = bubbleCellData.mxSession.callManager.call(withCallId: callId) else {
|
||||||
|
|
||||||
|
|||||||
@@ -224,7 +224,6 @@ class RoomGroupCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
self.widgetEvent = widgetEvent
|
self.widgetEvent = widgetEvent
|
||||||
self.widgetId = widgetId
|
self.widgetId = widgetId
|
||||||
innerContentView.callIconView.image = Asset.Images.callVideoIcon.image
|
innerContentView.callIconView.image = Asset.Images.callVideoIcon.image
|
||||||
innerContentView.callTypeLabel.text = VectorL10n.eventFormatterCallVideo
|
|
||||||
|
|
||||||
if isIncoming && !isJoined &&
|
if isIncoming && !isJoined &&
|
||||||
TimeInterval(widgetEvent.age)/MSEC_PER_SEC < Constants.secondsToDisplayAnswerDeclineOptions {
|
TimeInterval(widgetEvent.age)/MSEC_PER_SEC < Constants.secondsToDisplayAnswerDeclineOptions {
|
||||||
@@ -285,7 +284,7 @@ class RoomGroupCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
if widget.isActive {
|
if widget.isActive {
|
||||||
if !self.isIncoming {
|
if !self.isIncoming {
|
||||||
self.viewState = .active
|
self.viewState = .active
|
||||||
self.statusText = VectorL10n.eventFormatterCallYouCurrentlyIn
|
self.statusText = VectorL10n.eventFormatterCallActiveVideo
|
||||||
} else if !self.isJoined &&
|
} else if !self.isJoined &&
|
||||||
TimeInterval(widgetEvent.age)/MSEC_PER_SEC < Constants.secondsToDisplayAnswerDeclineOptions {
|
TimeInterval(widgetEvent.age)/MSEC_PER_SEC < Constants.secondsToDisplayAnswerDeclineOptions {
|
||||||
|
|
||||||
@@ -298,7 +297,7 @@ class RoomGroupCallStatusBubbleCell: RoomBaseCallBubbleCell {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self.viewState = .active
|
self.viewState = .active
|
||||||
self.statusText = VectorL10n.eventFormatterCallYouCurrentlyIn
|
self.statusText = VectorL10n.eventFormatterCallActiveVideo
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self.viewState = .ended
|
self.viewState = .ended
|
||||||
|
|||||||
Reference in New Issue
Block a user