Key verification: Update verified screen UI.

This commit is contained in:
SBiOSoftWhare
2020-04-28 20:27:48 +02:00
parent ad4d4931c2
commit cdb820c275
5 changed files with 147 additions and 140 deletions
@@ -30,11 +30,8 @@ final class KeyVerificationVerifiedViewController: UIViewController {
// MARK: Outlets
@IBOutlet private weak var titleLabel: UILabel!
@IBOutlet private weak var description1Label: UILabel!
@IBOutlet private weak var description2Label: UILabel!
@IBOutlet private weak var okButtonBackgroundView: UIView!
@IBOutlet private weak var okButton: UIButton!
@IBOutlet private weak var informationLabel: UILabel!
@IBOutlet private weak var doneButton: RoundedButton!
// MARK: Private
@@ -83,26 +80,28 @@ final class KeyVerificationVerifiedViewController: UIViewController {
private func setupViews() {
let bodyTitle: String
let descriptionTextPart1: String
let descriptionTextPart2: String
let informationText: String
switch self.verificationKind {
case .otherSession, .thisSession, .newSession:
case .otherSession:
bodyTitle = VectorL10n.deviceVerificationVerifiedTitle
descriptionTextPart1 = VectorL10n.deviceVerificationVerifiedDescription1
descriptionTextPart2 = VectorL10n.deviceVerificationVerifiedDescription2
informationText = VectorL10n.keyVerificationVerifiedOtherSessionInformation
case .newSession:
bodyTitle = VectorL10n.keyVerificationVerifiedNewSessionTitle
informationText = VectorL10n.keyVerificationVerifiedNewSessionInformation
case .thisSession:
bodyTitle = VectorL10n.deviceVerificationVerifiedTitle
informationText = VectorL10n.keyVerificationVerifiedThisSessionInformation
case .user:
bodyTitle = VectorL10n.deviceVerificationVerifiedTitle
descriptionTextPart1 = VectorL10n.keyVerificationVerifiedUserDescription1
descriptionTextPart2 = VectorL10n.keyVerificationVerifiedUserDescription2
informationText = VectorL10n.keyVerificationVerifiedUserInformation
}
self.title = self.verificationKind.verificationTitle
self.titleLabel.text = bodyTitle
self.description1Label.text = descriptionTextPart1
self.description2Label.text = descriptionTextPart2
self.informationLabel.text = informationText
self.okButton.setTitle(VectorL10n.deviceVerificationVerifiedGotItButton, for: .normal)
self.doneButton.setTitle(VectorL10n.deviceVerificationVerifiedGotItButton, for: .normal)
}
private func update(theme: Theme) {
@@ -115,11 +114,8 @@ final class KeyVerificationVerifiedViewController: UIViewController {
}
self.titleLabel.textColor = theme.textPrimaryColor
self.description1Label.textColor = theme.textPrimaryColor
self.description2Label.textColor = theme.textPrimaryColor
self.okButtonBackgroundView.backgroundColor = theme.backgroundColor
theme.applyStyle(onButton: self.okButton)
self.informationLabel.textColor = theme.textPrimaryColor
self.doneButton.update(theme: theme)
}
private func registerThemeServiceDidChangeThemeNotification() {
@@ -132,7 +128,7 @@ final class KeyVerificationVerifiedViewController: UIViewController {
self.update(theme: ThemeService.shared().theme)
}
@IBAction private func validateButtonAction(_ sender: Any) {
@IBAction private func doneButtonAction(_ sender: Any) {
self.delegate?.keyVerificationVerifiedViewControllerDidTapSetupAction(self)
}
}