Merge pull request #7950 from vector-im/feature/ons/dismiss_verification_bottomsheet
Make verification bottom sheet cancellable on tap outside (PSG-1139)
This commit is contained in:
commit
25edcaf5d1
1
changelog.d/4025.bugfix
Normal file
1
changelog.d/4025.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix can't get out of a verification dialog
|
@ -17,6 +17,7 @@ package im.vector.app.features.crypto.verification
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Dialog
|
||||
import android.content.DialogInterface
|
||||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import android.view.KeyEvent
|
||||
@ -84,10 +85,6 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetV
|
||||
return BottomSheetVerificationBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
||||
init {
|
||||
isCancelable = false
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
@ -210,6 +207,8 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetV
|
||||
return@withState
|
||||
}
|
||||
|
||||
isCancelable = state.isVerificationRequired.not()
|
||||
|
||||
// Did the request result in a SAS transaction?
|
||||
if (state.sasTransactionState != null) {
|
||||
when (state.sasTransactionState) {
|
||||
@ -396,6 +395,11 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetV
|
||||
|
||||
const val WAITING_SELF_VERIF_TAG: String = "WAITING_SELF_VERIF_TAG"
|
||||
}
|
||||
|
||||
override fun onCancel(dialog: DialogInterface) {
|
||||
super.onCancel(dialog)
|
||||
viewModel.confirmCancel()
|
||||
}
|
||||
}
|
||||
|
||||
// fun View.getParentCoordinatorLayout(): CoordinatorLayout? {
|
||||
|
Loading…
x
Reference in New Issue
Block a user