IOS-1697 LeySync handshake improve UI IOS-1697
authorAlejandro Gelos <agp@pep.security>
Wed, 10 Jul 2019 17:00:47 +0200
branchIOS-1697
changeset 937152c8907023eb
parent 9370 c2e61fb1bb5b
child 9372 394e152f957d
IOS-1697 LeySync handshake improve UI
pEpForiOS/Base.lproj/Reusable.storyboard
pEpForiOS/UI/KeySyncHandshake/KeySyncHandshakeViewController.swift
     1.1 --- a/pEpForiOS/Base.lproj/Reusable.storyboard	Wed Jul 10 15:29:35 2019 +0200
     1.2 +++ b/pEpForiOS/Base.lproj/Reusable.storyboard	Wed Jul 10 17:00:47 2019 +0200
     1.3 @@ -112,10 +112,10 @@
     1.4                          <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
     1.5                          <subviews>
     1.6                              <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fiE-pm-mWd">
     1.7 -                                <rect key="frame" x="57.5" y="248.5" width="260" height="190.5"/>
     1.8 +                                <rect key="frame" x="57.5" y="243.5" width="260" height="200.5"/>
     1.9                                  <subviews>
    1.10                                      <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="YMa-Kc-JoR">
    1.11 -                                        <rect key="frame" x="0.0" y="0.0" width="260" height="190.5"/>
    1.12 +                                        <rect key="frame" x="0.0" y="10" width="260" height="190.5"/>
    1.13                                          <subviews>
    1.14                                              <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="htI-ge-ZQj">
    1.15                                                  <rect key="frame" x="12" y="0.0" width="236" height="30"/>
    1.16 @@ -178,6 +178,7 @@
    1.17                                                  <subviews>
    1.18                                                      <button opaque="NO" tag="2" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="emU-WV-Kap">
    1.19                                                          <rect key="frame" x="0.0" y="12.5" width="86.5" height="30"/>
    1.20 +                                                        <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
    1.21                                                          <state key="normal" title="Button"/>
    1.22                                                          <connections>
    1.23                                                              <action selector="didPress:" destination="GZS-2u-rXb" eventType="touchUpInside" id="Qh9-Xn-6Jk"/>
    1.24 @@ -185,6 +186,7 @@
    1.25                                                      </button>
    1.26                                                      <button opaque="NO" tag="3" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Rgh-E1-f1w">
    1.27                                                          <rect key="frame" x="86.5" y="12.5" width="87" height="30"/>
    1.28 +                                                        <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
    1.29                                                          <state key="normal" title="Button"/>
    1.30                                                          <connections>
    1.31                                                              <action selector="didPress:" destination="GZS-2u-rXb" eventType="touchUpInside" id="7oe-KK-94F"/>
    1.32 @@ -192,6 +194,7 @@
    1.33                                                      </button>
    1.34                                                      <button opaque="NO" tag="4" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="w5A-sP-MB2">
    1.35                                                          <rect key="frame" x="173.5" y="12.5" width="86.5" height="30"/>
    1.36 +                                                        <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
    1.37                                                          <state key="normal" title="Button"/>
    1.38                                                          <connections>
    1.39                                                              <action selector="didPress:" destination="GZS-2u-rXb" eventType="touchUpInside" id="cCN-kJ-4MM"/>
    1.40 @@ -219,13 +222,13 @@
    1.41                                  <constraints>
    1.42                                      <constraint firstItem="YMa-Kc-JoR" firstAttribute="leading" secondItem="fiE-pm-mWd" secondAttribute="leading" id="EAC-nr-iun"/>
    1.43                                      <constraint firstAttribute="width" constant="260" id="gIO-vA-Pn9"/>
    1.44 -                                    <constraint firstItem="YMa-Kc-JoR" firstAttribute="top" secondItem="fiE-pm-mWd" secondAttribute="top" id="neq-VA-ZUu"/>
    1.45 +                                    <constraint firstItem="YMa-Kc-JoR" firstAttribute="top" secondItem="fiE-pm-mWd" secondAttribute="top" constant="10" id="neq-VA-ZUu"/>
    1.46                                      <constraint firstAttribute="trailing" secondItem="YMa-Kc-JoR" secondAttribute="trailing" id="xBm-Xd-JL5"/>
    1.47                                      <constraint firstAttribute="bottom" secondItem="YMa-Kc-JoR" secondAttribute="bottom" id="xu3-OF-yp5"/>
    1.48                                  </constraints>
    1.49                                  <userDefinedRuntimeAttributes>
    1.50                                      <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
    1.51 -                                        <integer key="value" value="5"/>
    1.52 +                                        <integer key="value" value="15"/>
    1.53                                      </userDefinedRuntimeAttribute>
    1.54                                      <userDefinedRuntimeAttribute type="boolean" keyPath="layer.maskToBounds" value="YES"/>
    1.55                                  </userDefinedRuntimeAttributes>
    1.56 @@ -240,7 +243,10 @@
    1.57                          <viewLayoutGuide key="safeArea" id="O4B-B0-4XF"/>
    1.58                      </view>
    1.59                      <connections>
    1.60 +                        <outlet property="accept" destination="w5A-sP-MB2" id="Lcb-sF-aRM"/>
    1.61                          <outlet property="alertTitle" destination="ckp-rp-1Pd" id="WIa-4m-pJy"/>
    1.62 +                        <outlet property="cancel" destination="emU-WV-Kap" id="DjI-VP-c4R"/>
    1.63 +                        <outlet property="decline" destination="Rgh-E1-f1w" id="h3F-j9-O5m"/>
    1.64                          <outlet property="keySyncWorlds" destination="xM8-bm-Ks8" id="DFP-aT-BOZ"/>
    1.65                          <outlet property="message" destination="rPi-Px-Pyp" id="Pyb-o1-Nmp"/>
    1.66                      </connections>
     2.1 --- a/pEpForiOS/UI/KeySyncHandshake/KeySyncHandshakeViewController.swift	Wed Jul 10 15:29:35 2019 +0200
     2.2 +++ b/pEpForiOS/UI/KeySyncHandshake/KeySyncHandshakeViewController.swift	Wed Jul 10 17:00:47 2019 +0200
     2.3 @@ -11,8 +11,16 @@
     2.4  final class KeySyncHandshakeViewController: UIViewController {
     2.5      static let storyboardId = "KeySyncHandshakeViewController"
     2.6      
     2.7 -    @IBOutlet weak var alertTitle: UILabel!
     2.8 -    @IBOutlet weak var message: UILabel!
     2.9 +    @IBOutlet weak var alertTitle: UILabel! {
    2.10 +        didSet {
    2.11 +            alertTitle.text = NSLocalizedString("p≡p Sync", comment: "handshake sync alert title")
    2.12 +        }
    2.13 +    }
    2.14 +    @IBOutlet weak var message: UILabel! {
    2.15 +        didSet {
    2.16 +            message.text = NSLocalizedString("A second device is detected. Please confirm the Trustwords on both devices to sync all your privacy. Shall we synchronize?", comment: "handshake sync alert message")
    2.17 +        }
    2.18 +    }
    2.19      @IBOutlet weak var keySyncWorlds: UITextView! {
    2.20          didSet {
    2.21              let languangePicker = UIPickerView()
    2.22 @@ -21,6 +29,24 @@
    2.23              keySyncWorlds.inputView = languangePicker
    2.24          }
    2.25      }
    2.26 +    @IBOutlet weak var accept: UIButton! {
    2.27 +        didSet {
    2.28 +            accept.setTitleColor(.pEpGreen, for: .normal)
    2.29 +            accept.setTitle(NSLocalizedString("Accept", comment: "accept button"), for: .normal)
    2.30 +        }
    2.31 +    }
    2.32 +    @IBOutlet weak var decline: UIButton! {
    2.33 +        didSet {
    2.34 +            decline.setTitleColor(.pEpRed, for: .normal)
    2.35 +            decline.setTitle(NSLocalizedString("Decline", comment: "decline button"), for: .normal)
    2.36 +        }
    2.37 +    }
    2.38 +    @IBOutlet weak var cancel: UIButton! {
    2.39 +        didSet {
    2.40 +            cancel.setTitleColor(.pEpGray, for: .normal)
    2.41 +            cancel.setTitle(NSLocalizedString("Cancel", comment: "cancel button"), for: .normal)
    2.42 +        }
    2.43 +    }
    2.44  
    2.45      enum Action {
    2.46          case cancel, decline, accept