Commit 59a86e87 authored by Quentin Muret's avatar Quentin Muret Committed by Andreas Traczyk

Call view: Add call state change for ringing state

- also rename unknow state to connecting state

Change-Id: Ie461de18e029c46d1004f76799f3e8e74f0d9046
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent c9d0e363
...@@ -136,16 +136,19 @@ class CallViewModel: Stateable, ViewModel { ...@@ -136,16 +136,19 @@ class CallViewModel: Stateable, ViewModel {
lazy var bottomInfo: Observable<String> = { lazy var bottomInfo: Observable<String> = {
return callService.currentCall return callService.currentCall
.filter({ [weak self] call in .filter({ [weak self] call in
return call.callId == self?.call?.callId return call.callId == self?.call?.callId &&
call.callType == .outgoing
}).map({ [weak self] call in }).map({ [weak self] call in
if call.state == .connecting || call.state == .ringing && switch call.state {
call.callType == .outgoing { case .connecting :
return L10n.Calls.calling return L10n.Calls.connecting
} else if call.state == .over { case .ringing :
return L10n.Calls.callFinished return L10n.Calls.ringing
} else { case .over :
return "" return L10n.Calls.callFinished
} default :
return ""
}
}) })
}() }()
......
...@@ -98,12 +98,14 @@ internal enum L10n { ...@@ -98,12 +98,14 @@ internal enum L10n {
internal enum Calls { internal enum Calls {
/// Call finished /// Call finished
internal static let callFinished = L10n.tr("Localizable", "calls.callFinished") internal static let callFinished = L10n.tr("Localizable", "calls.callFinished")
/// Calling...
internal static let calling = L10n.tr("Localizable", "calls.calling")
/// Call /// Call
internal static let callItemTitle = L10n.tr("Localizable", "calls.callItemTitle") internal static let callItemTitle = L10n.tr("Localizable", "calls.callItemTitle")
/// Connecting
internal static let connecting = L10n.tr("Localizable", "calls.connecting")
/// wants to talk to you /// wants to talk to you
internal static let incomingCallInfo = L10n.tr("Localizable", "calls.incomingCallInfo") internal static let incomingCallInfo = L10n.tr("Localizable", "calls.incomingCallInfo")
/// Ringing
internal static let ringing = L10n.tr("Localizable", "calls.ringing")
/// Unknown /// Unknown
internal static let unknown = L10n.tr("Localizable", "calls.unknown") internal static let unknown = L10n.tr("Localizable", "calls.unknown")
} }
......
...@@ -100,7 +100,8 @@ ...@@ -100,7 +100,8 @@
"calls.callItemTitle" = "Call"; "calls.callItemTitle" = "Call";
"calls.unknown" = "Unknown"; "calls.unknown" = "Unknown";
"calls.incomingCallInfo" = "wants to talk to you"; "calls.incomingCallInfo" = "wants to talk to you";
"calls.calling" = "Calling..."; "calls.ringing" = "Ringing";
"calls.connecting" = "Connecting";
"calls.callFinished" = "Call finished"; "calls.callFinished" = "Call finished";
//Account Page //Account Page
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment