mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 15:52:40 +00:00
Merge pull request #3170 from vector-im/riot_3161
Update SAS verification screen UI
This commit is contained in:
commit
fa99bf57ed
10 changed files with 225 additions and 109 deletions
|
@ -629,6 +629,7 @@
|
|||
B1C562E5228C7C8D0037F12A /* RoomContextualMenuViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B1C562E0228C7C8C0037F12A /* RoomContextualMenuViewController.storyboard */; };
|
||||
B1C562E8228C7CF20037F12A /* ContextualMenuItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1C562E6228C7CF10037F12A /* ContextualMenuItemView.swift */; };
|
||||
B1C562E9228C7CF20037F12A /* ContextualMenuItemView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B1C562E7228C7CF20037F12A /* ContextualMenuItemView.xib */; };
|
||||
B1C960F02458308D00C5704B /* RoundedButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1C960EF2458308D00C5704B /* RoundedButton.swift */; };
|
||||
B1CA3A2721EF6914000D1D89 /* UIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1CA3A2621EF6913000D1D89 /* UIViewController.swift */; };
|
||||
B1CA3A2921EF692B000D1D89 /* UIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1CA3A2821EF692B000D1D89 /* UIView.swift */; };
|
||||
B1CE83B62422812100D07506 /* KeyVerificationCoordinatorBridgePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1CE83B52422812000D07506 /* KeyVerificationCoordinatorBridgePresenter.swift */; };
|
||||
|
@ -1609,6 +1610,7 @@
|
|||
B1C6FFE723954CE70055347B /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
B1C6FFE823954D3B0055347B /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
B1C6FFE923954D4B0055347B /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Vector.strings; sourceTree = "<group>"; };
|
||||
B1C960EF2458308D00C5704B /* RoundedButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedButton.swift; sourceTree = "<group>"; };
|
||||
B1CA3A2621EF6913000D1D89 /* UIViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIViewController.swift; sourceTree = "<group>"; };
|
||||
B1CA3A2821EF692B000D1D89 /* UIView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIView.swift; sourceTree = "<group>"; };
|
||||
B1CE83B52422812000D07506 /* KeyVerificationCoordinatorBridgePresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyVerificationCoordinatorBridgePresenter.swift; sourceTree = "<group>"; };
|
||||
|
@ -2681,6 +2683,7 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
B183226B23F59F810035B2E8 /* CloseButton.swift */,
|
||||
B1C960EF2458308D00C5704B /* RoundedButton.swift */,
|
||||
);
|
||||
path = Close;
|
||||
sourceTree = "<group>";
|
||||
|
@ -5013,6 +5016,7 @@
|
|||
F083BDEE1E7009ED00A9B29C /* MXRoom+Riot.m in Sources */,
|
||||
B120863722EF375F001F89E0 /* ReactionHistoryBridgeCoordinatorPresenter.swift in Sources */,
|
||||
B1B5598620EFC3E000210D55 /* RiotSettings.swift in Sources */,
|
||||
B1C960F02458308D00C5704B /* RoundedButton.swift in Sources */,
|
||||
B1CE83D52422817200D07506 /* KeyVerificationVerifyByScanningViewController.swift in Sources */,
|
||||
3232ABA3225730E100AD6A5C /* DeviceVerificationStartCoordinatorType.swift in Sources */,
|
||||
3232AB4D2256558300AD6A5C /* TemplateScreenCoordinatorType.swift in Sources */,
|
||||
|
|
|
@ -1076,8 +1076,13 @@
|
|||
|
||||
// MARK: Verify
|
||||
|
||||
"key_verification_verify_title_emoji" = "Compare emoji";
|
||||
"key_verification_verify_title_number" = "Compare numbers";
|
||||
"key_verification_verify_sas_title_emoji" = "Compare emoji";
|
||||
"key_verification_verify_sas_title_number" = "Compare numbers";
|
||||
|
||||
"key_verification_verify_sas_cancel_action" = "They don't match";
|
||||
"key_verification_verify_sas_validate_action" = "They match";
|
||||
|
||||
"key_verification_verify_sas_additional_information" = "For ultimate security, use another trusted means of communication or do this in person.";
|
||||
|
||||
// Device
|
||||
|
||||
|
|
|
@ -1658,13 +1658,25 @@ internal enum VectorL10n {
|
|||
internal static var keyVerificationVerifyQrCodeTitle: String {
|
||||
return VectorL10n.tr("Vector", "key_verification_verify_qr_code_title")
|
||||
}
|
||||
/// For ultimate security, use another trusted means of communication or do this in person.
|
||||
internal static var keyVerificationVerifySasAdditionalInformation: String {
|
||||
return VectorL10n.tr("Vector", "key_verification_verify_sas_additional_information")
|
||||
}
|
||||
/// They don't match
|
||||
internal static var keyVerificationVerifySasCancelAction: String {
|
||||
return VectorL10n.tr("Vector", "key_verification_verify_sas_cancel_action")
|
||||
}
|
||||
/// Compare emoji
|
||||
internal static var keyVerificationVerifyTitleEmoji: String {
|
||||
return VectorL10n.tr("Vector", "key_verification_verify_title_emoji")
|
||||
internal static var keyVerificationVerifySasTitleEmoji: String {
|
||||
return VectorL10n.tr("Vector", "key_verification_verify_sas_title_emoji")
|
||||
}
|
||||
/// Compare numbers
|
||||
internal static var keyVerificationVerifyTitleNumber: String {
|
||||
return VectorL10n.tr("Vector", "key_verification_verify_title_number")
|
||||
internal static var keyVerificationVerifySasTitleNumber: String {
|
||||
return VectorL10n.tr("Vector", "key_verification_verify_sas_title_number")
|
||||
}
|
||||
/// They match
|
||||
internal static var keyVerificationVerifySasValidateAction: String {
|
||||
return VectorL10n.tr("Vector", "key_verification_verify_sas_validate_action")
|
||||
}
|
||||
/// %.1fK
|
||||
internal static func largeBadgeValueKFormat(_ p1: Float) -> String {
|
||||
|
|
85
Riot/Modules/Common/Buttons/Close/RoundedButton.swift
Normal file
85
Riot/Modules/Common/Buttons/Close/RoundedButton.swift
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
import UIKit
|
||||
|
||||
final class RoundedButton: UIButton, Themable {
|
||||
|
||||
// MARK: - Constants
|
||||
|
||||
private enum Constants {
|
||||
static let backgroundColorAlpha: CGFloat = 0.2
|
||||
static let cornerRadius: CGFloat = 6.0
|
||||
static let fontSize: CGFloat = 17.0
|
||||
}
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private var theme: Theme?
|
||||
|
||||
// MARK: Public
|
||||
|
||||
var actionStyle: UIAlertAction.Style = .default {
|
||||
didSet {
|
||||
self.updateButtonStyle()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Life cycle
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
|
||||
self.layer.masksToBounds = true
|
||||
self.titleLabel?.font = UIFont.systemFont(ofSize: Constants.fontSize)
|
||||
self.update(theme: ThemeService.shared().theme)
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
self.layer.cornerRadius = Constants.cornerRadius
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func updateButtonStyle() {
|
||||
guard let theme = theme else {
|
||||
return
|
||||
}
|
||||
|
||||
let backgroundColor: UIColor
|
||||
|
||||
switch self.actionStyle {
|
||||
case .default:
|
||||
backgroundColor = theme.tintColor
|
||||
default:
|
||||
backgroundColor = theme.noticeColor
|
||||
}
|
||||
|
||||
self.vc_setBackgroundColor(backgroundColor.withAlphaComponent(Constants.backgroundColorAlpha), for: .normal)
|
||||
self.setTitleColor(backgroundColor, for: .normal)
|
||||
}
|
||||
|
||||
// MARK: - Themable
|
||||
|
||||
func update(theme: Theme) {
|
||||
self.theme = theme
|
||||
self.updateButtonStyle()
|
||||
}
|
||||
}
|
|
@ -61,7 +61,7 @@
|
|||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="8Ou-Xh-0rC">
|
||||
<rect key="frame" x="0.0" y="48" width="374" height="40"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kBt-2D-25V">
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kBt-2D-25V" customClass="RoundedButton" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="182" height="40"/>
|
||||
<inset key="contentEdgeInsets" minX="10" minY="0.0" maxX="10" maxY="0.0"/>
|
||||
<state key="normal" title="No">
|
||||
|
@ -71,7 +71,7 @@
|
|||
<action selector="rejectButtonAction:" destination="V8j-Lb-PgC" eventType="touchUpInside" id="qCV-Oh-YAG"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="03A-fe-h3s">
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="03A-fe-h3s" customClass="RoundedButton" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="192" y="0.0" width="182" height="40"/>
|
||||
<inset key="contentEdgeInsets" minX="10" minY="0.0" maxX="10" maxY="0.0"/>
|
||||
<state key="normal" title="Yes">
|
||||
|
|
|
@ -22,11 +22,6 @@ final class KeyVerificationScanConfirmationViewController: UIViewController {
|
|||
|
||||
// MARK: - Constants
|
||||
|
||||
private enum Constants {
|
||||
static let buttonBackgroundColorAlpha: CGFloat = 0.2
|
||||
static let buttonCornerRadius: CGFloat = 6.0
|
||||
}
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Outlets
|
||||
|
@ -39,8 +34,8 @@ final class KeyVerificationScanConfirmationViewController: UIViewController {
|
|||
|
||||
@IBOutlet private weak var scannedContentView: UIView!
|
||||
@IBOutlet private weak var scannedInformationLabel: UILabel!
|
||||
@IBOutlet private weak var rejectButton: UIButton!
|
||||
@IBOutlet private weak var confirmButton: UIButton!
|
||||
@IBOutlet private weak var rejectButton: RoundedButton!
|
||||
@IBOutlet private weak var confirmButton: RoundedButton!
|
||||
|
||||
// MARK: Private
|
||||
|
||||
|
@ -76,15 +71,6 @@ final class KeyVerificationScanConfirmationViewController: UIViewController {
|
|||
|
||||
self.viewModel.process(viewAction: .loadData)
|
||||
}
|
||||
|
||||
override func viewDidLayoutSubviews() {
|
||||
super.viewDidLayoutSubviews()
|
||||
|
||||
if self.scannedContentView.isHidden == false {
|
||||
self.confirmButton.layer.cornerRadius = Constants.buttonCornerRadius
|
||||
self.rejectButton.layer.cornerRadius = Constants.buttonCornerRadius
|
||||
}
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
@ -111,8 +97,8 @@ final class KeyVerificationScanConfirmationViewController: UIViewController {
|
|||
self.titleLabel.textColor = theme.textPrimaryColor
|
||||
self.waitingLabel.textColor = theme.textSecondaryColor
|
||||
self.scannedInformationLabel.textColor = theme.textPrimaryColor
|
||||
self.confirmButton.vc_setBackgroundColor(theme.tintColor.withAlphaComponent(Constants.buttonBackgroundColorAlpha), for: .normal)
|
||||
self.rejectButton.vc_setBackgroundColor(theme.noticeColor.withAlphaComponent(Constants.buttonBackgroundColorAlpha), for: .normal)
|
||||
self.confirmButton.update(theme: theme)
|
||||
self.rejectButton.update(theme: theme)
|
||||
}
|
||||
|
||||
private func registerThemeServiceDidChangeThemeNotification() {
|
||||
|
@ -130,10 +116,12 @@ final class KeyVerificationScanConfirmationViewController: UIViewController {
|
|||
|
||||
self.navigationItem.rightBarButtonItem = cancelBarButtonItem
|
||||
|
||||
self.title = VectorL10n.keyVerificationVerifyQrCodeTitle
|
||||
|
||||
self.confirmButton.layer.masksToBounds = true
|
||||
self.rejectButton.layer.masksToBounds = true
|
||||
|
||||
self.confirmButton.setTitle(Bundle.mxk_localizedString(forKey: "yes"), for: .normal)
|
||||
self.rejectButton.setTitle(Bundle.mxk_localizedString(forKey: "no"), for: .normal)
|
||||
self.rejectButton.actionStyle = .cancel
|
||||
}
|
||||
|
||||
private func render(viewState: KeyVerificationScanConfirmationViewState) {
|
||||
|
|
|
@ -22,12 +22,12 @@
|
|||
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e7g-um-WO4">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="485"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="502"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="voD-3Q-ryt">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="485"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="502"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Verify this device by confirming the following emoji appear on the screen of the partner" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="he8-pl-xE9">
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Compare emoji" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="he8-pl-xE9">
|
||||
<rect key="frame" x="20" y="35" width="335" height="61"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="61" id="Nam-ca-50k"/>
|
||||
|
@ -37,16 +37,13 @@
|
|||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="For maximum security, we recommend you do this in person or use another trusted means of communication." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bxI-mu-qng">
|
||||
<rect key="frame" x="20" y="115" width="335" height="80"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="80" id="3ag-pn-F2b"/>
|
||||
</constraints>
|
||||
<rect key="frame" x="20" y="115" width="335" height="54"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3152 3307 8179" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RD6-ue-X5c">
|
||||
<rect key="frame" x="37.5" y="290.5" width="300" height="29"/>
|
||||
<rect key="frame" x="37.5" y="264.5" width="300" height="29"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="300" id="6Q5-M2-ifj"/>
|
||||
</constraints>
|
||||
|
@ -54,39 +51,8 @@
|
|||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DtR-jx-UKY">
|
||||
<rect key="frame" x="0.0" y="415" width="375" height="50"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DOt-5E-FjF">
|
||||
<rect key="frame" x="156.5" y="10" width="62" height="30"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<state key="normal" title="Continue">
|
||||
<color key="titleColor" red="0.47843137250000001" green="0.78823529410000004" blue="0.63137254899999995" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="continueButtonAction:" destination="V8j-Lb-PgC" eventType="touchUpInside" id="uvI-tt-Nfj"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="DOt-5E-FjF" firstAttribute="centerY" secondItem="DtR-jx-UKY" secondAttribute="centerY" id="5eX-a5-zpP"/>
|
||||
<constraint firstItem="DOt-5E-FjF" firstAttribute="centerX" secondItem="DtR-jx-UKY" secondAttribute="centerX" id="6v9-MN-mk2"/>
|
||||
<constraint firstAttribute="height" constant="50" id="QNq-au-ZdL"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Waiting for partner to confirm..." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6yX-xD-4X5">
|
||||
<rect key="frame" x="20" y="242" width="335" height="54"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="335" id="9C0-ev-AVw"/>
|
||||
<constraint firstAttribute="height" constant="54" id="pta-eP-0yH"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="34i-3X-YvQ">
|
||||
<rect key="frame" x="27.5" y="215" width="320" height="180"/>
|
||||
<rect key="frame" x="27.5" y="189" width="320" height="180"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="180" id="kpT-ty-CDI"/>
|
||||
|
@ -138,25 +104,75 @@
|
|||
<outlet property="dataSource" destination="V8j-Lb-PgC" id="3m4-oH-KIj"/>
|
||||
</connections>
|
||||
</collectionView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="6xJ-uL-C85">
|
||||
<rect key="frame" x="20" y="389" width="335" height="44"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zsb-KY-oCN" customClass="RoundedButton" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="162.5" height="44"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<inset key="contentEdgeInsets" minX="10" minY="0.0" maxX="10" maxY="0.0"/>
|
||||
<state key="normal" title="They don't match">
|
||||
<color key="titleColor" red="1" green="0.29411764709999999" blue="0.33333333329999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="cancelButtonAction:" destination="V8j-Lb-PgC" eventType="touchUpInside" id="1NK-nX-rMW"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FvW-07-g2Q" customClass="RoundedButton" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="172.5" y="0.0" width="162.5" height="44"/>
|
||||
<inset key="contentEdgeInsets" minX="10" minY="0.0" maxX="10" maxY="0.0"/>
|
||||
<state key="normal" title="They match">
|
||||
<color key="titleColor" red="0.01176470588" green="0.70196078429999997" blue="0.50588235290000005" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="validateButtonAction:" destination="V8j-Lb-PgC" eventType="touchUpInside" id="rFZ-xl-1u8"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="Zsb-KY-oCN" firstAttribute="height" secondItem="6xJ-uL-C85" secondAttribute="height" priority="999" id="Ndm-lB-EyV"/>
|
||||
<constraint firstItem="FvW-07-g2Q" firstAttribute="height" secondItem="6xJ-uL-C85" secondAttribute="height" priority="999" id="hq6-8l-unN"/>
|
||||
<constraint firstAttribute="height" priority="750" constant="44" id="lIN-Z9-vVI"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Waiting for partner to confirm..." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6yX-xD-4X5">
|
||||
<rect key="frame" x="20" y="242" width="335" height="54"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="335" id="9C0-ev-AVw"/>
|
||||
<constraint firstAttribute="height" constant="54" id="pta-eP-0yH"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="For ultimate security, use another trusted means of communication or do this in person." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gDW-77-nwN">
|
||||
<rect key="frame" x="20" y="453" width="335" height="29"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="6yX-xD-4X5" firstAttribute="top" secondItem="bxI-mu-qng" secondAttribute="bottom" constant="47" id="6Bh-e4-HVr"/>
|
||||
<constraint firstAttribute="bottom" secondItem="DtR-jx-UKY" secondAttribute="bottom" constant="20" id="Cnb-UW-hYt"/>
|
||||
<constraint firstAttribute="trailing" secondItem="DtR-jx-UKY" secondAttribute="trailing" id="K7y-Df-dgz"/>
|
||||
<constraint firstItem="6xJ-uL-C85" firstAttribute="top" secondItem="34i-3X-YvQ" secondAttribute="bottom" constant="20" id="BaX-9q-msm"/>
|
||||
<constraint firstAttribute="trailing" secondItem="6xJ-uL-C85" secondAttribute="trailing" constant="20" id="G5w-nx-cbM"/>
|
||||
<constraint firstAttribute="trailing" secondItem="gDW-77-nwN" secondAttribute="trailing" constant="20" id="Iel-ki-dp5"/>
|
||||
<constraint firstItem="6xJ-uL-C85" firstAttribute="leading" secondItem="voD-3Q-ryt" secondAttribute="leading" constant="20" id="MET-AV-3jS"/>
|
||||
<constraint firstItem="he8-pl-xE9" firstAttribute="leading" secondItem="bxI-mu-qng" secondAttribute="leading" id="Q9n-7p-gHl"/>
|
||||
<constraint firstItem="he8-pl-xE9" firstAttribute="leading" secondItem="voD-3Q-ryt" secondAttribute="leading" constant="20" id="QSg-yz-aaB"/>
|
||||
<constraint firstItem="6yX-xD-4X5" firstAttribute="centerX" secondItem="voD-3Q-ryt" secondAttribute="centerX" id="Rg4-jV-Nht"/>
|
||||
<constraint firstItem="bxI-mu-qng" firstAttribute="top" secondItem="he8-pl-xE9" secondAttribute="top" constant="80" id="UL4-x0-oFT"/>
|
||||
<constraint firstItem="gDW-77-nwN" firstAttribute="leading" secondItem="voD-3Q-ryt" secondAttribute="leading" constant="20" id="YAC-Wy-mPL"/>
|
||||
<constraint firstItem="he8-pl-xE9" firstAttribute="centerX" secondItem="voD-3Q-ryt" secondAttribute="centerX" id="ZP8-mV-RBh"/>
|
||||
<constraint firstItem="he8-pl-xE9" firstAttribute="trailing" secondItem="bxI-mu-qng" secondAttribute="trailing" id="Zeg-U8-uis"/>
|
||||
<constraint firstAttribute="width" priority="750" constant="375" id="glD-Sz-73O"/>
|
||||
<constraint firstItem="RD6-ue-X5c" firstAttribute="centerY" secondItem="34i-3X-YvQ" secondAttribute="centerY" id="h8F-gc-do4"/>
|
||||
<constraint firstItem="DtR-jx-UKY" firstAttribute="leading" secondItem="voD-3Q-ryt" secondAttribute="leading" id="hK0-aA-d9H"/>
|
||||
<constraint firstItem="RD6-ue-X5c" firstAttribute="centerX" secondItem="34i-3X-YvQ" secondAttribute="centerX" id="lBM-R8-C6b"/>
|
||||
<constraint firstItem="DtR-jx-UKY" firstAttribute="top" secondItem="34i-3X-YvQ" secondAttribute="bottom" constant="20" id="liF-Qn-tiw"/>
|
||||
<constraint firstItem="34i-3X-YvQ" firstAttribute="top" secondItem="bxI-mu-qng" secondAttribute="bottom" constant="20" id="r7A-9g-Mmb"/>
|
||||
<constraint firstAttribute="bottom" secondItem="gDW-77-nwN" secondAttribute="bottom" constant="20" id="rpv-yg-1jT"/>
|
||||
<constraint firstItem="he8-pl-xE9" firstAttribute="top" secondItem="voD-3Q-ryt" secondAttribute="top" constant="35" id="s3k-Io-834"/>
|
||||
<constraint firstItem="gDW-77-nwN" firstAttribute="top" secondItem="6xJ-uL-C85" secondAttribute="bottom" constant="20" id="wL6-tr-pO2"/>
|
||||
<constraint firstItem="34i-3X-YvQ" firstAttribute="centerX" secondItem="voD-3Q-ryt" secondAttribute="centerX" id="ydb-Fs-K0a"/>
|
||||
</constraints>
|
||||
<variation key="default">
|
||||
|
@ -179,7 +195,7 @@
|
|||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="e7g-um-WO4" secondAttribute="trailing" id="GyG-Fh-PME"/>
|
||||
<constraint firstItem="e7g-um-WO4" firstAttribute="width" secondItem="9U2-KL-ZVA" secondAttribute="width" id="Ok2-WQ-Zgc"/>
|
||||
<constraint firstAttribute="bottom" secondItem="e7g-um-WO4" secondAttribute="bottom" constant="70" id="Y46-NP-zAc"/>
|
||||
<constraint firstAttribute="bottom" secondItem="e7g-um-WO4" secondAttribute="bottom" id="Y46-NP-zAc"/>
|
||||
<constraint firstItem="e7g-um-WO4" firstAttribute="leading" secondItem="9U2-KL-ZVA" secondAttribute="leading" id="aoV-Yh-AcD"/>
|
||||
<constraint firstItem="e7g-um-WO4" firstAttribute="top" secondItem="9U2-KL-ZVA" secondAttribute="top" id="pFN-bA-SHw"/>
|
||||
</constraints>
|
||||
|
@ -195,13 +211,15 @@
|
|||
<viewLayoutGuide key="safeArea" id="bFg-jh-JZB"/>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="continueButton" destination="DOt-5E-FjF" id="ktw-U4-efQ"/>
|
||||
<outlet property="continueButtonBackgroundView" destination="DtR-jx-UKY" id="9yG-wP-u8A"/>
|
||||
<outlet property="additionalInformationLabel" destination="gDW-77-nwN" id="leX-Mb-wlj"/>
|
||||
<outlet property="buttonsStackView" destination="6xJ-uL-C85" id="vK1-e2-OYg"/>
|
||||
<outlet property="cancelButton" destination="Zsb-KY-oCN" id="xdE-MX-gp9"/>
|
||||
<outlet property="decimalLabel" destination="RD6-ue-X5c" id="wlK-nl-CB6"/>
|
||||
<outlet property="emojisCollectionView" destination="34i-3X-YvQ" id="wDE-oG-peo"/>
|
||||
<outlet property="informationLabel" destination="bxI-mu-qng" id="pbX-aZ-inC"/>
|
||||
<outlet property="scrollView" destination="9U2-KL-ZVA" id="ojG-2y-X7b"/>
|
||||
<outlet property="titleLabel" destination="he8-pl-xE9" id="btA-kv-E2B"/>
|
||||
<outlet property="validateButton" destination="FvW-07-g2Q" id="cT2-ds-ORQ"/>
|
||||
<outlet property="waitingPartnerLabel" destination="6yX-xD-4X5" id="fre-bc-Kma"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
|
|
|
@ -33,9 +33,12 @@ final class KeyVerificationVerifyBySASViewController: UIViewController {
|
|||
@IBOutlet private weak var decimalLabel: UILabel!
|
||||
@IBOutlet private weak var emojisCollectionView: UICollectionView!
|
||||
@IBOutlet private weak var waitingPartnerLabel: UILabel!
|
||||
@IBOutlet private weak var continueButtonBackgroundView: UIView!
|
||||
@IBOutlet private weak var continueButton: UIButton!
|
||||
|
||||
|
||||
@IBOutlet private weak var buttonsStackView: UIStackView!
|
||||
@IBOutlet private weak var cancelButton: RoundedButton!
|
||||
@IBOutlet private weak var validateButton: RoundedButton!
|
||||
@IBOutlet private weak var additionalInformationLabel: UILabel!
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private var viewModel: KeyVerificationVerifyBySASViewModelType!
|
||||
|
@ -99,8 +102,8 @@ final class KeyVerificationVerifyBySASViewController: UIViewController {
|
|||
self.decimalLabel.textColor = theme.textPrimaryColor
|
||||
self.waitingPartnerLabel.textColor = theme.textPrimaryColor
|
||||
|
||||
self.continueButtonBackgroundView.backgroundColor = theme.backgroundColor
|
||||
theme.applyStyle(onButton: self.continueButton)
|
||||
self.cancelButton.update(theme: theme)
|
||||
self.validateButton.update(theme: theme)
|
||||
|
||||
emojisCollectionView.reloadData()
|
||||
}
|
||||
|
@ -115,7 +118,7 @@ final class KeyVerificationVerifyBySASViewController: UIViewController {
|
|||
|
||||
private func setupViews() {
|
||||
let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in
|
||||
self?.cancelButtonAction()
|
||||
self?.cancelAction()
|
||||
}
|
||||
|
||||
self.navigationItem.rightBarButtonItem = cancelBarButtonItem
|
||||
|
@ -135,10 +138,10 @@ final class KeyVerificationVerifyBySASViewController: UIViewController {
|
|||
let adviceText: String
|
||||
|
||||
if isVerificationByEmoji {
|
||||
instructionText = VectorL10n.keyVerificationVerifyTitleEmoji
|
||||
instructionText = VectorL10n.keyVerificationVerifySasTitleEmoji
|
||||
adviceText = VectorL10n.deviceVerificationSecurityAdviceEmoji
|
||||
} else {
|
||||
instructionText = VectorL10n.keyVerificationVerifyTitleNumber
|
||||
instructionText = VectorL10n.keyVerificationVerifySasTitleNumber
|
||||
adviceText = VectorL10n.deviceVerificationSecurityAdviceNumber
|
||||
}
|
||||
|
||||
|
@ -149,7 +152,11 @@ final class KeyVerificationVerifyBySASViewController: UIViewController {
|
|||
|
||||
self.waitingPartnerLabel.isHidden = true
|
||||
|
||||
self.continueButton.setTitle(VectorL10n.continue, for: .normal)
|
||||
self.cancelButton.setTitle(VectorL10n.keyVerificationVerifySasCancelAction, for: .normal)
|
||||
self.cancelButton.actionStyle = .cancel
|
||||
self.validateButton.setTitle(VectorL10n.keyVerificationVerifySasValidateAction, for: .normal)
|
||||
|
||||
self.additionalInformationLabel.text = VectorL10n.keyVerificationVerifySasAdditionalInformation
|
||||
}
|
||||
|
||||
private func render(viewState: KeyVerificationVerifyViewState) {
|
||||
|
@ -173,8 +180,8 @@ final class KeyVerificationVerifyBySASViewController: UIViewController {
|
|||
|
||||
private func renderVerified() {
|
||||
self.activityPresenter.removeCurrentActivityIndicator(animated: true)
|
||||
|
||||
self.continueButtonBackgroundView.isHidden = true
|
||||
|
||||
self.buttonsStackView.isHidden = true
|
||||
self.waitingPartnerLabel.isHidden = false
|
||||
}
|
||||
|
||||
|
@ -206,13 +213,17 @@ final class KeyVerificationVerifyBySASViewController: UIViewController {
|
|||
|
||||
// MARK: - Actions
|
||||
|
||||
@IBAction private func continueButtonAction(_ sender: Any) {
|
||||
self.viewModel.process(viewAction: .confirm)
|
||||
}
|
||||
|
||||
private func cancelButtonAction() {
|
||||
private func cancelAction() {
|
||||
self.viewModel.process(viewAction: .cancel)
|
||||
}
|
||||
|
||||
@IBAction private func cancelButtonAction(_ sender: Any) {
|
||||
self.cancelAction()
|
||||
}
|
||||
|
||||
@IBAction private func validateButtonAction(_ sender: Any) {
|
||||
self.viewModel.process(viewAction: .confirm)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -23,8 +23,6 @@ final class KeyVerificationCellInnerContentView: UIView, NibLoadable {
|
|||
|
||||
private enum Constants {
|
||||
static let cornerRadius: CGFloat = 8.0
|
||||
static let buttonBackgroundColorAlpha: CGFloat = 0.2
|
||||
static let buttonCornerRadius: CGFloat = 6.0
|
||||
}
|
||||
|
||||
// MARK: - Properties
|
||||
|
@ -39,8 +37,8 @@ final class KeyVerificationCellInnerContentView: UIView, NibLoadable {
|
|||
@IBOutlet private weak var requestStatusLabel: UILabel!
|
||||
|
||||
@IBOutlet private weak var buttonsContainerView: UIView!
|
||||
@IBOutlet private weak var acceptButton: UIButton!
|
||||
@IBOutlet private weak var declineButton: UIButton!
|
||||
@IBOutlet private weak var acceptButton: RoundedButton!
|
||||
@IBOutlet private weak var declineButton: RoundedButton!
|
||||
|
||||
// MARK: Public
|
||||
|
||||
|
@ -110,20 +108,16 @@ final class KeyVerificationCellInnerContentView: UIView, NibLoadable {
|
|||
super.awakeFromNib()
|
||||
|
||||
self.layer.masksToBounds = true
|
||||
self.acceptButton.layer.masksToBounds = true
|
||||
|
||||
self.acceptButton.titleLabel?.adjustsFontSizeToFitWidth = true
|
||||
self.acceptButton.titleLabel?.minimumScaleFactor = 0.5
|
||||
self.acceptButton.titleLabel?.baselineAdjustment = .alignCenters
|
||||
|
||||
self.acceptButton.setTitle(VectorL10n.keyVerificationTileRequestIncomingApprovalAccept, for: .normal)
|
||||
|
||||
self.declineButton.layer.masksToBounds = true
|
||||
|
||||
self.declineButton.titleLabel?.adjustsFontSizeToFitWidth = true
|
||||
self.declineButton.titleLabel?.minimumScaleFactor = 0.5
|
||||
self.declineButton.titleLabel?.baselineAdjustment = .alignCenters
|
||||
|
||||
self.declineButton.actionStyle = .cancel
|
||||
self.declineButton.setTitle(VectorL10n.keyVerificationTileRequestIncomingApprovalDecline, for: .normal)
|
||||
}
|
||||
|
||||
|
@ -131,11 +125,6 @@ final class KeyVerificationCellInnerContentView: UIView, NibLoadable {
|
|||
super.layoutSubviews()
|
||||
|
||||
self.layer.cornerRadius = Constants.cornerRadius
|
||||
|
||||
if self.isButtonsHidden == false {
|
||||
self.acceptButton.layer.cornerRadius = Constants.buttonCornerRadius
|
||||
self.declineButton.layer.cornerRadius = Constants.buttonCornerRadius
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
@ -145,8 +134,8 @@ final class KeyVerificationCellInnerContentView: UIView, NibLoadable {
|
|||
self.titleLabel.textColor = theme.textPrimaryColor
|
||||
self.otherUserInformationLabel.textColor = theme.textSecondaryColor
|
||||
|
||||
self.acceptButton.vc_setBackgroundColor(theme.tintColor.withAlphaComponent(Constants.buttonBackgroundColorAlpha), for: .normal)
|
||||
self.declineButton.vc_setBackgroundColor(theme.noticeColor.withAlphaComponent(Constants.buttonBackgroundColorAlpha), for: .normal)
|
||||
self.acceptButton.update(theme: theme)
|
||||
self.declineButton.update(theme: theme)
|
||||
}
|
||||
|
||||
func updateSenderInfo(with userId: String, userDisplayName: String?) {
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
|
@ -46,7 +50,7 @@
|
|||
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="WxG-vh-Bn0">
|
||||
<rect key="frame" x="71" y="0.0" width="151" height="40"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="atD-LF-sGH">
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="atD-LF-sGH" customClass="RoundedButton" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="72" height="40"/>
|
||||
<inset key="contentEdgeInsets" minX="10" minY="0.0" maxX="10" maxY="0.0"/>
|
||||
<state key="normal" title="Decline">
|
||||
|
@ -56,7 +60,7 @@
|
|||
<action selector="declineButtonAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="dS6-Xr-6jZ"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="irs-8W-qcs">
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="irs-8W-qcs" customClass="RoundedButton" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="82" y="0.0" width="69" height="40"/>
|
||||
<inset key="contentEdgeInsets" minX="10" minY="0.0" maxX="10" maxY="0.0"/>
|
||||
<state key="normal" title="Accept">
|
||||
|
|
Loading…
Reference in a new issue