Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use different copy for self verification #3624

Merged
merged 3 commits into from
Jul 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3624.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use different copy for self verification.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,22 @@ class VerificationChooseMethodController @Inject constructor(
val host = this

if (state.otherCanScanQrCode || state.otherCanShowQrCode) {
var scanCodeInstructions: String
var scanOtherCodeTitle: String
var compareEmojiSubtitle: String
if (state.isMe) {
scanCodeInstructions = host.stringProvider.getString(R.string.verification_scan_self_notice)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I did not noticed it before, but there is no need to use host. here. It only useful if you want to use the host member from the Epoxy item DSL, for instance inside bottomSheetVerificationNoticeItem {} block.
It's not a big deal at all, it's OK to merge the PR like that, I can do the clean up later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Fixed in 07d6eaa)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah - I see, I did wonder what that was all about, but figured it was best to be consistent anyhow

scanOtherCodeTitle = host.stringProvider.getString(R.string.verification_scan_with_this_device)
compareEmojiSubtitle = host.stringProvider.getString(R.string.verification_scan_self_emoji_subtitle)
} else {
scanCodeInstructions = host.stringProvider.getString(R.string.verification_scan_notice)
scanOtherCodeTitle = host.stringProvider.getString(R.string.verification_scan_their_code)
compareEmojiSubtitle = host.stringProvider.getString(R.string.verification_scan_emoji_subtitle)
}

bottomSheetVerificationNoticeItem {
id("notice")
notice(host.stringProvider.getString(R.string.verification_scan_notice))
notice(scanCodeInstructions)
}

if (state.otherCanScanQrCode && !state.qrCodeText.isNullOrBlank()) {
Expand All @@ -64,7 +77,7 @@ class VerificationChooseMethodController @Inject constructor(
if (state.otherCanShowQrCode) {
bottomSheetVerificationActionItem {
id("openCamera")
title(host.stringProvider.getString(R.string.verification_scan_their_code))
title(scanOtherCodeTitle)
titleColor(host.colorProvider.getColorFromAttribute(R.attr.colorPrimary))
iconRes(R.drawable.ic_camera)
iconColor(host.colorProvider.getColorFromAttribute(R.attr.colorPrimary))
Expand All @@ -80,7 +93,7 @@ class VerificationChooseMethodController @Inject constructor(
id("openEmoji")
title(host.stringProvider.getString(R.string.verification_scan_emoji_title))
titleColor(host.colorProvider.getColorFromAttribute(R.attr.vctr_content_primary))
subTitle(host.stringProvider.getString(R.string.verification_scan_emoji_subtitle))
subTitle(compareEmojiSubtitle)
iconRes(R.drawable.ic_arrow_right)
iconColor(host.colorProvider.getColorFromAttribute(R.attr.vctr_content_primary))
listener { host.listener?.doVerifyBySas() }
Expand Down
3 changes: 3 additions & 0 deletions vector/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2630,9 +2630,12 @@
<string name="you">You</string>

<string name="verification_scan_notice">Scan the code with the other user\'s device to securely verify each other</string>
<string name="verification_scan_self_notice">Scan the code with your other device or switch and scan with this device</string>
<string name="verification_scan_their_code">Scan their code</string>
<string name="verification_scan_with_this_device">Scan with this device</string>
<string name="verification_scan_emoji_title">Can\'t scan</string>
<string name="verification_scan_emoji_subtitle">If you\'re not in person, compare emoji instead</string>
<string name="verification_scan_self_emoji_subtitle">Verify by comparing emoji instead</string>

<string name="verification_no_scan_emoji_title">Verify by comparing emojis</string>

Expand Down