diff --git a/CHANGES.md b/CHANGES.md index 04f14e151a..24afa87ae3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,7 @@ Improvements 🙌: - Emoji Verification | It's not the same butterfly! (#1220) - Cross-Signing | Composer decoration: shields (#1077) - Cross-Signing | Migrate existing keybackup to cross signing with 4S from mobile (#1197) + - Cross-Signing | Consider not using a spinner on the 'complete security' prompt (#1271) - Restart broken Olm sessions ([MSC1719](https://github.com/matrix-org/matrix-doc/pull/1719)) - Cross-Signing | Hide Use recovery key when 4S is not setup (#1007) diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt b/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt index 695716d386..e07150ed4f 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt @@ -324,10 +324,6 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment() { } } - override fun dismiss() { - super.dismiss() - } - companion object { const val SECRET_REQUEST_CODE = 101 diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/verification/cancel/VerificationCancelController.kt b/vector/src/main/java/im/vector/riotx/features/crypto/verification/cancel/VerificationCancelController.kt index 49b2f7dce1..73f449a3c3 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/verification/cancel/VerificationCancelController.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/verification/cancel/VerificationCancelController.kt @@ -76,7 +76,7 @@ class VerificationCancelController @Inject constructor( bottomSheetVerificationActionItem { id("cancel") - title(stringProvider.getString(R.string.cancel)) + title(stringProvider.getString(R.string.skip)) titleColor(colorProvider.getColor(R.color.riotx_destructive_accent)) iconRes(R.drawable.ic_arrow_right) iconColor(colorProvider.getColor(R.color.riotx_destructive_accent)) diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/verification/epoxy/BottomSheetSelfWaitItem.kt b/vector/src/main/java/im/vector/riotx/features/crypto/verification/epoxy/BottomSheetSelfWaitItem.kt new file mode 100644 index 0000000000..6afc330f62 --- /dev/null +++ b/vector/src/main/java/im/vector/riotx/features/crypto/verification/epoxy/BottomSheetSelfWaitItem.kt @@ -0,0 +1,30 @@ +/* + * Copyright 2020 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package im.vector.riotx.features.crypto.verification.epoxy + +import com.airbnb.epoxy.EpoxyModelClass +import im.vector.riotx.R +import im.vector.riotx.core.epoxy.VectorEpoxyHolder +import im.vector.riotx.core.epoxy.VectorEpoxyModel + +/** + * A action for bottom sheet. + */ +@EpoxyModelClass(layout = R.layout.item_verification_wait) +abstract class BottomSheetSelfWaitItem : VectorEpoxyModel() { + class Holder : VectorEpoxyHolder() +} diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/verification/request/VerificationRequestController.kt b/vector/src/main/java/im/vector/riotx/features/crypto/verification/request/VerificationRequestController.kt index a1b55832d5..88f6607a41 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/verification/request/VerificationRequestController.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/verification/request/VerificationRequestController.kt @@ -27,6 +27,7 @@ import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.core.resources.StringProvider import im.vector.riotx.core.utils.colorizeMatchingText import im.vector.riotx.features.crypto.verification.VerificationBottomSheetViewState +import im.vector.riotx.features.crypto.verification.epoxy.bottomSheetSelfWaitItem import im.vector.riotx.features.crypto.verification.epoxy.bottomSheetVerificationActionItem import im.vector.riotx.features.crypto.verification.epoxy.bottomSheetVerificationNoticeItem import im.vector.riotx.features.crypto.verification.epoxy.bottomSheetVerificationWaitingItem @@ -56,13 +57,12 @@ class VerificationRequestController @Inject constructor( notice(stringProvider.getString(R.string.verification_open_other_to_verify)) } - dividerItem { - id("sep") + bottomSheetSelfWaitItem { + id("waiting") } - bottomSheetVerificationWaitingItem { - id("waiting") - title(stringProvider.getString(R.string.verification_request_waiting, matrixItem.getBestName())) + dividerItem { + id("sep") } if (state.quadSContainsSecrets) { @@ -76,6 +76,19 @@ class VerificationRequestController @Inject constructor( listener { listener?.onClickRecoverFromPassphrase() } } } + + dividerItem { + id("sep1") + } + + bottomSheetVerificationActionItem { + id("skip") + title(stringProvider.getString(R.string.skip)) + titleColor(colorProvider.getColor(R.color.riotx_destructive_accent)) + iconRes(R.drawable.ic_arrow_right) + iconColor(colorProvider.getColor(R.color.riotx_destructive_accent)) + listener { listener?.onClickSkip() } + } } else { val styledText = if (state.isMe) { @@ -155,5 +168,6 @@ class VerificationRequestController @Inject constructor( fun onClickOnWasNotMe() fun onClickRecoverFromPassphrase() fun onClickDismiss() + fun onClickSkip() } } diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/verification/request/VerificationRequestFragment.kt b/vector/src/main/java/im/vector/riotx/features/crypto/verification/request/VerificationRequestFragment.kt index b6c3659988..967f2946c1 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/verification/request/VerificationRequestFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/verification/request/VerificationRequestFragment.kt @@ -70,6 +70,10 @@ class VerificationRequestFragment @Inject constructor( viewModel.handle(VerificationAction.SkipVerification) } + override fun onClickSkip() { + viewModel.queryCancel() + } + override fun onClickOnWasNotMe() { viewModel.itWasNotMe() } diff --git a/vector/src/main/res/drawable/ic_monitor.xml b/vector/src/main/res/drawable/ic_monitor.xml new file mode 100644 index 0000000000..c6bbe52171 --- /dev/null +++ b/vector/src/main/res/drawable/ic_monitor.xml @@ -0,0 +1,28 @@ + + + + + diff --git a/vector/src/main/res/drawable/ic_smartphone.xml b/vector/src/main/res/drawable/ic_smartphone.xml new file mode 100644 index 0000000000..3f1072ce16 --- /dev/null +++ b/vector/src/main/res/drawable/ic_smartphone.xml @@ -0,0 +1,17 @@ + + + + diff --git a/vector/src/main/res/layout/item_verification_wait.xml b/vector/src/main/res/layout/item_verification_wait.xml new file mode 100644 index 0000000000..a5c4ae6f1b --- /dev/null +++ b/vector/src/main/res/layout/item_verification_wait.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index b37e7fd729..d49d6ea310 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -2166,7 +2166,7 @@ Not all features in Riot are implemented in RiotX yet. Main missing (and coming Selected Option Creates a simple poll - Use a recovery method + Use a Recovery Passphrase or Key If you can’t access an existing session New Sign In diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index 5d7beca84b..64748e5b29 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -6,6 +6,11 @@ + Use the latest Riot on your other devices, Riot Web, Riot Desktop, Riot iOS, RiotX for Android, or another cross-signing capable Matrix client + Riot Web\nRiot Desktop + Riot iOS\nRiot X for Android + or another cross-signing capable Matrix client + Use the latest Riot on your other devices: Forces the current outbound group session in an encrypted room to be discarded Only supported in encrypted rooms