diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 80dc593fc..5c8224246 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -795,13 +795,17 @@ // MARK: - Device Verification "device_verification_title" = "Verify device"; +"device_verification_security_advice" = "For maximum security, we recommend you do this in person or use another trusted means of communication"; // MARK: - Start "device_verification_start_title" = "Verify by comparing a short text string"; -"device_verification_start_security_advise" = "For maximum security, we recommend you do this in person or use another trusted means of communication"; "device_verification_start_wait_partner" = "Waiting for partner to accept..."; "device_verification_start_use_legacy" = "Nothing appearing? Not all clients supports interactive verification yet. Use legacy verification."; "device_verification_start_verify_button" = "Begin Verifying"; "device_verification_start_use_legacy_action" = "Use Legacy Verification (for older clients)"; - +// MARK: - Verify +"device_verification_verify_title_emoji" = "Verify this user by confirming the following emoji appear on their screen"; +"device_verification_verify_title_number" = "Verify this user by confirming the following number appears on their screen"; +"device_verification_verify_wait_partner" = "Waiting for partner to confirm..."; +"device_verification_verify_continue_button" = "Continue"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index ccfeb1b31..786804bc8 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -427,8 +427,8 @@ internal enum VectorL10n { return VectorL10n.tr("Vector", "decline") } /// For maximum security, we recommend you do this in person or use another trusted means of communication - internal static var deviceVerificationStartSecurityAdvise: String { - return VectorL10n.tr("Vector", "device_verification_start_security_advise") + internal static var deviceVerificationSecurityAdvice: String { + return VectorL10n.tr("Vector", "device_verification_security_advice") } /// Verify by comparing a short text string internal static var deviceVerificationStartTitle: String { @@ -454,6 +454,22 @@ internal enum VectorL10n { internal static var deviceVerificationTitle: String { return VectorL10n.tr("Vector", "device_verification_title") } + /// Continue + internal static var deviceVerificationVerifyContinueButton: String { + return VectorL10n.tr("Vector", "device_verification_verify_continue_button") + } + /// Verify this user by confirming the following emoji appear on their screen + internal static var deviceVerificationVerifyTitleEmoji: String { + return VectorL10n.tr("Vector", "device_verification_verify_title_emoji") + } + /// Verify this user by confirming the following number appears on their screen + internal static var deviceVerificationVerifyTitleNumber: String { + return VectorL10n.tr("Vector", "device_verification_verify_title_number") + } + /// Waiting for partner to confirm... + internal static var deviceVerificationVerifyWaitPartner: String { + return VectorL10n.tr("Vector", "device_verification_verify_wait_partner") + } /// %tu rooms internal static func directoryCellDescription(_ p1: Int) -> String { return VectorL10n.tr("Vector", "directory_cell_description", p1) diff --git a/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewController.swift b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewController.swift index bdee146ac..0078b56ce 100644 --- a/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewController.swift +++ b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewController.swift @@ -141,7 +141,7 @@ final class DeviceVerificationStartViewController: UIViewController { self.scrollView.keyboardDismissMode = .interactive self.titleLabel.text = VectorL10n.deviceVerificationStartTitle - self.informationLabel.text = VectorL10n.deviceVerificationStartSecurityAdvise + self.informationLabel.text = VectorL10n.deviceVerificationSecurityAdvice self.waitingPartnerLabel.text = VectorL10n.deviceVerificationStartWaitPartner self.useLegacyVerificationLabel.text = VectorL10n.deviceVerificationStartUseLegacy diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.storyboard b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.storyboard index 9b95e7e5c..c12aae8ba 100644 --- a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.storyboard +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.storyboard @@ -10,7 +10,7 @@ - + @@ -22,30 +22,72 @@ - + - + - - + + + + + + + + + + + + @@ -55,7 +97,7 @@ - + @@ -63,13 +105,13 @@ - + - + @@ -79,14 +121,17 @@ - - + + + + + - + diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.swift b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.swift index 00760d4fb..082edb36e 100644 --- a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.swift +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.swift @@ -31,10 +31,13 @@ final class DeviceVerificationVerifyViewController: UIViewController { // MARK: Outlets @IBOutlet private weak var scrollView: UIScrollView! - - @IBOutlet private weak var messageLabel: UILabel! - @IBOutlet private weak var okButton: UIButton! - + + @IBOutlet private weak var titleLabel: UILabel! + @IBOutlet private weak var informationLabel: UILabel! + @IBOutlet weak var waitingPartnerLabel: UILabel! + @IBOutlet weak var continueButtonBackgroundView: UIView! + @IBOutlet private weak var continueButton: UIButton! + // MARK: Private private var viewModel: DeviceVerificationVerifyViewModelType! @@ -59,7 +62,7 @@ final class DeviceVerificationVerifyViewController: UIViewController { // Do any additional setup after loading the view. - self.title = "Template" + self.title = VectorL10n.deviceVerificationTitle self.setupViews() self.keyboardAvoider = KeyboardAvoider(scrollViewContainerView: self.view, scrollView: self.scrollView) @@ -107,12 +110,12 @@ final class DeviceVerificationVerifyViewController: UIViewController { theme.applyStyle(onNavigationBar: navigationBar) } + self.titleLabel.textColor = theme.textPrimaryColor + self.informationLabel.textColor = theme.textPrimaryColor + self.waitingPartnerLabel.textColor = theme.textPrimaryColor - // TODO: - self.messageLabel.textColor = theme.textPrimaryColor - - self.okButton.backgroundColor = theme.backgroundColor - theme.applyStyle(onButton: self.okButton) + self.continueButton.backgroundColor = theme.backgroundColor + theme.applyStyle(onButton: self.continueButton) } private func registerThemeServiceDidChangeThemeNotification() { @@ -131,9 +134,14 @@ final class DeviceVerificationVerifyViewController: UIViewController { self.navigationItem.rightBarButtonItem = cancelBarButtonItem self.scrollView.keyboardDismissMode = .interactive - - self.messageLabel.text = "VectorL10n.deviceVerificationVerifyTitle" - self.messageLabel.isHidden = true + + self.titleLabel.text = VectorL10n.deviceVerificationVerifyTitleEmoji + self.informationLabel.text = VectorL10n.deviceVerificationSecurityAdvice + self.waitingPartnerLabel.text = VectorL10n.deviceVerificationVerifyWaitPartner + + self.waitingPartnerLabel.isHidden = true + + self.continueButton.setTitle(VectorL10n.deviceVerificationVerifyContinueButton, for: .normal) } private func render(viewState: DeviceVerificationVerifyViewState) { @@ -154,8 +162,8 @@ final class DeviceVerificationVerifyViewController: UIViewController { private func renderLoaded() { self.activityPresenter.removeCurrentActivityIndicator(animated: true) - self.messageLabel.text = "TODO" - self.messageLabel.isHidden = false + self.continueButtonBackgroundView.isHidden = true + self.waitingPartnerLabel.isHidden = false } private func render(error: Error) { @@ -166,8 +174,8 @@ final class DeviceVerificationVerifyViewController: UIViewController { // MARK: - Actions - @IBAction private func okButtonAction(_ sender: Any) { - self.viewModel.process(viewAction: .complete) + @IBAction private func continueButtonAction(_ sender: Any) { + self.viewModel.process(viewAction: .confirm) } private func cancelButtonAction() {