mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed ZRTP dialogs missing upon rotation
This commit is contained in:
parent
ce3c37ad15
commit
94e6b28f4f
3 changed files with 21 additions and 3 deletions
|
|
@ -383,6 +383,14 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
// Need to be done manually
|
||||
callViewModel.updateCallDuration()
|
||||
}
|
||||
|
||||
if (callViewModel.isZrtpAlertDialogVisible) {
|
||||
Log.i("$TAG Fragment resuming, showing ZRTP alert dialog")
|
||||
showZrtpAlertDialog(callViewModel.zrtpSasValidationAttempts == 1)
|
||||
} else if (callViewModel.isZrtpDialogVisible) {
|
||||
Log.i("$TAG Fragment resuming, showing ZRTP SAS validation dialog")
|
||||
callViewModel.showZrtpSasDialogIfPossible()
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
|
|
@ -431,6 +439,7 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
event.consume {
|
||||
callViewModel.skipZrtpSas()
|
||||
dialog.dismiss()
|
||||
callViewModel.isZrtpDialogVisible = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -438,11 +447,13 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
event.consume { authToken ->
|
||||
callViewModel.updateZrtpSas(authToken)
|
||||
dialog.dismiss()
|
||||
callViewModel.isZrtpDialogVisible = false
|
||||
}
|
||||
}
|
||||
|
||||
dialog.show()
|
||||
zrtpSasDialog = dialog
|
||||
callViewModel.isZrtpDialogVisible = true
|
||||
}
|
||||
|
||||
private fun showZrtpAlertDialog(allowTryAgain: Boolean = true) {
|
||||
|
|
@ -453,6 +464,7 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
event.consume {
|
||||
callViewModel.showZrtpSasDialogIfPossible()
|
||||
dialog.dismiss()
|
||||
callViewModel.isZrtpAlertDialogVisible = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -460,10 +472,13 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
event.consume {
|
||||
callViewModel.hangUp()
|
||||
dialog.dismiss()
|
||||
callViewModel.isZrtpAlertDialogVisible = false
|
||||
}
|
||||
}
|
||||
|
||||
dialog.show()
|
||||
zrtpSasDialog = dialog
|
||||
callViewModel.isZrtpDialogVisible = false
|
||||
callViewModel.isZrtpAlertDialogVisible = true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,6 +179,9 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
|
|||
|
||||
var zrtpSasValidationAttempts = 0
|
||||
|
||||
var isZrtpDialogVisible: Boolean = false
|
||||
var isZrtpAlertDialogVisible: Boolean = false
|
||||
|
||||
// Chat
|
||||
|
||||
val operationInProgress = MutableLiveData<Boolean>()
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/half_screen"
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.50" />
|
||||
app:layout_constraintGuide_percent="0.75" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dialog_background"
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/confirm"
|
||||
app:layout_constraintStart_toStartOf="@id/dialog_background"
|
||||
app:layout_constraintEnd_toEndOf="@id/dialog_background"
|
||||
app:layout_constraintBottom_toBottomOf="@id/half_screen"/>
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue