Fixed crash when touching multiple calls top bar if not on active call fragment + fixed top bar alert & status bar color after terminating more than one call

This commit is contained in:
Sylvain Berfini 2023-12-21 16:56:42 +01:00
parent bf089193d4
commit 8fb87b18e8
3 changed files with 9 additions and 3 deletions

View file

@ -252,8 +252,11 @@ class CallActivity : GenericActivity() {
callsViewModel.goToCallsListEvent.observe(this) {
it.consume {
val navController = findNavController(R.id.call_nav_container)
val action = ActiveCallFragmentDirections.actionActiveCallFragmentToCallsListFragment()
navController.navigate(action)
if (navController.currentDestination?.id == R.id.activeCallFragment) {
val action =
ActiveCallFragmentDirections.actionActiveCallFragmentToCallsListFragment()
navController.navigate(action)
}
}
}

View file

@ -91,7 +91,7 @@ class ActiveCallFragment : GenericCallFragment() {
}
override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? {
if (findNavController().currentDestination?.id == R.id.newCallFragment) {
if (findNavController().currentDestination?.id == R.id.newCallFragment || findNavController().currentDestination?.id == R.id.callsListFragment) {
// Holds fragment in place while new fragment slides over it
return AnimationUtils.loadAnimation(activity, R.anim.hold)
}

View file

@ -122,6 +122,9 @@ class MainViewModel @UiThread constructor() : ViewModel() {
) {
updateCallAlert()
} else if (core.callsNb == 1) {
if (LinphoneUtils.isCallEnding(call.state)) {
removeAlert(MULTIPLE_CALLS)
}
callsStatus.postValue(LinphoneUtils.callStateToString(call.state))
}
}