mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed chrono
This commit is contained in:
parent
97a87c718a
commit
6124cdd806
4 changed files with 13 additions and 19 deletions
|
|
@ -74,13 +74,6 @@ class ActiveCallFragment : GenericFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
callViewModel.startCallChronometerEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { duration ->
|
||||
binding.chronometer.base = SystemClock.elapsedRealtime() - (1000 * duration)
|
||||
binding.chronometer.start()
|
||||
}
|
||||
}
|
||||
|
||||
callViewModel.showZrtpSasDialogEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { pair ->
|
||||
val model = ZrtpSasConfirmationDialogModel(pair.first, pair.second)
|
||||
|
|
@ -102,5 +95,10 @@ class ActiveCallFragment : GenericFragment() {
|
|||
dialog.show()
|
||||
}
|
||||
}
|
||||
|
||||
callViewModel.callDuration.observe(viewLifecycleOwner) { duration ->
|
||||
binding.chronometer.base = SystemClock.elapsedRealtime() - (1000 * duration)
|
||||
binding.chronometer.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,11 +53,9 @@ class IncomingCallFragment : GenericFragment() {
|
|||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
binding.viewModel = callViewModel
|
||||
|
||||
callViewModel.startCallChronometerEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { duration ->
|
||||
binding.chronometer.base = SystemClock.elapsedRealtime() - (1000 * duration)
|
||||
binding.chronometer.start()
|
||||
}
|
||||
callViewModel.callDuration.observe(viewLifecycleOwner) { duration ->
|
||||
binding.chronometer.base = SystemClock.elapsedRealtime() - (1000 * duration)
|
||||
binding.chronometer.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,11 +53,9 @@ class OutgoingCallFragment : GenericFragment() {
|
|||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
binding.viewModel = callViewModel
|
||||
|
||||
callViewModel.startCallChronometerEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { duration ->
|
||||
binding.chronometer.base = SystemClock.elapsedRealtime() - (1000 * duration)
|
||||
binding.chronometer.start()
|
||||
}
|
||||
callViewModel.callDuration.observe(viewLifecycleOwner) { duration ->
|
||||
binding.chronometer.base = SystemClock.elapsedRealtime() - (1000 * duration)
|
||||
binding.chronometer.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class CurrentCallViewModel() : ViewModel() {
|
|||
MutableLiveData<Event<Pair<String, String>>>()
|
||||
}
|
||||
|
||||
val startCallChronometerEvent = MutableLiveData<Event<Int>>()
|
||||
val callDuration = MutableLiveData<Int>()
|
||||
|
||||
// Extras actions
|
||||
|
||||
|
|
@ -241,6 +241,6 @@ class CurrentCallViewModel() : ViewModel() {
|
|||
}
|
||||
|
||||
updateEncryption()
|
||||
startCallChronometerEvent.postValue(Event(call.duration))
|
||||
callDuration.postValue(call.duration)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue