mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 19:36:08 +03:00
Merge pull request #1272 from vector-im/feature/update_design_complete_secu
Update design wait for self verification
This commit is contained in:
commit
25b42cb4f3
11 changed files with 199 additions and 11 deletions
|
@ -23,6 +23,7 @@ Improvements 🙌:
|
||||||
- Emoji Verification | It's not the same butterfly! (#1220)
|
- Emoji Verification | It's not the same butterfly! (#1220)
|
||||||
- Cross-Signing | Composer decoration: shields (#1077)
|
- Cross-Signing | Composer decoration: shields (#1077)
|
||||||
- Cross-Signing | Migrate existing keybackup to cross signing with 4S from mobile (#1197)
|
- 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))
|
- 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)
|
- Cross-Signing | Hide Use recovery key when 4S is not setup (#1007)
|
||||||
|
|
||||||
|
|
|
@ -324,10 +324,6 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun dismiss() {
|
|
||||||
super.dismiss()
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
const val SECRET_REQUEST_CODE = 101
|
const val SECRET_REQUEST_CODE = 101
|
||||||
|
|
|
@ -76,7 +76,7 @@ class VerificationCancelController @Inject constructor(
|
||||||
|
|
||||||
bottomSheetVerificationActionItem {
|
bottomSheetVerificationActionItem {
|
||||||
id("cancel")
|
id("cancel")
|
||||||
title(stringProvider.getString(R.string.cancel))
|
title(stringProvider.getString(R.string.skip))
|
||||||
titleColor(colorProvider.getColor(R.color.riotx_destructive_accent))
|
titleColor(colorProvider.getColor(R.color.riotx_destructive_accent))
|
||||||
iconRes(R.drawable.ic_arrow_right)
|
iconRes(R.drawable.ic_arrow_right)
|
||||||
iconColor(colorProvider.getColor(R.color.riotx_destructive_accent))
|
iconColor(colorProvider.getColor(R.color.riotx_destructive_accent))
|
||||||
|
|
|
@ -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<BottomSheetSelfWaitItem.Holder>() {
|
||||||
|
class Holder : VectorEpoxyHolder()
|
||||||
|
}
|
|
@ -27,6 +27,7 @@ import im.vector.riotx.core.resources.ColorProvider
|
||||||
import im.vector.riotx.core.resources.StringProvider
|
import im.vector.riotx.core.resources.StringProvider
|
||||||
import im.vector.riotx.core.utils.colorizeMatchingText
|
import im.vector.riotx.core.utils.colorizeMatchingText
|
||||||
import im.vector.riotx.features.crypto.verification.VerificationBottomSheetViewState
|
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.bottomSheetVerificationActionItem
|
||||||
import im.vector.riotx.features.crypto.verification.epoxy.bottomSheetVerificationNoticeItem
|
import im.vector.riotx.features.crypto.verification.epoxy.bottomSheetVerificationNoticeItem
|
||||||
import im.vector.riotx.features.crypto.verification.epoxy.bottomSheetVerificationWaitingItem
|
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))
|
notice(stringProvider.getString(R.string.verification_open_other_to_verify))
|
||||||
}
|
}
|
||||||
|
|
||||||
dividerItem {
|
bottomSheetSelfWaitItem {
|
||||||
id("sep")
|
id("waiting")
|
||||||
}
|
}
|
||||||
|
|
||||||
bottomSheetVerificationWaitingItem {
|
dividerItem {
|
||||||
id("waiting")
|
id("sep")
|
||||||
title(stringProvider.getString(R.string.verification_request_waiting, matrixItem.getBestName()))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.quadSContainsSecrets) {
|
if (state.quadSContainsSecrets) {
|
||||||
|
@ -76,6 +76,19 @@ class VerificationRequestController @Inject constructor(
|
||||||
listener { listener?.onClickRecoverFromPassphrase() }
|
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 {
|
} else {
|
||||||
val styledText =
|
val styledText =
|
||||||
if (state.isMe) {
|
if (state.isMe) {
|
||||||
|
@ -155,5 +168,6 @@ class VerificationRequestController @Inject constructor(
|
||||||
fun onClickOnWasNotMe()
|
fun onClickOnWasNotMe()
|
||||||
fun onClickRecoverFromPassphrase()
|
fun onClickRecoverFromPassphrase()
|
||||||
fun onClickDismiss()
|
fun onClickDismiss()
|
||||||
|
fun onClickSkip()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,10 @@ class VerificationRequestFragment @Inject constructor(
|
||||||
viewModel.handle(VerificationAction.SkipVerification)
|
viewModel.handle(VerificationAction.SkipVerification)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onClickSkip() {
|
||||||
|
viewModel.queryCancel()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onClickOnWasNotMe() {
|
override fun onClickOnWasNotMe() {
|
||||||
viewModel.itWasNotMe()
|
viewModel.itWasNotMe()
|
||||||
}
|
}
|
||||||
|
|
28
vector/src/main/res/drawable/ic_monitor.xml
Normal file
28
vector/src/main/res/drawable/ic_monitor.xml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:strokeWidth="1"
|
||||||
|
android:pathData="M2,5C2,3.8954 2.8954,3 4,3H20C21.1046,3 22,3.8954 22,5V15C22,16.1046 21.1046,17 20,17H4C2.8954,17 2,16.1046 2,15V5Z"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:fillType="evenOdd"
|
||||||
|
android:strokeColor="#2E2F32"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:strokeWidth="1"
|
||||||
|
android:pathData="M8,21H16"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#2E2F32"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:strokeWidth="1"
|
||||||
|
android:pathData="M12,17V21"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#2E2F32"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
</vector>
|
17
vector/src/main/res/drawable/ic_smartphone.xml
Normal file
17
vector/src/main/res/drawable/ic_smartphone.xml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:strokeWidth="1"
|
||||||
|
android:pathData="M5,4C5,2.8954 5.8954,2 7,2H17C18.1046,2 19,2.8954 19,4V20C19,21.1046 18.1046,22 17,22H7C5.8954,22 5,21.1046 5,20V4Z"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:fillType="evenOdd"
|
||||||
|
android:strokeColor="#2E2F32"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M12,18m-1,0a1,1 0,1 1,2 0a1,1 0,1 1,-2 0"
|
||||||
|
android:fillColor="#2E2F32"/>
|
||||||
|
</vector>
|
93
vector/src/main/res/layout/item_verification_wait.xml
Normal file
93
vector/src/main/res/layout/item_verification_wait.xml
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/itemVerificationNoticeText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@string/use_other_session_content_description"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/use_latest_riot"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="@string/use_latest_riot"
|
||||||
|
android:textColor="?riotx_text_primary"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/monitorIcon"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/ic_monitor"
|
||||||
|
android:tint="?vctr_notice_secondary"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/smartphoneIcon"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/use_latest_riot" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/smartphoneIcon"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/ic_smartphone"
|
||||||
|
android:tint="?vctr_notice_secondary"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/monitorIcon"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/use_latest_riot" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/riot_desktop_web"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/riot_desktop_web"
|
||||||
|
android:textColor="?riotx_text_primary"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/monitorIcon"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/monitorIcon"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/monitorIcon" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/riot_ios_android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/riot_ios_android"
|
||||||
|
android:textColor="?riotx_text_primary"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/smartphoneIcon"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/smartphoneIcon"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/smartphoneIcon" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Barrier
|
||||||
|
android:id="@+id/labelsBarrier"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:barrierDirection="bottom"
|
||||||
|
app:constraint_referenced_ids="riot_ios_android,riot_desktop_web" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/or_other_mx_capabale_client"
|
||||||
|
android:textColor="?riotx_text_secondary"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/labelsBarrier" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -2166,7 +2166,7 @@ Not all features in Riot are implemented in RiotX yet. Main missing (and coming
|
||||||
</plurals>
|
</plurals>
|
||||||
<string name="poll_item_selected_aria">Selected Option</string>
|
<string name="poll_item_selected_aria">Selected Option</string>
|
||||||
<string name="command_description_poll">Creates a simple poll</string>
|
<string name="command_description_poll">Creates a simple poll</string>
|
||||||
<string name="verification_cannot_access_other_session">Use a recovery method</string>
|
<string name="verification_cannot_access_other_session">Use a Recovery Passphrase or Key</string>
|
||||||
<string name="verification_use_passphrase">If you can’t access an existing session</string>
|
<string name="verification_use_passphrase">If you can’t access an existing session</string>
|
||||||
|
|
||||||
<string name="new_signin">New Sign In</string>
|
<string name="new_signin">New Sign In</string>
|
||||||
|
|
|
@ -6,6 +6,11 @@
|
||||||
<!-- Sections has been created to limit merge conflicts. -->
|
<!-- Sections has been created to limit merge conflicts. -->
|
||||||
|
|
||||||
<!-- BEGIN Strings added by Valere -->
|
<!-- BEGIN Strings added by Valere -->
|
||||||
|
<string name="use_other_session_content_description">Use the latest Riot on your other devices, Riot Web, Riot Desktop, Riot iOS, RiotX for Android, or another cross-signing capable Matrix client</string>
|
||||||
|
<string name="riot_desktop_web">Riot Web\nRiot Desktop</string>
|
||||||
|
<string name="riot_ios_android">Riot iOS\nRiot X for Android</string>
|
||||||
|
<string name="or_other_mx_capabale_client">or another cross-signing capable Matrix client</string>
|
||||||
|
<string name="use_latest_riot">Use the latest Riot on your other devices:</string>
|
||||||
<string name="command_description_discard_session">Forces the current outbound group session in an encrypted room to be discarded</string>
|
<string name="command_description_discard_session">Forces the current outbound group session in an encrypted room to be discarded</string>
|
||||||
<string name="command_description_discard_session_not_handled">Only supported in encrypted rooms</string>
|
<string name="command_description_discard_session_not_handled">Only supported in encrypted rooms</string>
|
||||||
<!-- END Strings added by Valere -->
|
<!-- END Strings added by Valere -->
|
||||||
|
|
Loading…
Reference in a new issue