mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 20:10:04 +03:00
Show cancelled screen instead of dismissing
This commit is contained in:
parent
ee7828a445
commit
c4388348f7
4 changed files with 44 additions and 8 deletions
|
@ -36,6 +36,7 @@ import im.vector.matrix.android.api.session.Session
|
|||
import im.vector.matrix.android.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME
|
||||
import im.vector.matrix.android.api.session.crypto.crosssigning.SELF_SIGNING_KEY_SSSS_NAME
|
||||
import im.vector.matrix.android.api.session.crypto.crosssigning.USER_SIGNING_KEY_SSSS_NAME
|
||||
import im.vector.matrix.android.api.session.crypto.verification.CancelCode
|
||||
import im.vector.matrix.android.api.session.crypto.verification.VerificationTxState
|
||||
import im.vector.riotx.R
|
||||
import im.vector.riotx.core.di.ScreenComponent
|
||||
|
@ -263,7 +264,14 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment() {
|
|||
// Transaction has not yet started
|
||||
if (state.pendingRequest.invoke()?.cancelConclusion != null) {
|
||||
// The request has been declined, we should dismiss
|
||||
dismiss()
|
||||
otherUserNameText.text = getString(R.string.verification_cancelled)
|
||||
showFragment(VerificationConclusionFragment::class, Bundle().apply {
|
||||
putParcelable(MvRx.KEY_ARG, VerificationConclusionFragment.Args(
|
||||
false,
|
||||
state.pendingRequest.invoke()?.cancelConclusion?.value ?: CancelCode.User.value,
|
||||
state.isMe))
|
||||
})
|
||||
return@withState
|
||||
}
|
||||
|
||||
// If it's an outgoing
|
||||
|
@ -308,6 +316,10 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
const val SECRET_REQUEST_CODE = 101
|
||||
|
|
|
@ -58,6 +58,8 @@ class VerificationConclusionController @Inject constructor(
|
|||
id("image")
|
||||
imageRes(R.drawable.ic_shield_trusted)
|
||||
}
|
||||
|
||||
bottomDone()
|
||||
}
|
||||
ConclusionState.WARNING -> {
|
||||
bottomSheetVerificationNoticeItem {
|
||||
|
@ -74,10 +76,34 @@ class VerificationConclusionController @Inject constructor(
|
|||
id("warning_notice")
|
||||
notice(eventHtmlRenderer.render(stringProvider.getString(R.string.verification_conclusion_compromised)))
|
||||
}
|
||||
|
||||
bottomDone()
|
||||
}
|
||||
ConclusionState.CANCELLED -> {
|
||||
bottomSheetVerificationNoticeItem {
|
||||
id("notice_cancelled")
|
||||
notice(stringProvider.getString(R.string.verify_cancelled_notice))
|
||||
}
|
||||
|
||||
dividerItem {
|
||||
id("sep0")
|
||||
}
|
||||
|
||||
bottomSheetVerificationActionItem {
|
||||
id("got_it")
|
||||
title(stringProvider.getString(R.string.sas_got_it))
|
||||
titleColor(colorProvider.getColor(R.color.riotx_accent))
|
||||
iconRes(R.drawable.ic_arrow_right)
|
||||
iconColor(colorProvider.getColor(R.color.riotx_accent))
|
||||
listener { listener?.onButtonTapped() }
|
||||
|
||||
}
|
||||
}
|
||||
else -> Unit
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun bottomDone() {
|
||||
dividerItem {
|
||||
id("sep0")
|
||||
}
|
||||
|
|
|
@ -66,12 +66,7 @@ class VerificationConclusionFragment @Inject constructor(
|
|||
}
|
||||
|
||||
override fun invalidate() = withState(viewModel) { state ->
|
||||
if (state.conclusionState == ConclusionState.CANCELLED) {
|
||||
// Just dismiss in this case
|
||||
sharedViewModel.handle(VerificationAction.GotItConclusion)
|
||||
} else {
|
||||
controller.update(state)
|
||||
}
|
||||
controller.update(state)
|
||||
}
|
||||
|
||||
override fun onButtonTapped() {
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
One of the following may be compromised:\n\n- Your password\n- Your homeserver\n- This device, or the other device\n- The internet connection either device is using\n\nWe recommend you change your password & recovery key in Settings immediately.
|
||||
</string>
|
||||
|
||||
<string name="verify_cancelled_notice">Verify your devices from Settings.</string>
|
||||
<string name="verification_cancelled">Verification Cancelled</string>
|
||||
|
||||
<!-- END Strings added by Valere -->
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue