From 25d2c2e2c6ff744cf6b0c410d548135bcab154c8 Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 23 Apr 2020 15:24:32 +0200 Subject: [PATCH 1/5] Update design wait for self verification --- CHANGES.md | 1 + .../verification/VerificationBottomSheet.kt | 4 - .../cancel/VerificationCancelController.kt | 2 +- .../epoxy/BottomSheetSelfWaitItem.kt | 30 ++++++ .../request/VerificationRequestController.kt | 24 ++++- .../request/VerificationRequestFragment.kt | 4 + vector/src/main/res/drawable/ic_monitor.xml | 28 ++++++ .../src/main/res/drawable/ic_smartphone.xml | 17 ++++ .../res/layout/item_verification_wait.xml | 94 +++++++++++++++++++ vector/src/main/res/values/strings.xml | 2 +- vector/src/main/res/values/strings_riotX.xml | 7 +- 11 files changed, 201 insertions(+), 12 deletions(-) create mode 100644 vector/src/main/java/im/vector/riotx/features/crypto/verification/epoxy/BottomSheetSelfWaitItem.kt create mode 100644 vector/src/main/res/drawable/ic_monitor.xml create mode 100644 vector/src/main/res/drawable/ic_smartphone.xml create mode 100644 vector/src/main/res/layout/item_verification_wait.xml diff --git a/CHANGES.md b/CHANGES.md index d343dfe5b4..20aef5d77b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,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) Bugfix πŸ›: - Fix summary notification staying after "mark as read" 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 56c76bc2b0..bf506cac24 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") } bottomSheetVerificationActionItem { @@ -74,6 +74,19 @@ class VerificationRequestController @Inject constructor( iconColor(colorProvider.getColorFromAttribute(R.attr.riotx_text_primary)) 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) { @@ -153,5 +166,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..6ef3269b7e --- /dev/null +++ b/vector/src/main/res/layout/item_verification_wait.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + 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 3e23f61acf..3f03bdc59d 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -6,7 +6,12 @@ - + Monitor + Smartphone + 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: From 449be02f5391a5f839166333e0420dc60a0c5da1 Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 23 Apr 2020 16:05:43 +0200 Subject: [PATCH 2/5] update icon tint --- vector/src/main/res/layout/item_verification_wait.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vector/src/main/res/layout/item_verification_wait.xml b/vector/src/main/res/layout/item_verification_wait.xml index 6ef3269b7e..467465c7d8 100644 --- a/vector/src/main/res/layout/item_verification_wait.xml +++ b/vector/src/main/res/layout/item_verification_wait.xml @@ -28,7 +28,7 @@ android:contentDescription="@string/monitor_content_description" android:scaleType="fitCenter" android:src="@drawable/ic_monitor" - android:tint="?riotx_text_primary" + android:tint="@color/riotx_notice_secondary" app:layout_constraintEnd_toStartOf="@id/smartphoneIcon" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/use_latest_riot" /> @@ -41,7 +41,7 @@ android:contentDescription="@string/monitor_content_description" android:scaleType="fitCenter" android:src="@drawable/ic_smartphone" - android:tint="?riotx_text_primary" + android:tint="@color/riotx_notice_secondary" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/monitorIcon" app:layout_constraintTop_toBottomOf="@+id/use_latest_riot" /> From 4c4ec6cfe8826cf9865023af71b0c4c4e7d3d318 Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 23 Apr 2020 16:13:19 +0200 Subject: [PATCH 3/5] Code review accessibility --- vector/src/main/res/layout/item_verification_wait.xml | 9 ++++----- vector/src/main/res/values/strings_riotX.xml | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/vector/src/main/res/layout/item_verification_wait.xml b/vector/src/main/res/layout/item_verification_wait.xml index 467465c7d8..4281e0c2b6 100644 --- a/vector/src/main/res/layout/item_verification_wait.xml +++ b/vector/src/main/res/layout/item_verification_wait.xml @@ -3,10 +3,11 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/itemVerificationNoticeText" android:layout_width="match_parent" - android:paddingBottom="8dp" + android:layout_height="wrap_content" + android:contentDescription="@string/use_other_session_content_description" android:paddingStart="16dp" android:paddingEnd="16dp" - android:layout_height="wrap_content"> + android:paddingBottom="8dp"> diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index 3f03bdc59d..442dc3fe65 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -6,8 +6,7 @@ - Monitor - Smartphone + Use the latest Riot on your other devices, Riot Web, Riot Desktop, Riot iOS, Riot X 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 From cb0e93c43ed91b035bf2e5816483e1bd5e4622de Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 23 Apr 2020 16:23:36 +0200 Subject: [PATCH 4/5] use theme notice color --- vector/src/main/res/layout/item_verification_wait.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vector/src/main/res/layout/item_verification_wait.xml b/vector/src/main/res/layout/item_verification_wait.xml index 4281e0c2b6..a5c4ae6f1b 100644 --- a/vector/src/main/res/layout/item_verification_wait.xml +++ b/vector/src/main/res/layout/item_verification_wait.xml @@ -28,7 +28,7 @@ android:layout_marginTop="16dp" android:scaleType="fitCenter" android:src="@drawable/ic_monitor" - android:tint="@color/riotx_notice_secondary" + android:tint="?vctr_notice_secondary" app:layout_constraintEnd_toStartOf="@id/smartphoneIcon" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/use_latest_riot" /> @@ -40,7 +40,7 @@ android:layout_marginTop="16dp" android:scaleType="fitCenter" android:src="@drawable/ic_smartphone" - android:tint="@color/riotx_notice_secondary" + android:tint="?vctr_notice_secondary" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/monitorIcon" app:layout_constraintTop_toBottomOf="@+id/use_latest_riot" /> From b951af0116828722e5624c5d3c8b12df94fcc6dc Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 23 Apr 2020 17:00:37 +0200 Subject: [PATCH 5/5] RiotX spelling --- vector/src/main/res/values/strings_riotX.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index 442dc3fe65..baaf5d5686 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -6,7 +6,7 @@ - Use the latest Riot on your other devices, Riot Web, Riot Desktop, Riot iOS, Riot X for Android, or another cross-signing capable Matrix client + 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