diff --git a/Ring/Ring/AppDelegate.swift b/Ring/Ring/AppDelegate.swift index f8d98cea1f5e48e2350b537d0837e87c76c20c63..0d6c74876e96f70c8ac806332c8bed9468bd05a5 100644 --- a/Ring/Ring/AppDelegate.swift +++ b/Ring/Ring/AppDelegate.swift @@ -416,29 +416,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } } - func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { - if let rootViewController = self.topViewControllerWithRootViewController(rootViewController: window?.rootViewController) { - if rootViewController.responds(to: #selector(CallViewController.canRotate)) { - return .all - } - } - return .portrait - } - - private func topViewControllerWithRootViewController(rootViewController: UIViewController!) -> UIViewController? { - if rootViewController == nil { - return nil - } - if rootViewController.isKind(of: (UITabBarController).self) { - return topViewControllerWithRootViewController(rootViewController: (rootViewController as? UITabBarController)?.selectedViewController) - } else if rootViewController.isKind(of: (UINavigationController).self) { - return topViewControllerWithRootViewController(rootViewController: (rootViewController as? UINavigationController)?.visibleViewController) - } else if rootViewController.presentedViewController != nil { - return topViewControllerWithRootViewController(rootViewController: rootViewController.presentedViewController) - } - return rootViewController - } - func findContactAndStartCall(hash: String, isVideo: Bool) { //if saved jami hash if hash.isSHA1() { diff --git a/Ring/Ring/Calls/CallViewController.storyboard b/Ring/Ring/Calls/CallViewController.storyboard index 19d4dfcb4db5ca12ab4271c3ba129d0d657d3c9d..9a4ff90a318e2e143274ff7b5d55932d6a7ee248 100644 --- a/Ring/Ring/Calls/CallViewController.storyboard +++ b/Ring/Ring/Calls/CallViewController.storyboard @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ngv-XP-7A7"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ngv-XP-7A7"> <device id="retina5_9" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15509"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -309,11 +309,11 @@ <blurEffect style="light"/> </visualEffectView> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Dj8-CK-PQm" userLabel="Call Pulse"> - <rect key="frame" x="122.66666666666669" y="135" width="130" height="130"/> + <rect key="frame" x="117.66666666666669" y="130" width="140" height="140"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> </view> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qNx-tt-eZo" userLabel="Background Image View"> - <rect key="frame" x="137.66666666666666" y="150" width="100" height="100"/> + <rect key="frame" x="133.66666666666666" y="146" width="107.66666666666666" height="108"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> <constraint firstAttribute="width" secondItem="qNx-tt-eZo" secondAttribute="height" id="uMJ-Cg-b1r"/> @@ -360,11 +360,11 @@ <constraint firstItem="uC8-vY-dHO" firstAttribute="centerY" secondItem="5E0-lB-SkS" secondAttribute="centerY" id="4Mf-hA-tZO"/> <constraint firstItem="Dj8-CK-PQm" firstAttribute="centerY" secondItem="qNx-tt-eZo" secondAttribute="centerY" id="6Aj-So-yZp"/> <constraint firstItem="fnt-PQ-Q6P" firstAttribute="top" secondItem="5E0-lB-SkS" secondAttribute="top" constant="120" id="82d-fj-m0F"/> - <constraint firstItem="Dj8-CK-PQm" firstAttribute="width" secondItem="fnt-PQ-Q6P" secondAttribute="width" constant="-30" id="CUd-sE-c9g"/> + <constraint firstItem="Dj8-CK-PQm" firstAttribute="width" secondItem="fnt-PQ-Q6P" secondAttribute="width" constant="-20" id="CUd-sE-c9g"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="73Y-N1-Yga" secondAttribute="trailing" constant="20" id="E64-Eo-ffn"/> <constraint firstItem="73Y-N1-Yga" firstAttribute="bottom" secondItem="fnt-PQ-Q6P" secondAttribute="bottom" constant="45" id="ExS-S7-RrD"/> <constraint firstItem="73Y-N1-Yga" firstAttribute="centerX" secondItem="fnt-PQ-Q6P" secondAttribute="centerX" id="HBR-dG-PgV"/> - <constraint firstItem="Dj8-CK-PQm" firstAttribute="height" secondItem="fnt-PQ-Q6P" secondAttribute="height" constant="-30" id="JQ8-d6-nUa"/> + <constraint firstItem="Dj8-CK-PQm" firstAttribute="height" secondItem="fnt-PQ-Q6P" secondAttribute="height" constant="-20" id="JQ8-d6-nUa"/> <constraint firstItem="qNx-tt-eZo" firstAttribute="centerX" secondItem="fnt-PQ-Q6P" secondAttribute="centerX" id="MJR-K4-qEg"/> <constraint firstItem="fnt-PQ-Q6P" firstAttribute="centerX" secondItem="5E0-lB-SkS" secondAttribute="centerX" id="Me2-uR-EQh"/> <constraint firstItem="uC8-vY-dHO" firstAttribute="centerX" secondItem="5E0-lB-SkS" secondAttribute="centerX" id="TJC-Hb-JIm"/> diff --git a/Ring/Ring/Calls/CallViewController.swift b/Ring/Ring/Calls/CallViewController.swift index 874c6b1100bda12883c3a08be05d0cb1f07cbf4a..11a453c5f6c5d8f1d6a7451bc32df5c2092d8a02 100644 --- a/Ring/Ring/Calls/CallViewController.swift +++ b/Ring/Ring/Calls/CallViewController.swift @@ -87,7 +87,6 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { fileprivate let disposeBag = DisposeBag() private let log = SwiftyBeaver.self - private var shouldRotateScreen = false override var preferredStatusBarStyle: UIStatusBarStyle { return self.viewModel.isAudioOnly ? .lightContent : .default @@ -113,17 +112,7 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { self.mainView.addGestureRecognizer(tapGestureRecognizer) self.setUpCallButtons() self.setupBindings() - let device = UIDevice.modelName self.profileImageView.tintColor = UIColor.jamiDefaultAvatar - switch device { - case "iPhone X", "iPhone XS", "iPhone XS Max", "iPhone XR" : - //keep the 4:3 format of the captured video on iPhone X and later when display it in full screen - if !self.avatarView.isHidden { - self.capturedVideoWidthConstraint.constant += 200 - self.capturedVideoTrailingConstraint.constant = (self.capturedVideoWidthConstraint.constant - UIScreen.main.bounds.width) / 2 - } - default : break - } if self.viewModel.isAudioOnly { // The durationLabel and buttonsContainer alpha is set here to 0, and to 1 (with a duration) when appear on the screen to have a fade in animation self.durationLabel.alpha = 0 @@ -131,7 +120,6 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { self.showAllInfo() self.setWhiteAvatarView() } - UIDevice.current.isProximityMonitoringEnabled = self.viewModel.isAudioOnly UIApplication.shared.isIdleTimerDisabled = true initCallAnimation() @@ -139,8 +127,17 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { if callCurrent { self.capturedVideoBlurEffect.alpha = 1 hideCapturedVideo() - self.shouldRotateScreen = true } + NotificationCenter.default.rx + .notification(UIDevice.orientationDidChangeNotification) + .observeOn(MainScheduler.instance) + .subscribe(onNext: {[weak self] (_) in + guard let self = self else { + return + } + self.setAvatarView(!self.avatarView.isHidden) + self.callPulse.layer.cornerRadius = (self.profileImageViewWidthConstraint.constant - 20) * 0.5 + }).disposed(by: self.disposeBag) } @IBAction func addParticipant(_ sender: Any) { @@ -185,7 +182,8 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { func initCallAnimation() { self.callPulse.alpha = 0.6 - self.callPulse.layer.cornerRadius = self.callPulse.frame.size.width / 2 + self.callPulse.layer + .cornerRadius = (self.profileImageViewWidthConstraint.constant - 20) * 0.5 animateCallCircle() } @@ -279,12 +277,6 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { .observeOn(MainScheduler.instance) .bind(to: self.buttonsContainer.pauseCallButton.rx.image()) .disposed(by: self.disposeBag) - - self.viewModel.isActiveVideoCall - .observeOn(MainScheduler.instance) - .subscribe(onNext: { [weak self] rotate in - self?.shouldRotateScreen = rotate - }).disposed(by: self.disposeBag) } // swiftlint:disable function_body_length @@ -297,7 +289,6 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { if let imageData = dataOrNil { if let image = UIImage(data: imageData) { self?.profileImageView.image = image - // self?.callProfileImage.image = image } } }).disposed(by: self.disposeBag) @@ -483,14 +474,11 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { self.avatarView.isHidden = false return } - if self.orientation == .landscapeRight - || self.orientation == .landscapeLeft { - let device = UIDevice.modelName - if device == "iPhone 5" || device == "iPhone 5c" || device == "iPhone 5s" || device == "iPhone SE" { - self.profileImageViewWidthConstraint.constant = 90 - self.profileImageViewHeightConstraint.constant = 90 - self.profileImageView.cornerRadius = 45 - } + let isPortrait = UIScreen.main.bounds.size.width < UIScreen.main.bounds.size.height + if !isPortrait { + self.profileImageViewWidthConstraint.constant = 90 + self.profileImageViewHeightConstraint.constant = 90 + self.profileImageView.cornerRadius = 45 if self.viewModel.call?.state == .ringing || self.viewModel.call?.state == .connecting { self.avatarViewImageTopConstraint.constant = 20 } else { @@ -502,14 +490,12 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { self.buttonsContainerBottomConstraint.constant = 10 } if self.viewModel.isAudioOnly { + let device = UIDevice.modelName if device == "iPhone 5" || device == "iPhone 5c" || device == "iPhone 5s" || device == "iPhone SE" { self.durationLabel.isHidden = true self.buttonsContainerBottomConstraint.constant = -10 } self.buttonsContainer.backgroundBlurEffect.alpha = 0 - self.profileImageViewWidthConstraint.constant = 90 - self.profileImageViewHeightConstraint.constant = 90 - self.profileImageView.cornerRadius = 45 } } else { if UIDevice.current.hasNotch { @@ -517,6 +503,11 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { } else { self.avatarViewImageTopConstraint.constant = 85 } + if self.viewModel.isAudioOnly || self.viewModel.call?.state != .current { + self.profileImageViewWidthConstraint.constant = 160 + self.profileImageViewHeightConstraint.constant = 160 + self.profileImageView.cornerRadius = 80 + } self.buttonsContainerBottomConstraint.constant = 10 } self.avatarView.isHidden = false @@ -599,6 +590,9 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { func resizeCapturedVideo(withInfoContainer: Bool) { self.leftArrow.alpha = 0 + if self.viewModel.call?.state != .current { + return + } //Don't change anything if the orientation change to portraitUpsideDown, faceUp or faceDown if UIDevice.current.orientation.rawValue != 5 && UIDevice.current.orientation.rawValue != 6 && UIDevice.current.orientation.rawValue != 2 { self.orientation = UIDevice.current.orientation @@ -717,19 +711,6 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { self.infoContainer.isHidden = false } - @objc func canRotate() { - // empty function to support call screen rotation - } - - override func viewWillDisappear(_ animated: Bool) { - UIDevice.current.setValue(Int(UIInterfaceOrientation.portrait.rawValue), forKey: "orientation") - super.viewWillDisappear(animated) - } - - override var shouldAutorotate: Bool { - return self.shouldRotateScreen - } - func presentContactPicker(contactPickerVC: ContactPickerViewController) { self.addChild(contactPickerVC) let newFrame = CGRect(x: 0, y: self.view.frame.size.height * 0.3, width: self.view.frame.size.width, height: self.view.frame.size.height * 0.7) diff --git a/Ring/Ring/Calls/Conference/ContactPickerViewController.storyboard b/Ring/Ring/Calls/Conference/ContactPickerViewController.storyboard index 83b91ac42b9cff6ceb12b987a7e2c36bbe4eba8c..823fcb6e2f3dea2062f4139e67c195ac3767c7d6 100644 --- a/Ring/Ring/Calls/Conference/ContactPickerViewController.storyboard +++ b/Ring/Ring/Calls/Conference/ContactPickerViewController.storyboard @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ZwP-Qn-oLY"> - <device id="retina6_1" orientation="portrait"> - <adaptation id="fullscreen"/> - </device> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ZwP-Qn-oLY"> + <device id="retina6_1" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -56,16 +54,16 @@ </subviews> <constraints> <constraint firstItem="ht5-JP-L4t" firstAttribute="top" secondItem="HLr-8o-AJK" secondAttribute="top" id="2g9-Dm-zDQ"/> - <constraint firstItem="i1P-Li-H82" firstAttribute="trailing" secondItem="HLr-8o-AJK" secondAttribute="trailing" id="44P-xu-w8R"/> <constraint firstItem="i1P-Li-H82" firstAttribute="top" secondItem="ht5-JP-L4t" secondAttribute="bottom" id="5Hu-hl-ywR"/> - <constraint firstItem="VI3-Wm-odB" firstAttribute="leading" secondItem="HLr-8o-AJK" secondAttribute="leading" id="GkO-uY-mmD"/> + <constraint firstItem="VI3-Wm-odB" firstAttribute="leading" secondItem="TtT-WG-OAE" secondAttribute="leading" id="6eR-vO-Ngc"/> <constraint firstItem="VI3-Wm-odB" firstAttribute="top" secondItem="ht5-JP-L4t" secondAttribute="bottom" id="MYo-pX-Fn0"/> - <constraint firstItem="HLr-8o-AJK" firstAttribute="trailing" secondItem="VI3-Wm-odB" secondAttribute="trailing" id="aO0-4s-CoA"/> - <constraint firstItem="ht5-JP-L4t" firstAttribute="leading" secondItem="HLr-8o-AJK" secondAttribute="leading" id="cBL-Q8-eUL"/> + <constraint firstAttribute="trailing" secondItem="ht5-JP-L4t" secondAttribute="trailing" id="OBT-xJ-bBC"/> + <constraint firstAttribute="trailing" secondItem="i1P-Li-H82" secondAttribute="trailing" id="Ud3-HQ-g57"/> + <constraint firstItem="ht5-JP-L4t" firstAttribute="leading" secondItem="TtT-WG-OAE" secondAttribute="leading" id="ZGi-aQ-f3K"/> + <constraint firstAttribute="trailing" secondItem="VI3-Wm-odB" secondAttribute="trailing" id="hug-jW-soe"/> <constraint firstItem="HLr-8o-AJK" firstAttribute="bottom" secondItem="VI3-Wm-odB" secondAttribute="bottom" id="l3e-iB-s2n"/> - <constraint firstItem="i1P-Li-H82" firstAttribute="leading" secondItem="HLr-8o-AJK" secondAttribute="leading" id="mk9-0g-iwg"/> <constraint firstAttribute="bottom" secondItem="i1P-Li-H82" secondAttribute="bottom" id="pIJ-1T-FIT"/> - <constraint firstItem="ht5-JP-L4t" firstAttribute="trailing" secondItem="HLr-8o-AJK" secondAttribute="trailing" id="pz4-KI-DV9"/> + <constraint firstItem="i1P-Li-H82" firstAttribute="leading" secondItem="TtT-WG-OAE" secondAttribute="leading" id="zog-OH-0bd"/> </constraints> <viewLayoutGuide key="safeArea" id="HLr-8o-AJK"/> </view> diff --git a/Ring/Ring/Contact/ContactViewController.storyboard b/Ring/Ring/Contact/ContactViewController.storyboard index ef4c70e0f0687ff687468fea717c73a191ccded5..c55c6a932fd8544991a6819a71dd24f07d5620ca 100644 --- a/Ring/Ring/Contact/ContactViewController.storyboard +++ b/Ring/Ring/Contact/ContactViewController.storyboard @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="4oO-a5-k5Y"> - <device id="retina4_7" orientation="portrait"> - <adaptation id="fullscreen"/> - </device> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="4oO-a5-k5Y"> + <device id="retina4_7" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -49,10 +47,10 @@ </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <constraints> + <constraint firstAttribute="trailing" secondItem="Cjc-Dl-AsW" secondAttribute="trailing" id="4gc-KZ-hMj"/> <constraint firstItem="Cjc-Dl-AsW" firstAttribute="top" secondItem="l1v-RV-Jo2" secondAttribute="top" id="FCK-2Z-zav"/> - <constraint firstItem="Cjc-Dl-AsW" firstAttribute="leading" secondItem="cTQ-BN-ANe" secondAttribute="leading" id="JuN-WT-uvv"/> - <constraint firstItem="cTQ-BN-ANe" firstAttribute="trailing" secondItem="Cjc-Dl-AsW" secondAttribute="trailing" id="PIn-ZO-UAi"/> <constraint firstItem="Cjc-Dl-AsW" firstAttribute="bottom" secondItem="cTQ-BN-ANe" secondAttribute="bottom" id="YSy-1B-Cde"/> + <constraint firstItem="Cjc-Dl-AsW" firstAttribute="leading" secondItem="l1v-RV-Jo2" secondAttribute="leading" id="cmD-7d-ghB"/> </constraints> <viewLayoutGuide key="safeArea" id="cTQ-BN-ANe"/> </view> diff --git a/Ring/Ring/Coordinators/AppCoordinator.swift b/Ring/Ring/Coordinators/AppCoordinator.swift index bee1ca3e89ea36987fc2f15785a8228b39017fd6..56819a918ed028cbfd5a8ed5cbfd134f31c1e0b0 100644 --- a/Ring/Ring/Coordinators/AppCoordinator.swift +++ b/Ring/Ring/Coordinators/AppCoordinator.swift @@ -112,7 +112,9 @@ final class AppCoordinator: Coordinator, StateableResponsive { func migrateAccount(accountId: String) { let migratonController = MigrateAccountViewController.instantiate(with: self.injectionBag) migratonController.viewModel.accountToMigrate = accountId - self.present(viewController: migratonController, withStyle: .present, withAnimation: true, withStateable: migratonController.viewModel) + self.present(viewController: migratonController, withStyle: .show, + withAnimation: true, + withStateable: migratonController.viewModel) } /// Handles the switch between the three supported screens. diff --git a/Ring/Ring/Dialpad/DialpadViewController.storyboard b/Ring/Ring/Dialpad/DialpadViewController.storyboard index 6ea5f73dd72583be340f6561aaba11a5417d104a..f8969bb8d9136952eed2957a0e5247789725cc7d 100644 --- a/Ring/Ring/Dialpad/DialpadViewController.storyboard +++ b/Ring/Ring/Dialpad/DialpadViewController.storyboard @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="bZy-pS-GTS"> - <device id="retina4_7" orientation="portrait"> - <adaptation id="fullscreen"/> - </device> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="bZy-pS-GTS"> + <device id="retina4_7" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -19,7 +17,11 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nbX-tY-YMe"> - <rect key="frame" x="20" y="40" width="92" height="41"/> + <rect key="frame" x="20" y="20" width="78.5" height="29"/> + <constraints> + <constraint firstAttribute="height" constant="29" id="JkF-kD-hSG"/> + <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="78.5" id="sgE-x1-cIL"/> + </constraints> <fontDescription key="fontDescription" type="system" weight="light" pointSize="24"/> <color key="tintColor" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <state key="normal" title="Back" image="back_button"> @@ -27,7 +29,7 @@ </state> </button> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qyz-fr-4Un"> - <rect key="frame" x="20" y="111" width="335" height="36"/> + <rect key="frame" x="20" y="79" width="335" height="36"/> <constraints> <constraint firstAttribute="height" constant="36" id="byG-U0-D3g"/> </constraints> @@ -36,7 +38,7 @@ <nil key="highlightedColor"/> </label> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zjA-FJ-Fbj"> - <rect key="frame" x="152.5" y="547" width="70" height="70"/> + <rect key="frame" x="152.5" y="515" width="70" height="70"/> <color key="backgroundColor" red="0.45009386540000001" green="0.98132258650000004" blue="0.4743030667" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstAttribute="height" constant="70" id="dUr-YZ-GPL"/> @@ -57,11 +59,12 @@ </userDefinedRuntimeAttribute> </userDefinedRuntimeAttributes> </button> - <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="Go3-KI-bHY"> - <rect key="frame" x="40" y="187" width="295" height="340"/> + <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="Go3-KI-bHY"> + <rect key="frame" x="40" y="155" width="295" height="340"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> <constraint firstAttribute="height" constant="340" id="Tbw-2k-lN2"/> + <constraint firstAttribute="width" constant="295" id="idn-rv-xSn"/> </constraints> <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="gKb-0C-Srj"> <size key="itemSize" width="50" height="50"/> @@ -76,30 +79,7 @@ <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO"> <rect key="frame" x="0.0" y="0.0" width="50" height="50"/> <autoresizingMask key="autoresizingMask"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" tag="200" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZMA-LK-otF"> - <rect key="frame" x="-10" y="-10" width="70" height="70"/> - <color key="backgroundColor" red="0.80000000000000004" green="0.80000000000000004" blue="0.80000000000000004" alpha="1" colorSpace="calibratedRGB"/> - <constraints> - <constraint firstAttribute="height" constant="70" id="EbX-Cv-0VX"/> - <constraint firstAttribute="width" constant="70" id="aed-bP-jQd"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="light" pointSize="25"/> - <color key="textColor" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> - <real key="value" value="35"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - </userDefinedRuntimeAttributes> - </label> - </subviews> </view> - <constraints> - <constraint firstItem="ZMA-LK-otF" firstAttribute="centerY" secondItem="khF-aQ-hc0" secondAttribute="centerY" id="br4-ve-7WF"/> - <constraint firstItem="ZMA-LK-otF" firstAttribute="centerX" secondItem="khF-aQ-hc0" secondAttribute="centerX" id="hnP-4Y-NE3"/> - </constraints> </collectionViewCell> </cells> <connections> @@ -108,7 +88,7 @@ </connections> </collectionView> <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ob5-yu-nTy"> - <rect key="frame" x="281" y="576" width="54" height="41"/> + <rect key="frame" x="281" y="544" width="54" height="41"/> <fontDescription key="fontDescription" type="system" weight="light" pointSize="24"/> <state key="normal" title="Clear"> <color key="titleColor" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> @@ -117,7 +97,6 @@ </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> - <constraint firstItem="Go3-KI-bHY" firstAttribute="trailing" secondItem="Xd2-41-axz" secondAttribute="trailing" constant="-40" id="AeA-rl-D6l"/> <constraint firstItem="Xd2-41-axz" firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="zjA-FJ-Fbj" secondAttribute="bottom" constant="20" id="Aot-h4-qsL"/> <constraint firstItem="Qyz-fr-4Un" firstAttribute="top" secondItem="nbX-tY-YMe" secondAttribute="bottom" constant="30" id="EnZ-3p-oDQ"/> <constraint firstItem="nbX-tY-YMe" firstAttribute="leading" secondItem="Xd2-41-axz" secondAttribute="leading" constant="20" id="FV4-ge-sVI"/> @@ -127,8 +106,8 @@ <constraint firstItem="ob5-yu-nTy" firstAttribute="trailing" secondItem="Go3-KI-bHY" secondAttribute="trailing" id="Ru7-PX-F6U"/> <constraint firstItem="zjA-FJ-Fbj" firstAttribute="centerX" secondItem="AF4-Fv-in2" secondAttribute="centerX" id="VxG-a9-bB9"/> <constraint firstItem="Xd2-41-axz" firstAttribute="trailing" secondItem="Qyz-fr-4Un" secondAttribute="trailing" constant="20" id="ZNV-Cj-Drq"/> + <constraint firstItem="Go3-KI-bHY" firstAttribute="centerX" secondItem="AF4-Fv-in2" secondAttribute="centerX" id="ZkO-Q8-tpf"/> <constraint firstItem="Go3-KI-bHY" firstAttribute="top" secondItem="Qyz-fr-4Un" secondAttribute="bottom" constant="40" id="dLr-Ex-KLr"/> - <constraint firstItem="Go3-KI-bHY" firstAttribute="leading" secondItem="Xd2-41-axz" secondAttribute="leading" constant="40" id="eSp-2Y-q4f"/> <constraint firstItem="zjA-FJ-Fbj" firstAttribute="top" secondItem="Go3-KI-bHY" secondAttribute="bottom" constant="20" id="uf9-fH-ysV"/> </constraints> <viewLayoutGuide key="safeArea" id="Xd2-41-axz"/> @@ -149,7 +128,7 @@ </scene> </scenes> <resources> - <image name="back_button" width="41.25" height="41.25"/> - <image name="call_button" width="43.5" height="43.5"/> + <image name="back_button" width="27.5" height="27.5"/> + <image name="call_button" width="29" height="29"/> </resources> </document> diff --git a/Ring/Ring/Dialpad/DialpadViewController.swift b/Ring/Ring/Dialpad/DialpadViewController.swift index ba2ed73029afcae7e03edd40005dd465e1e20f73..aced5e144742908f286f90b043749675fba063b8 100644 --- a/Ring/Ring/Dialpad/DialpadViewController.swift +++ b/Ring/Ring/Dialpad/DialpadViewController.swift @@ -84,8 +84,8 @@ class DialpadViewController: UIViewController, StoryboardBased, ViewModelBased { self.placeCallButton.isHidden = self.viewModel.inCallDialpad } - override func viewDidAppear(_ animated: Bool) { - super.viewDidAppear(animated) + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) self.collectionView .register(UICollectionViewCell.self, forCellWithReuseIdentifier: "DialpadCellIdentifier") @@ -108,11 +108,22 @@ extension DialpadViewController: UICollectionViewDelegate, UICollectionViewDataS func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "DialpadCellIdentifier", for: indexPath) - let label: UILabel = cell.viewWithTag(200) as! UILabel - label.text = self.items[indexPath.item] - if label.text == String("﹡") { - label.font = UIFont.systemFont(ofSize: 35, weight: .light) + cell.contentView.subviews.forEach { (view) in + view.removeFromSuperview() } + let label = UILabel.init(frame: CGRect(x: 0, y: 0, width: 70, height: 70)) + label.cornerRadius = 35 + label.backgroundColor = UIColor(red: 204, green: 204, blue: 204, alpha: 1) + label.textAlignment = .center + label.font = UIFont.systemFont(ofSize: 25, weight: .light) + label.textColor = UIColor.jamiSecondary + label.text = self.items[indexPath.item] + if label.text == String("﹡") { + label.font = UIFont.systemFont(ofSize: 35, weight: .light) + } + cell.contentView.addSubview(label) + label.centerXAnchor.constraint(equalTo: cell.contentView.centerXAnchor).isActive = true + label.centerYAnchor.constraint(equalTo: cell.contentView.centerYAnchor).isActive = true return cell } diff --git a/Ring/Ring/Extensions/UIView+Ring.swift b/Ring/Ring/Extensions/UIView+Ring.swift index b1eba158ccf074a1541ccef78666a05d1b10e7a2..ba7ba6e7be46fc9a8b78d2c594e798bc6c02e8e6 100644 --- a/Ring/Ring/Extensions/UIView+Ring.swift +++ b/Ring/Ring/Extensions/UIView+Ring.swift @@ -170,6 +170,13 @@ extension UIView { self.layer.insertSublayer(gradient, at: 0) } + func updateGradientFrame() { + let layers = self.layer.sublayers + if let layer: CAGradientLayer = layers?[0] as? CAGradientLayer { + layer.frame = self.bounds + } + } + func blink() { UIView.animate(withDuration: 1, delay: 0.0, diff --git a/Ring/Ring/Extensions/UIViewController+Ring.swift b/Ring/Ring/Extensions/UIViewController+Ring.swift index 69aa643024a7f6920bc6e872fa18eba041db33c9..428970bbfd5ca941a21c773cf8e05a9758879b7a 100644 --- a/Ring/Ring/Extensions/UIViewController+Ring.swift +++ b/Ring/Ring/Extensions/UIViewController+Ring.swift @@ -136,4 +136,15 @@ extension UIViewController { self.navigationController?.navigationBar.titleTextAttributes = textAttributes self.navigationController?.navigationBar.tintColor = UIColor.jamiMain } + + func configureWalkrhroughNavigationBar() { + let attrPortrait = [NSAttributedString.Key.foregroundColor: UIColor(red: 0, green: 0, blue: 0, alpha: 0.5), + NSAttributedString.Key.font: UIFont.systemFont(ofSize: 31, weight: .thin)] + let attrLandscape = [NSAttributedString.Key.foregroundColor: UIColor(red: 0, green: 0, blue: 0, alpha: 0.5), + NSAttributedString.Key.font: UIFont.systemFont(ofSize: 20, weight: .regular)] + let isPortrait = UIScreen.main.bounds.size.width < UIScreen.main.bounds.size.height + self.navigationController? + .navigationBar.titleTextAttributes = isPortrait ? + attrPortrait : attrLandscape + } } diff --git a/Ring/Ring/Features/Conversations/Conversation/ConversationViewController.storyboard b/Ring/Ring/Features/Conversations/Conversation/ConversationViewController.storyboard index 119ba6eadd554e6159653a79afe910d1cdb17faf..bdbd0bc454da6de39ecee2cacfc2259b3694424a 100644 --- a/Ring/Ring/Features/Conversations/Conversation/ConversationViewController.storyboard +++ b/Ring/Ring/Features/Conversations/Conversation/ConversationViewController.storyboard @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="O1m-sW-gim"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="O1m-sW-gim"> <device id="retina4_7" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15509"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -32,7 +32,7 @@ <color key="tintColor" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <state key="normal" title="Navigate to call"/> </button> - <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="yc2-Jn-6vm"> + <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="yc2-Jn-6vm"> <rect key="frame" x="0.0" y="60" width="375" height="607"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <prototypes> @@ -74,24 +74,24 @@ </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <constraints> - <constraint firstItem="6Wq-EJ-CAF" firstAttribute="leading" secondItem="mrp-Ty-hZO" secondAttribute="leading" id="5VA-aR-jIL"/> - <constraint firstItem="mrp-Ty-hZO" firstAttribute="trailing" secondItem="yc2-Jn-6vm" secondAttribute="trailing" id="6Ar-yh-iTT"/> + <constraint firstItem="ehB-ol-cdx" firstAttribute="leading" secondItem="lhx-ny-Zct" secondAttribute="leading" id="AUO-95-xlZ"/> <constraint firstItem="XRu-HM-jhQ" firstAttribute="bottom" secondItem="yc2-Jn-6vm" secondAttribute="bottom" id="D1h-vM-lOK"/> - <constraint firstItem="ehB-ol-cdx" firstAttribute="trailing" secondItem="mrp-Ty-hZO" secondAttribute="trailing" id="DpS-RL-o7j"/> + <constraint firstAttribute="trailing" secondItem="6Wq-EJ-CAF" secondAttribute="trailing" id="EuA-fk-PFm"/> <constraint firstAttribute="bottom" secondItem="6Wq-EJ-CAF" secondAttribute="bottom" id="QKw-Wp-ff0"/> <constraint firstItem="ehB-ol-cdx" firstAttribute="top" secondItem="mrp-Ty-hZO" secondAttribute="top" id="R8w-E8-UAR"/> - <constraint firstItem="mrp-Ty-hZO" firstAttribute="trailing" secondItem="6Wq-EJ-CAF" secondAttribute="trailing" id="W84-gc-kua"/> - <constraint firstItem="yc2-Jn-6vm" firstAttribute="leading" secondItem="mrp-Ty-hZO" secondAttribute="leading" id="Wzk-uM-Oge"/> + <constraint firstItem="yc2-Jn-6vm" firstAttribute="leading" secondItem="lhx-ny-Zct" secondAttribute="leading" id="RmT-dh-QdK"/> + <constraint firstAttribute="trailing" secondItem="yc2-Jn-6vm" secondAttribute="trailing" id="Vbp-Qr-Bjn"/> <constraint firstItem="XRu-HM-jhQ" firstAttribute="centerX" secondItem="yc2-Jn-6vm" secondAttribute="centerX" id="Y16-31-gDX"/> <constraint firstItem="5cj-ge-3dv" firstAttribute="leading" secondItem="ehB-ol-cdx" secondAttribute="leading" id="ZMK-xT-VM8"/> <constraint firstItem="5cj-ge-3dv" firstAttribute="trailing" secondItem="ehB-ol-cdx" secondAttribute="trailing" id="adg-fs-d5i"/> <constraint firstItem="5cj-ge-3dv" firstAttribute="top" secondItem="ehB-ol-cdx" secondAttribute="top" id="bMn-Xz-w1J"/> <constraint firstItem="5cj-ge-3dv" firstAttribute="bottom" secondItem="ehB-ol-cdx" secondAttribute="bottom" id="bi2-5t-Ueh"/> + <constraint firstAttribute="trailing" secondItem="ehB-ol-cdx" secondAttribute="trailing" id="hsT-qM-JJP"/> <constraint firstItem="yc2-Jn-6vm" firstAttribute="top" secondItem="ehB-ol-cdx" secondAttribute="bottom" id="iIZ-h0-wyd"/> <constraint firstAttribute="bottom" secondItem="yc2-Jn-6vm" secondAttribute="bottom" id="m6U-Gp-jhl"/> - <constraint firstItem="ehB-ol-cdx" firstAttribute="leading" secondItem="mrp-Ty-hZO" secondAttribute="leading" id="qab-nT-JEL"/> <constraint firstItem="6Wq-EJ-CAF" firstAttribute="top" secondItem="lhx-ny-Zct" secondAttribute="top" id="v3Q-NK-vb1"/> <constraint firstItem="XRu-HM-jhQ" firstAttribute="width" secondItem="yc2-Jn-6vm" secondAttribute="width" id="vBi-yc-6H9"/> + <constraint firstItem="6Wq-EJ-CAF" firstAttribute="leading" secondItem="lhx-ny-Zct" secondAttribute="leading" id="was-ym-C9C"/> </constraints> <viewLayoutGuide key="safeArea" id="mrp-Ty-hZO"/> </view> diff --git a/Ring/Ring/Features/Conversations/Conversation/ConversationViewController.swift b/Ring/Ring/Features/Conversations/Conversation/ConversationViewController.swift index 1ce9d8112f20ae40ec00571ffd76f0dc5c6bc220..c7ade02ca1d04daab50c54d572c3074c3b2b1ad1 100644 --- a/Ring/Ring/Features/Conversations/Conversation/ConversationViewController.swift +++ b/Ring/Ring/Features/Conversations/Conversation/ConversationViewController.swift @@ -71,6 +71,17 @@ class ConversationViewController: UIViewController, self.setupUI() self.setupTableView() self.setupBindings() + NotificationCenter.default.rx + .notification(UIDevice.orientationDidChangeNotification) + .observeOn(MainScheduler.instance) + .subscribe(onNext: {[weak self](_) in + guard let self = self else { + return + } + self.setupNavTitle(profileImageData: self.viewModel.profileImageData.value, + displayName: self.viewModel.displayName.value, + username: self.viewModel.userName.value) + }).disposed(by: self.disposeBag) /* Register to keyboard notifications to adjust tableView insets when the keybaord appears @@ -396,7 +407,8 @@ class ConversationViewController: UIViewController, } func setupNavTitle(profileImageData: Data?, displayName: String? = nil, username: String?) { - let imageSize = CGFloat(36.0) + let isPortrait = UIScreen.main.bounds.size.width < UIScreen.main.bounds.size.height + let imageSize = isPortrait ? CGFloat(36.0) : CGFloat(32.0) let imageOffsetY = CGFloat(5.0) let infoPadding = CGFloat(8.0) let maxNameLength = CGFloat(128.0) @@ -425,7 +437,9 @@ class ConversationViewController: UIViewController, } var dnlabelYOffset: CGFloat = 0 - if UIDevice.current.hasNotch { + if !isPortrait { + userNameYOffset = 0 + } else if UIDevice.current.hasNotch { if displayName == nil || displayName == "" { userNameYOffset = 7 } else { @@ -436,8 +450,8 @@ class ConversationViewController: UIViewController, if displayName == nil || displayName == "" { userNameYOffset = 1 } else { - dnlabelYOffset = -4 - userNameYOffset = 10 + dnlabelYOffset = -4 + userNameYOffset = 10 } } @@ -451,12 +465,19 @@ class ConversationViewController: UIViewController, nameSize = 14.0 } - let unlabel: UILabel = UILabel.init(frame: CGRect.init(x: imageSize + infoPadding, y: userNameYOffset, width: maxNameLength, height: 24)) - unlabel.text = username - unlabel.font = UIFont.systemFont(ofSize: nameSize) - unlabel.textColor = UIColor.jamiMain - unlabel.textAlignment = .left - titleView.addSubview(unlabel) + if isPortrait || displayName == nil || displayName == "" { + let frame = CGRect.init(x: imageSize + infoPadding, + y: userNameYOffset, + width: maxNameLength, + height: 24) + + let unlabel: UILabel = UILabel.init(frame: frame) + unlabel.text = username + unlabel.font = UIFont.systemFont(ofSize: nameSize) + unlabel.textColor = UIColor.jamiMain + unlabel.textAlignment = .left + titleView.addSubview(unlabel) + } let tapGesture = UITapGestureRecognizer() titleView.addGestureRecognizer(tapGesture) tapGesture.rx.event @@ -472,7 +493,7 @@ class ConversationViewController: UIViewController, self.viewModel.showContactInfo() } - // swiftlint:disable function_body_length + // swiftlint:disable function_body_length func setupUI() { self.messageAccessoryView.sendButton.contentVerticalAlignment = .fill self.messageAccessoryView.sendButton.contentHorizontalAlignment = .fill diff --git a/Ring/Ring/Features/Conversations/SendFile/SendFileViewController.storyboard b/Ring/Ring/Features/Conversations/SendFile/SendFileViewController.storyboard index 94fc09acc8e558dc018f1e26b936f1279d6e915e..be691fc7391466abc9cd7795f3413ed650c2b0ff 100644 --- a/Ring/Ring/Features/Conversations/SendFile/SendFileViewController.storyboard +++ b/Ring/Ring/Features/Conversations/SendFile/SendFileViewController.storyboard @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="aV0-zI-lAB"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="aV0-zI-lAB"> <device id="retina6_1" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -275,10 +275,10 @@ <constraint firstItem="5cM-go-ABS" firstAttribute="width" secondItem="vyN-fe-XeL" secondAttribute="width" priority="750" id="A6U-GK-uFL"/> <constraint firstItem="WLV-u3-Kwu" firstAttribute="top" secondItem="472-E9-M3O" secondAttribute="bottom" constant="20" id="G0k-1p-puP"/> <constraint firstAttribute="trailing" secondItem="VY5-pJ-9ym" secondAttribute="trailing" constant="20" id="KCg-Qm-Hm4"/> - <constraint firstItem="ORV-Mq-8UM" firstAttribute="trailing" secondItem="I2W-SJ-cNf" secondAttribute="trailing" id="Kh8-ty-AAw"/> <constraint firstAttribute="bottom" secondItem="ORV-Mq-8UM" secondAttribute="bottom" id="MKA-nc-EmJ"/> <constraint firstItem="QTS-j5-wgQ" firstAttribute="trailing" secondItem="VY5-pJ-9ym" secondAttribute="trailing" id="NrB-6M-kLB"/> - <constraint firstItem="ORV-Mq-8UM" firstAttribute="leading" secondItem="I2W-SJ-cNf" secondAttribute="leading" id="QJP-Zh-ac4"/> + <constraint firstAttribute="trailing" secondItem="ORV-Mq-8UM" secondAttribute="trailing" id="Oiz-yi-4bh"/> + <constraint firstItem="ORV-Mq-8UM" firstAttribute="leading" secondItem="vyN-fe-XeL" secondAttribute="leading" id="QMc-aO-Q7U"/> <constraint firstItem="WLV-u3-Kwu" firstAttribute="top" secondItem="QTS-j5-wgQ" secondAttribute="bottom" id="XwM-2D-fQX"/> <constraint firstItem="5cM-go-ABS" firstAttribute="height" secondItem="vyN-fe-XeL" secondAttribute="height" constant="-200" id="ZA7-rz-ccX"/> <constraint firstItem="wpy-M8-dcl" firstAttribute="leading" secondItem="VY5-pJ-9ym" secondAttribute="leading" id="bBw-S1-KmO"/> diff --git a/Ring/Ring/Features/Conversations/SendFile/SendFileViewController.swift b/Ring/Ring/Features/Conversations/SendFile/SendFileViewController.swift index 8637e5f45e2dacf7944aef017f21edc25273e641..6bb3ba35a9ea1b8b3e13a862965ce784d9b613f4 100644 --- a/Ring/Ring/Features/Conversations/SendFile/SendFileViewController.swift +++ b/Ring/Ring/Features/Conversations/SendFile/SendFileViewController.swift @@ -72,6 +72,20 @@ class SendFileViewController: UIViewController, StoryboardBased, ViewModelBased viewLeftConstraint.constant = isAudio ? 20 : 0 viewRightConstraint.constant = isAudio ? 20 : 0 self.bindViewsToViewModel() + NotificationCenter.default.rx + .notification(UIDevice.orientationDidChangeNotification) + .observeOn(MainScheduler.instance) + .subscribe(onNext: { [weak self] (_) in + //filter out upside orientation + if UIDevice.current.orientation.rawValue == 5 || UIDevice.current.orientation.rawValue == 6 { + return + } + guard let self = self else { + return + } + self.viewModel + .setCameraOrientation(orientation: UIDevice.current.orientation) + }).disposed(by: self.disposeBag) } func applyL10() { diff --git a/Ring/Ring/Features/Conversations/SendFile/SendFileViewModel.swift b/Ring/Ring/Features/Conversations/SendFile/SendFileViewModel.swift index aa751080de58f788a247caad6710454df68f0eda..f785d64fa7ca886bc19e2426f5b4de81fea5be8a 100644 --- a/Ring/Ring/Features/Conversations/SendFile/SendFileViewModel.swift +++ b/Ring/Ring/Features/Conversations/SendFile/SendFileViewModel.swift @@ -124,6 +124,7 @@ class SendFileViewModel: Stateable, ViewModel { self.injectionBag = injectionBag if !audioOnly { videoService.updateEncodongPreferences() + videoService.setCameraOrientation(orientation: UIDevice.current.orientation) videoService.startCamera() } videoService.capturedVideoFrame.asObservable() @@ -306,4 +307,8 @@ extension SendFileViewModel { self?.player?.seekTimeVariable.value = position }).disposed(by: playBackDisposeBag) } + + func setCameraOrientation(orientation: UIDeviceOrientation) { + videoService.setCameraOrientation(orientation: orientation) + } } diff --git a/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.storyboard b/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.storyboard index 383808384411d24dd74683d5480acf94cb428dad..3239252b10b6d79bf307525be9fd1ef676a9e5b5 100644 --- a/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.storyboard +++ b/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.storyboard @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Raw-Ee-7sK"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Raw-Ee-7sK"> <device id="retina4_7" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15509"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> diff --git a/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift b/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift index ca5ece9da88462e11343c35d338ef0b2e169781b..f00247f6e566208b9fe7810e7dab8bfaa35e0544 100644 --- a/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift +++ b/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift @@ -209,24 +209,31 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased self.viewModel.profileImage.bind(to: accountButton.rx.image(for: .normal)) .disposed(by: disposeBag) accountButton.roundedCorners = true - accountButton.cornerRadius = 20 accountButton.clipsToBounds = true accountButton.contentMode = .scaleAspectFill - accountButton.frame = CGRect(x: 0, y: 0, width: 40, height: 40) + let size: CGFloat = 32 + accountButton.cornerRadius = size * 0.5 + accountButton.frame = CGRect(x: 0, y: 0, width: size, height: size) accountButton.imageEdgeInsets = UIEdgeInsets(top: -4, left: -4, bottom: -4, right: -4) - let containerView = UIView(frame: CGRect(x: 0, y: 0, width: 80, height: 40)) + let containerView = UIView(frame: CGRect(x: 0, y: 0, width: 80, height: size)) containerView.addSubview(accountButton) let accountButtonItem = UIBarButtonItem(customView: containerView) - accountButtonItem.customView?.translatesAutoresizingMaskIntoConstraints = false + accountButtonItem + .customView? + .translatesAutoresizingMaskIntoConstraints = false if #available(iOS 10.0, *) { - accountButtonItem.customView?.heightAnchor.constraint(equalToConstant: 40).isActive = true - accountButtonItem.customView?.widthAnchor.constraint(equalToConstant: 80).isActive = true + accountButtonItem.customView? + .heightAnchor + .constraint(equalToConstant: size).isActive = true + accountButtonItem.customView? + .widthAnchor + .constraint(equalToConstant: 80).isActive = true } - accountButton.rx.tap.throttle(0.5, scheduler: MainScheduler.instance) + accountButton.rx.tap + .throttle(0.5, scheduler: MainScheduler.instance) .subscribe(onNext: { [weak self] in self?.openAccountsList() - }) - .disposed(by: self.disposeBag) + }).disposed(by: self.disposeBag) self.navigationItem.leftBarButtonItem = accountButtonItem dialpadButton.rx.tap diff --git a/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.storyboard b/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.storyboard index 1dd7cd36028ce0c767a03fa94ef4778d3cec8ce0..d396af62c7f2ba9a9396db2e65751350515efc1b 100644 --- a/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.storyboard +++ b/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.storyboard @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="jUh-Lp-ulu"> - <device id="ipad10_5" orientation="portrait"> - <adaptation id="fullscreen"/> - </device> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="jUh-Lp-ulu"> + <device id="retina3_5" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> @@ -18,23 +16,17 @@ <viewControllerLayoutGuide type="bottom" id="fgQ-1h-rMi"/> </layoutGuides> <view key="view" clipsSubviews="YES" contentMode="scaleToFill" id="7Ub-Rk-fjK"> - <rect key="frame" x="0.0" y="0.0" width="834" height="1112"/> + <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" keyboardDismissMode="interactive" translatesAutoresizingMaskIntoConstraints="NO" id="UZB-Gb-Dp2"> - <rect key="frame" x="20" y="0.0" width="794" height="1112"/> + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" keyboardDismissMode="interactive" translatesAutoresizingMaskIntoConstraints="NO" id="UZB-Gb-Dp2"> + <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="g3i-8d-O4a" userLabel="Container View" customClass="DesignableView" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="-20" y="-18" width="834" height="351.5"/> + <rect key="frame" x="0.0" y="0.0" width="320" height="316.5"/> <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" preservesSuperviewLayoutMargins="YES" text="Create your jami account" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cAM-lf-Iex"> - <rect key="frame" x="25" y="-22" width="784" height="37"/> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="31"/> - <color key="textColor" white="0.0" alpha="0.5" colorSpace="calibratedWhite"/> - <nil key="highlightedColor"/> - </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" text="Register a username" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qeI-Uf-g3M"> - <rect key="frame" x="177" y="55" width="421" height="21.5"/> + <rect key="frame" x="45" y="20" width="171" height="21.5"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -45,25 +37,24 @@ </userDefinedRuntimeAttributes> </label> <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hzc-aD-41e"> - <rect key="frame" x="608" y="50.5" width="51" height="31"/> + <rect key="frame" x="226" y="15.5" width="51" height="31"/> <color key="onTintColor" red="0.12156862745098039" green="0.28627450980392155" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </switch> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="(Recommended)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QTZ-o9-LER"> - <rect key="frame" x="177" y="76.5" width="80" height="12"/> + <rect key="frame" x="45" y="41.5" width="80" height="12"/> <fontDescription key="fontDescription" type="system" pointSize="10"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4YB-Ka-7tL"> - <rect key="frame" x="167" y="106.5" width="500" height="65"/> + <rect key="frame" x="35" y="71.5" width="250" height="65"/> <subviews> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Username" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="E18-Hh-7He" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="0.0" y="0.0" width="500" height="50"/> + <rect key="frame" x="0.0" y="0.0" width="250" height="50"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <constraints> <constraint firstAttribute="height" constant="50" id="BAO-oa-Ecp"/> </constraints> - <nil key="textColor"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <textInputTraits key="textInputTraits" autocorrectionType="no"/> <userDefinedRuntimeAttributes> @@ -98,31 +89,30 @@ </constraints> </view> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Choose a password" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BLe-wx-zKe" userLabel="Register Password Label"> - <rect key="frame" x="177" y="183.5" width="421" height="21.5"/> + <rect key="frame" x="45" y="148.5" width="171" height="21.5"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="WaK-DM-X0c" userLabel="Password Switch"> - <rect key="frame" x="608" y="178.5" width="51" height="31"/> + <rect key="frame" x="226" y="143.5" width="51" height="31"/> <color key="onTintColor" red="0.12156862745098039" green="0.28627450980392155" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </switch> <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IVi-pM-qbp" userLabel="Choose Password View"> - <rect key="frame" x="167" y="229.5" width="500" height="0.0"/> + <rect key="frame" x="35" y="194.5" width="250" height="0.0"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Choose a password to encrypt your local account. Don’t forget it or you will lose access to your account" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gh1-3j-vN7" userLabel="Password Information"> - <rect key="frame" x="15" y="0.0" width="470" height="38.5"/> + <rect key="frame" x="15" y="0.0" width="220" height="76.5"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="16"/> <color key="textColor" red="0.12156862745098039" green="0.28627450980392155" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="jhr-UL-eCl" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="0.0" y="48.5" width="500" height="50"/> + <rect key="frame" x="0.0" y="86.5" width="250" height="50"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <constraints> <constraint firstAttribute="height" constant="50" id="eGy-0v-Pm0"/> </constraints> - <nil key="textColor"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <textInputTraits key="textInputTraits" autocorrectionType="no" secureTextEntry="YES"/> <userDefinedRuntimeAttributes> @@ -136,12 +126,11 @@ </userDefinedRuntimeAttributes> </textField> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Confirm password" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ODL-4B-fCm" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="0.0" y="108.5" width="500" height="50"/> + <rect key="frame" x="0.0" y="146.5" width="250" height="50"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <constraints> <constraint firstAttribute="height" constant="50" id="iUA-8a-sP7"/> </constraints> - <nil key="textColor"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <textInputTraits key="textInputTraits" autocorrectionType="no" secureTextEntry="YES"/> <userDefinedRuntimeAttributes> @@ -155,7 +144,7 @@ </userDefinedRuntimeAttributes> </textField> <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="passwords do not match" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IWj-x1-hN9"> - <rect key="frame" x="15" y="164.5" width="149" height="16"/> + <rect key="frame" x="15" y="202.5" width="149" height="16"/> <fontDescription key="fontDescription" type="system" pointSize="13"/> <color key="textColor" red="0.83137254901960778" green="0.054901960784313725" blue="0.070588235294117646" alpha="0.90000000000000002" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -180,19 +169,20 @@ </constraints> </view> <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8uM-V9-rGD" userLabel="Notifications Switch"> - <rect key="frame" x="608" y="240.5" width="51" height="31"/> + <rect key="frame" x="226" y="205.5" width="51" height="31"/> <color key="onTintColor" red="0.12156862745098039" green="0.28627450980392155" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </switch> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable notifications" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="v2K-7x-35g" userLabel="Enable Notifications Label"> - <rect key="frame" x="177" y="245.5" width="156" height="21"/> + <rect key="frame" x="45" y="210.5" width="151.5" height="21"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="05l-0O-Ql0" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="167" y="301.5" width="500" height="50"/> + <rect key="frame" x="35" y="266.5" width="250" height="50"/> <constraints> <constraint firstAttribute="height" constant="50" id="501-bI-E5J"/> + <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="250" id="oJ2-vB-TJG"/> </constraints> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/> @@ -206,15 +196,12 @@ <constraint firstItem="4YB-Ka-7tL" firstAttribute="trailing" secondItem="hzc-aD-41e" secondAttribute="trailing" constant="10" id="1wO-3T-tfO"/> <constraint firstItem="IVi-pM-qbp" firstAttribute="top" secondItem="WaK-DM-X0c" secondAttribute="bottom" constant="20" id="26L-Di-76k"/> <constraint firstItem="IVi-pM-qbp" firstAttribute="trailing" secondItem="4YB-Ka-7tL" secondAttribute="trailing" id="4c4-eM-gY5"/> - <constraint firstItem="cAM-lf-Iex" firstAttribute="centerX" secondItem="g3i-8d-O4a" secondAttribute="centerX" id="5Sz-Rn-XXy"/> <constraint firstItem="BLe-wx-zKe" firstAttribute="leading" secondItem="qeI-Uf-g3M" secondAttribute="leading" id="A2c-l4-4s0"/> - <constraint firstAttribute="trailing" secondItem="cAM-lf-Iex" secondAttribute="trailing" constant="25" id="Abu-I9-ufg"/> <constraint firstItem="QTZ-o9-LER" firstAttribute="top" secondItem="qeI-Uf-g3M" secondAttribute="bottom" id="EHH-l0-byE"/> <constraint firstItem="WaK-DM-X0c" firstAttribute="top" secondItem="4YB-Ka-7tL" secondAttribute="bottom" constant="7" id="HEn-BC-6ew"/> + <constraint firstItem="qeI-Uf-g3M" firstAttribute="top" secondItem="g3i-8d-O4a" secondAttribute="top" constant="20" id="ISb-PA-yXg"/> <constraint firstItem="8uM-V9-rGD" firstAttribute="trailing" secondItem="WaK-DM-X0c" secondAttribute="trailing" id="OGN-oX-ksa"/> <constraint firstItem="WaK-DM-X0c" firstAttribute="trailing" secondItem="hzc-aD-41e" secondAttribute="trailing" id="OVM-OC-BKM"/> - <constraint firstItem="cAM-lf-Iex" firstAttribute="leading" secondItem="g3i-8d-O4a" secondAttribute="leading" constant="25" id="Okx-aE-BTj"/> - <constraint firstItem="qeI-Uf-g3M" firstAttribute="top" secondItem="cAM-lf-Iex" secondAttribute="bottom" constant="40" id="QUu-qc-tj4"/> <constraint firstItem="v2K-7x-35g" firstAttribute="leading" secondItem="qeI-Uf-g3M" secondAttribute="leading" id="QWe-Dk-13g"/> <constraint firstItem="8uM-V9-rGD" firstAttribute="top" secondItem="IVi-pM-qbp" secondAttribute="bottom" constant="11" id="Ssw-au-Fvr"/> <constraint firstItem="QTZ-o9-LER" firstAttribute="leading" secondItem="qeI-Uf-g3M" secondAttribute="leading" id="U56-eG-HW0"/> @@ -228,7 +215,6 @@ <constraint firstItem="hzc-aD-41e" firstAttribute="leading" secondItem="BLe-wx-zKe" secondAttribute="trailing" constant="10" id="iVP-j2-wzA"/> <constraint firstItem="8uM-V9-rGD" firstAttribute="top" secondItem="IWj-x1-hN9" secondAttribute="top" priority="1" id="pC1-Dk-oIP"/> <constraint firstItem="hzc-aD-41e" firstAttribute="centerY" secondItem="qeI-Uf-g3M" secondAttribute="centerY" id="quS-Vm-CiE"/> - <constraint firstItem="cAM-lf-Iex" firstAttribute="top" secondItem="g3i-8d-O4a" secondAttribute="top" constant="-22" id="sCC-hK-7zg"/> <constraint firstItem="05l-0O-Ql0" firstAttribute="top" secondItem="8uM-V9-rGD" secondAttribute="bottom" constant="30" id="sZL-E0-cZK"/> <constraint firstItem="v2K-7x-35g" firstAttribute="centerY" secondItem="8uM-V9-rGD" secondAttribute="centerY" id="wSr-6Q-hP0"/> <constraint firstItem="qeI-Uf-g3M" firstAttribute="leading" secondItem="4YB-Ka-7tL" secondAttribute="leading" constant="10" id="xTf-Xn-6I9"/> @@ -238,47 +224,31 @@ </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> - <constraint firstItem="g3i-8d-O4a" firstAttribute="leading" secondItem="UZB-Gb-Dp2" secondAttribute="leading" priority="250" constant="-20" id="21l-gk-aAy"/> <constraint firstItem="g3i-8d-O4a" firstAttribute="centerX" secondItem="UZB-Gb-Dp2" secondAttribute="centerX" id="2xr-k8-WWd"/> - <constraint firstAttribute="trailing" secondItem="g3i-8d-O4a" secondAttribute="trailing" priority="250" constant="-20" id="4vn-no-Pzq"/> - <constraint firstAttribute="top" secondItem="g3i-8d-O4a" secondAttribute="top" constant="18" id="AXm-Ng-PDJ"/> + <constraint firstAttribute="top" secondItem="g3i-8d-O4a" secondAttribute="top" id="AXm-Ng-PDJ"/> + <constraint firstItem="g3i-8d-O4a" firstAttribute="width" secondItem="UZB-Gb-Dp2" secondAttribute="width" id="EHx-OE-h8o"/> <constraint firstItem="g3i-8d-O4a" firstAttribute="bottom" secondItem="UZB-Gb-Dp2" secondAttribute="bottom" priority="250" id="MAL-nV-nsP"/> + <constraint firstItem="g3i-8d-O4a" firstAttribute="leading" secondItem="UZB-Gb-Dp2" secondAttribute="leading" id="lNv-h5-Txt"/> + <constraint firstAttribute="trailing" secondItem="g3i-8d-O4a" secondAttribute="trailing" id="zA1-ii-2jU"/> </constraints> </scrollView> - <visualEffectView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xJI-3e-kSG" userLabel="Background Navigation Bar"> - <rect key="frame" x="0.0" y="0.0" width="834" height="0.0"/> - <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="4Wd-7Y-TbC"> - <rect key="frame" x="0.0" y="0.0" width="834" height="0.0"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - </view> - <constraints> - <constraint firstAttribute="height" id="WfS-B2-NZI"/> - </constraints> - <blurEffect style="light"/> - </visualEffectView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> + <constraint firstItem="UZB-Gb-Dp2" firstAttribute="top" secondItem="Wq5-qI-WER" secondAttribute="bottom" id="0Jd-nh-7XH"/> + <constraint firstAttribute="trailing" secondItem="UZB-Gb-Dp2" secondAttribute="trailing" id="9nH-sj-GMu"/> <constraint firstItem="05l-0O-Ql0" firstAttribute="leading" secondItem="IVi-pM-qbp" secondAttribute="leading" id="MDW-QE-EfZ"/> <constraint firstItem="fgQ-1h-rMi" firstAttribute="top" secondItem="UZB-Gb-Dp2" secondAttribute="bottom" id="Nff-ZG-Yuu"/> - <constraint firstAttribute="trailingMargin" secondItem="UZB-Gb-Dp2" secondAttribute="trailing" id="ZeU-39-hYg"/> <constraint firstItem="IVi-pM-qbp" firstAttribute="trailing" secondItem="05l-0O-Ql0" secondAttribute="trailing" id="bBa-32-pvE"/> - <constraint firstItem="UZB-Gb-Dp2" firstAttribute="top" secondItem="7Ub-Rk-fjK" secondAttribute="top" id="l58-kW-bAF"/> - <constraint firstAttribute="leadingMargin" secondItem="UZB-Gb-Dp2" secondAttribute="leading" id="n4K-YN-Ab0"/> - <constraint firstItem="xJI-3e-kSG" firstAttribute="top" secondItem="7Ub-Rk-fjK" secondAttribute="top" id="q3t-DK-hJs"/> - <constraint firstItem="xJI-3e-kSG" firstAttribute="width" secondItem="7Ub-Rk-fjK" secondAttribute="width" id="vh6-d3-sOd"/> - <constraint firstItem="g3i-8d-O4a" firstAttribute="width" secondItem="7Ub-Rk-fjK" secondAttribute="width" id="wcZ-tz-DCM"/> - <constraint firstItem="xJI-3e-kSG" firstAttribute="centerX" secondItem="7Ub-Rk-fjK" secondAttribute="centerX" id="z4S-tQ-3IZ"/> + <constraint firstItem="UZB-Gb-Dp2" firstAttribute="leading" secondItem="7Ub-Rk-fjK" secondAttribute="leading" id="rfn-3b-OAS"/> </constraints> </view> <connections> - <outlet property="backgroundNavigationBarHeightConstraint" destination="WfS-B2-NZI" id="sM3-uq-CGF"/> <outlet property="chooseAPasswordLabel" destination="BLe-wx-zKe" id="pN5-s7-AEm"/> <outlet property="choosePasswordViewHeightConstraint" destination="gCv-h4-eLK" id="d0K-zb-sSB"/> <outlet property="confirmPasswordTextField" destination="ODL-4B-fCm" id="CNa-S1-DmO"/> <outlet property="containerViewBottomConstraint" destination="MAL-nV-nsP" id="gNC-rt-Yuq"/> <outlet property="createAccountButton" destination="05l-0O-Ql0" id="UQq-NA-axm"/> - <outlet property="createAccountTitle" destination="cAM-lf-Iex" id="6df-0w-qzU"/> <outlet property="enableNotificationsLabel" destination="v2K-7x-35g" id="Llc-op-X6a"/> <outlet property="notificationsSwitch" destination="8uM-V9-rGD" id="roL-7x-Kj3"/> <outlet property="passwordErrorLabel" destination="IWj-x1-hN9" id="VhJ-5w-sS4"/> diff --git a/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.swift b/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.swift index f1f51b3a7be7cd6b046fecf35ff405f5877bf15f..9630aff4831639d46462b352e9900b33c158330d 100644 --- a/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.swift +++ b/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.swift @@ -28,13 +28,11 @@ class CreateAccountViewController: UIViewController, StoryboardBased, ViewModelB // MARK: outlets @IBOutlet weak var createAccountButton: DesignableButton! - @IBOutlet weak var createAccountTitle: UILabel! @IBOutlet weak var registerUsernameHeightConstraint: NSLayoutConstraint! { didSet { self.registerUsernameHeightConstraintConstant = registerUsernameHeightConstraint.constant } } - @IBOutlet weak var backgroundNavigationBarHeightConstraint: NSLayoutConstraint! @IBOutlet weak var choosePasswordViewHeightConstraint: NSLayoutConstraint! @IBOutlet weak var scrollViewBottomConstraint: NSLayoutConstraint! @IBOutlet weak var usernameSwitch: UISwitch! @@ -71,12 +69,12 @@ class CreateAccountViewController: UIViewController, StoryboardBased, ViewModelB self.applyL10n() super.viewDidLoad() self.view.layoutIfNeeded() + configureWalkrhroughNavigationBar() // Style self.scrollView.alwaysBounceHorizontal = false self.scrollView.alwaysBounceVertical = true self.createAccountButton.applyGradient(with: [UIColor.jamiButtonLight, UIColor.jamiButtonDark], gradient: .horizontal) - self.backgroundNavigationBarHeightConstraint.constant = UIApplication.shared.statusBarFrame.height self.usernameTextField.becomeFirstResponder() self.usernameTextField.tintColor = UIColor.jamiSecondary self.passwordTextField.tintColor = UIColor.jamiSecondary @@ -91,6 +89,18 @@ class CreateAccountViewController: UIViewController, StoryboardBased, ViewModelB // handle keyboard self.adaptToKeyboardState(for: self.scrollView, with: self.disposeBag) keyboardDismissTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard)) + NotificationCenter.default.rx.notification(UIDevice.orientationDidChangeNotification) + .observeOn(MainScheduler.instance) + .subscribe(onNext: { [weak self] (_) in + self?.createAccountButton.updateGradientFrame() + self?.configureWalkrhroughNavigationBar() + if self?.registerPasswordView.isHidden ?? true { + return + } + guard let height = self?.passwordInfoLabel.frame.height else {return} + self?.choosePasswordViewHeightConstraint.constant = 133 + height + self?.view.layoutIfNeeded() + }).disposed(by: self.disposeBag) } override func viewWillAppear(_ animated: Bool) { @@ -140,8 +150,8 @@ class CreateAccountViewController: UIViewController, StoryboardBased, ViewModelB } private func applyL10n() { - self.createAccountTitle.text = self.viewModel.createAccountTitle - self.createAccountButton.setTitle(self.viewModel.createAccountButton, for: .normal) + self.createAccountButton + .setTitle(self.viewModel.createAccountButton, for: .normal) self.usernameTextField.placeholder = self.viewModel.usernameTitle self.passwordTextField.placeholder = self.viewModel.passwordTitle self.confirmPasswordTextField.placeholder = self.viewModel.confirmPasswordTitle @@ -150,6 +160,7 @@ class CreateAccountViewController: UIViewController, StoryboardBased, ViewModelB self.passwordInfoLabel.text = self.viewModel.passwordInfoTitle self.enableNotificationsLabel.text = self.viewModel.enableNotificationsTitle self.recommendedLabel.text = self.viewModel.recommendedTitle + self.navigationItem.title = self.viewModel.createAccountTitle } private func bindViewModelToView() { @@ -244,6 +255,7 @@ class CreateAccountViewController: UIViewController, StoryboardBased, ViewModelB self?.passwordTextField.text = "" self?.confirmPasswordTextField.text = "" self?.passwordErrorLabel.isHidden = true + self?.registerPasswordView.isHidden = true } self?.setContentInset() self?.view.layoutIfNeeded() diff --git a/Ring/Ring/Features/Walkthrough/CreateProfile/CreateProfileViewController.storyboard b/Ring/Ring/Features/Walkthrough/CreateProfile/CreateProfileViewController.storyboard index 9344c52a91bde3d1f5ca307b2a7c70875ad74032..2443ad7c52287a09ee571f0e303dc626c602e315 100644 --- a/Ring/Ring/Features/Walkthrough/CreateProfile/CreateProfileViewController.storyboard +++ b/Ring/Ring/Features/Walkthrough/CreateProfile/CreateProfileViewController.storyboard @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="1yn-Mj-8Ek"> - <device id="retina6_5" orientation="portrait"> - <adaptation id="fullscreen"/> - </device> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="1yn-Mj-8Ek"> + <device id="retina3_5" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> @@ -17,51 +15,32 @@ <viewControllerLayoutGuide type="top" id="zoc-y0-mpa"/> <viewControllerLayoutGuide type="bottom" id="fB8-X7-N5u"/> </layoutGuides> - <view key="view" clipsSubviews="YES" contentMode="scaleToFill" id="N1T-Xh-FH1"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <view key="view" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="N1T-Xh-FH1"> + <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> <subviews> - <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" keyboardDismissMode="interactive" translatesAutoresizingMaskIntoConstraints="NO" id="onC-vk-VGN"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" keyboardDismissMode="interactive" translatesAutoresizingMaskIntoConstraints="NO" id="onC-vk-VGN"> + <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0Yq-n7-91P"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <rect key="frame" x="0.0" y="0.0" width="320" height="547"/> <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Personalise your profile !" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="awD-Hy-m7O" userLabel="Create Profil Account Title"> - <rect key="frame" x="41" y="20" width="332" height="37"/> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="31"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> - <color key="value" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor"> - <color key="value" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="color" keyPath="gradientEndColor"> - <color key="value" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> - </userDefinedRuntimeAttribute> - </userDefinedRuntimeAttributes> - </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Your profile will be shared with your contacts. You can change it at any time." textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8lL-e0-PFL" userLabel="Subtitle"> - <rect key="frame" x="43" y="62" width="328" height="38.333333333333343"/> + <rect key="frame" x="20" y="20" width="280" height="38.5"/> <fontDescription key="fontDescription" type="system" weight="ultraLight" pointSize="16"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter a display name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="N1N-hn-LTy" userLabel="Enter Name Label"> - <rect key="frame" x="124" y="255" width="166" height="22"/> + <rect key="frame" x="79.5" y="220" width="161" height="22"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter name" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Ebb-h3-1X3" userLabel="Profile Name Edit Text"> - <rect key="frame" x="92" y="287" width="230" height="50"/> + <rect key="frame" x="35" y="252" width="250" height="50"/> <constraints> <constraint firstAttribute="height" constant="50" id="V3Q-1d-nI7"/> </constraints> - <nil key="textColor"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="no" returnKeyType="done"/> <userDefinedRuntimeAttributes> @@ -75,10 +54,11 @@ </userDefinedRuntimeAttributes> </textField> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5Po-6e-k14" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="92" y="352" width="230" height="50"/> + <rect key="frame" x="35" y="317" width="250" height="50"/> <constraints> <constraint firstAttribute="height" constant="50" id="2ir-B7-kVX"/> - <constraint firstAttribute="width" constant="230" id="DZF-Ea-XUf"/> + <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="250" id="DZF-Ea-XUf"/> + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="500" id="jL1-sS-ZJS"/> </constraints> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <state key="normal" title="Skip"> @@ -89,7 +69,7 @@ </userDefinedRuntimeAttributes> </button> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="add_avatar" translatesAutoresizingMaskIntoConstraints="NO" id="Wss-Rm-aKz"> - <rect key="frame" x="-49" y="116.33333333333331" width="512" height="120"/> + <rect key="frame" x="96" y="74.5" width="128" height="120"/> <color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> <constraint firstAttribute="height" constant="120" id="Edd-cj-Zhl"/> @@ -99,22 +79,22 @@ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> <constraint firstItem="Ebb-h3-1X3" firstAttribute="centerX" secondItem="0Yq-n7-91P" secondAttribute="centerX" id="3Do-Tm-CjF"/> - <constraint firstItem="8lL-e0-PFL" firstAttribute="top" secondItem="awD-Hy-m7O" secondAttribute="bottom" constant="5" id="3F6-Ff-39y"/> <constraint firstItem="Wss-Rm-aKz" firstAttribute="centerY" secondItem="8lL-e0-PFL" secondAttribute="centerY" constant="95" id="8Qr-wz-HY8"/> - <constraint firstItem="8lL-e0-PFL" firstAttribute="leading" secondItem="awD-Hy-m7O" secondAttribute="leading" constant="2" id="9JW-wG-hwj"/> - <constraint firstItem="awD-Hy-m7O" firstAttribute="centerX" secondItem="0Yq-n7-91P" secondAttribute="centerX" id="Aga-Wd-ufN"/> <constraint firstItem="Ebb-h3-1X3" firstAttribute="trailing" secondItem="5Po-6e-k14" secondAttribute="trailing" id="Bpd-sp-mVf"/> - <constraint firstItem="8lL-e0-PFL" firstAttribute="centerX" secondItem="awD-Hy-m7O" secondAttribute="centerX" id="DsF-5E-I7H"/> + <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="5Po-6e-k14" secondAttribute="bottom" constant="20" id="C0I-Z6-nEd"/> <constraint firstItem="5Po-6e-k14" firstAttribute="top" secondItem="Ebb-h3-1X3" secondAttribute="bottom" constant="15" id="GKk-BK-UGw"/> <constraint firstItem="N1N-hn-LTy" firstAttribute="centerX" secondItem="0Yq-n7-91P" secondAttribute="centerX" id="Jec-k5-B5z"/> <constraint firstItem="N1N-hn-LTy" firstAttribute="bottom" secondItem="Ebb-h3-1X3" secondAttribute="top" constant="-10" id="K28-vG-Lqa"/> - <constraint firstItem="awD-Hy-m7O" firstAttribute="trailing" secondItem="8lL-e0-PFL" secondAttribute="trailing" constant="2" id="MbE-QI-d41"/> - <constraint firstItem="awD-Hy-m7O" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="0Yq-n7-91P" secondAttribute="leading" constant="30" id="PLT-r4-IJi"/> - <constraint firstItem="awD-Hy-m7O" firstAttribute="top" secondItem="0Yq-n7-91P" secondAttribute="top" constant="20" id="RH8-9b-Zoa"/> + <constraint firstItem="N1N-hn-LTy" firstAttribute="top" secondItem="0Yq-n7-91P" secondAttribute="top" constant="220" id="WgC-Wh-cmt"/> + <constraint firstAttribute="trailing" secondItem="5Po-6e-k14" secondAttribute="trailing" priority="750" constant="40" id="YJG-QC-xff"/> <constraint firstItem="Wss-Rm-aKz" firstAttribute="centerX" secondItem="0Yq-n7-91P" secondAttribute="centerX" id="cwW-zq-rDS"/> - <constraint firstItem="Ebb-h3-1X3" firstAttribute="top" secondItem="awD-Hy-m7O" secondAttribute="bottom" constant="230" id="pUg-Md-sif"/> + <constraint firstItem="8lL-e0-PFL" firstAttribute="leading" secondItem="0Yq-n7-91P" secondAttribute="leading" constant="20" id="diu-8a-jY8"/> + <constraint firstAttribute="trailing" secondItem="8lL-e0-PFL" secondAttribute="trailing" constant="20" id="dwF-Md-Tf0"/> + <constraint firstItem="8lL-e0-PFL" firstAttribute="top" secondItem="0Yq-n7-91P" secondAttribute="top" constant="20" id="mOP-8U-7x4"/> + <constraint firstItem="5Po-6e-k14" firstAttribute="leading" secondItem="0Yq-n7-91P" secondAttribute="leading" priority="750" constant="40" id="rE9-rc-bIL"/> <constraint firstItem="Ebb-h3-1X3" firstAttribute="leading" secondItem="5Po-6e-k14" secondAttribute="leading" id="vDa-Un-6um"/> <constraint firstItem="5Po-6e-k14" firstAttribute="centerX" secondItem="0Yq-n7-91P" secondAttribute="centerX" id="y3z-G3-Ew5"/> + <constraint firstAttribute="height" constant="547" id="yRv-3a-fTC"/> </constraints> </view> </subviews> @@ -124,20 +104,21 @@ <constraint firstItem="0Yq-n7-91P" firstAttribute="centerX" secondItem="onC-vk-VGN" secondAttribute="centerX" id="Slz-Um-pcQ"/> <constraint firstItem="0Yq-n7-91P" firstAttribute="leading" secondItem="onC-vk-VGN" secondAttribute="leading" id="bVK-Hs-dbe"/> <constraint firstItem="0Yq-n7-91P" firstAttribute="top" secondItem="onC-vk-VGN" secondAttribute="top" id="fPr-Fq-DBB"/> + <constraint firstItem="0Yq-n7-91P" firstAttribute="width" secondItem="onC-vk-VGN" secondAttribute="width" id="rrj-uK-8A3"/> </constraints> </scrollView> <view hidden="YES" alpha="0.0" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SRA-lP-OD3" userLabel="Info View"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> <subviews> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="add_avatar" translatesAutoresizingMaskIntoConstraints="NO" id="z2z-6h-lsY"> - <rect key="frame" x="-49" y="116.33333333333331" width="512" height="120"/> + <rect key="frame" x="96" y="74.5" width="128" height="120"/> <color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> <constraint firstAttribute="height" constant="120" id="6Y2-EN-n8A"/> </constraints> </imageView> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="info_arrow" translatesAutoresizingMaskIntoConstraints="NO" id="RuJ-k9-6d2" userLabel="Arrow"> - <rect key="frame" x="91" y="231.33333333333337" width="72" height="80"/> + <rect key="frame" x="44" y="189.5" width="72" height="80"/> <color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> <constraint firstAttribute="height" constant="80" id="RIv-ZQ-8Uw"/> @@ -145,7 +126,7 @@ </constraints> </imageView> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Create your avatar" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dwE-6U-bqU"> - <rect key="frame" x="27" y="316.33333333333331" width="160" height="55.666666666666686"/> + <rect key="frame" x="0.0" y="274.5" width="160" height="56"/> <constraints> <constraint firstAttribute="width" constant="160" id="emA-LP-rz8"/> </constraints> @@ -176,8 +157,6 @@ <constraint firstItem="z2z-6h-lsY" firstAttribute="top" secondItem="Wss-Rm-aKz" secondAttribute="top" id="h8q-jk-Q0P"/> <constraint firstItem="z2z-6h-lsY" firstAttribute="leading" secondItem="Wss-Rm-aKz" secondAttribute="leading" id="ilh-ac-a6m"/> <constraint firstAttribute="bottom" secondItem="onC-vk-VGN" secondAttribute="bottom" id="kIf-ew-JtO"/> - <constraint firstItem="0Yq-n7-91P" firstAttribute="height" secondItem="N1T-Xh-FH1" secondAttribute="height" id="lMB-G4-4Tm"/> - <constraint firstItem="0Yq-n7-91P" firstAttribute="width" secondItem="N1T-Xh-FH1" secondAttribute="width" id="pW7-2U-vWL"/> <constraint firstItem="onC-vk-VGN" firstAttribute="top" secondItem="N1T-Xh-FH1" secondAttribute="top" id="zTu-Eg-J4X"/> <constraint firstItem="SRA-lP-OD3" firstAttribute="height" secondItem="N1T-Xh-FH1" secondAttribute="height" id="zvp-kO-3Dx"/> </constraints> @@ -186,7 +165,6 @@ <outlet property="arrow" destination="RuJ-k9-6d2" id="sfC-3H-hGp"/> <outlet property="arrowHeightConstraint" destination="RIv-ZQ-8Uw" id="wPN-ra-uLi"/> <outlet property="arrowYConstraint" destination="SXy-dy-AW4" id="tL4-Ml-YxQ"/> - <outlet property="createProfilAccountTitle" destination="awD-Hy-m7O" id="0tW-KX-h7q"/> <outlet property="createYourAvatarLabel" destination="dwE-6U-bqU" id="eNT-V7-RAm"/> <outlet property="enterNameLabel" destination="N1N-hn-LTy" id="4gq-l5-bHn"/> <outlet property="infoProfileImage" destination="z2z-6h-lsY" id="XkJ-uW-3b9"/> @@ -201,11 +179,11 @@ </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="6ma-i4-SuK" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> - <point key="canvasLocation" x="1104.8" y="366.50246305418722"/> + <point key="canvasLocation" x="1104.3478260869565" y="366.29464285714283"/> </scene> </scenes> <resources> - <image name="add_avatar" width="512" height="512"/> - <image name="info_arrow" width="122.87999725341797" height="122.87999725341797"/> + <image name="add_avatar" width="128" height="128"/> + <image name="info_arrow" width="128" height="128"/> </resources> </document> diff --git a/Ring/Ring/Features/Walkthrough/CreateProfile/CreateProfileViewController.swift b/Ring/Ring/Features/Walkthrough/CreateProfile/CreateProfileViewController.swift index c59ebf564be558974e56895f128da29874367a64..7eef2856458abb99952e87201d45ae2ad1419d6c 100644 --- a/Ring/Ring/Features/Walkthrough/CreateProfile/CreateProfileViewController.swift +++ b/Ring/Ring/Features/Walkthrough/CreateProfile/CreateProfileViewController.swift @@ -34,7 +34,6 @@ class CreateProfileViewController: EditProfileViewController, StoryboardBased, V @IBOutlet weak var arrowHeightConstraint: NSLayoutConstraint! @IBOutlet weak var enterNameLabel: UILabel! @IBOutlet weak var arrowYConstraint: NSLayoutConstraint! - @IBOutlet weak var createProfilAccountTitle: UILabel! @IBOutlet weak var skipButton: DesignableButton! @IBOutlet weak var profileImageViewHeightConstraint: NSLayoutConstraint! @IBOutlet weak var scrollView: UIScrollView! @@ -55,6 +54,7 @@ class CreateProfileViewController: EditProfileViewController, StoryboardBased, V override func viewDidLoad() { super.viewDidLoad() self.view.layoutIfNeeded() + self.configureWalkrhroughNavigationBar() // Style self.skipButton.applyGradient(with: [UIColor.jamiButtonLight, UIColor.jamiButtonDark], gradient: .horizontal) @@ -125,6 +125,12 @@ class CreateProfileViewController: EditProfileViewController, StoryboardBased, V // handle keyboard self.adaptToKeyboardState(for: self.scrollView, with: self.disposeBag) keyboardDismissTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard)) + NotificationCenter.default.rx.notification(UIDevice.orientationDidChangeNotification) + .observeOn(MainScheduler.instance) + .subscribe(onNext: { [weak self] (_) in + self?.skipButton.updateGradientFrame() + self?.self.configureWalkrhroughNavigationBar() + }).disposed(by: self.disposeBag) } func dismissInfoView() { @@ -156,7 +162,7 @@ class CreateProfileViewController: EditProfileViewController, StoryboardBased, V } func applyL10n() { - self.createProfilAccountTitle.text = L10n.CreateProfile.title + self.navigationItem.title = L10n.CreateProfile.title self.enterNameLabel.text = L10n.CreateProfile.enterNameLabel self.profileName.placeholder = L10n.CreateProfile.enterNamePlaceholder self.subtitle.text = L10n.CreateProfile.subtitle @@ -198,7 +204,7 @@ class CreateProfileViewController: EditProfileViewController, StoryboardBased, V override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - self.navigationController?.isNavigationBarHidden = true + self.navigationItem.setHidesBackButton(true, animated: true); NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillAppear(withNotification:)), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillDisappear(withNotification:)), name: UIResponder.keyboardWillHideNotification, object: nil) } diff --git a/Ring/Ring/Features/Walkthrough/CreateSipAccount/CreateSipAccountViewController.storyboard b/Ring/Ring/Features/Walkthrough/CreateSipAccount/CreateSipAccountViewController.storyboard index cb9d6d6196c601fe2ad50b5785256d071f1b3dc6..c9932670d2a80b9be168e62526b5310190249fbb 100644 --- a/Ring/Ring/Features/Walkthrough/CreateSipAccount/CreateSipAccountViewController.storyboard +++ b/Ring/Ring/Features/Walkthrough/CreateSipAccount/CreateSipAccountViewController.storyboard @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="byn-Xz-pFs"> - <device id="retina4_7" orientation="portrait"> - <adaptation id="fullscreen"/> - </device> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="byn-Xz-pFs"> + <device id="ipad12_9rounded" orientation="portrait" layout="fullscreen" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -15,211 +13,227 @@ <objects> <viewController id="byn-Xz-pFs" customClass="CreateSipAccountViewController" customModule="Ring" customModuleProvider="target" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="aFo-X0-5xr"> - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> + <rect key="frame" x="0.0" y="0.0" width="1024" height="1366"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bWc-84-zq0"> - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bWc-84-zq0"> + <rect key="frame" x="0.0" y="0.0" width="1024" height="1346"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="daQ-3e-VKq"> - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> + <rect key="frame" x="0.0" y="0.0" width="1024" height="510"/> <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Create Sip Account" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="q4D-AI-cLY" userLabel="Create Profil Account Title"> - <rect key="frame" x="66" y="-40" width="243.5" height="37"/> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="31"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter username" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="egE-LH-3eV"> - <rect key="frame" x="20" y="17" width="126.5" height="25"/> + <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="hXV-Wg-kt6"> + <rect key="frame" x="262" y="20" width="500" height="490"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter username" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="egE-LH-3eV"> + <rect key="frame" x="0.0" y="0.0" width="125" height="25"/> + <constraints> + <constraint firstAttribute="height" constant="25" id="9vc-0c-G5e"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Username" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="z8V-FO-hxu" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="0.0" y="35" width="500" height="50"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <constraints> + <constraint firstAttribute="height" constant="50" id="u9v-7k-LVp"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <textInputTraits key="textInputTraits" autocorrectionType="no"/> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> + <real key="value" value="1.5"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> + <color key="value" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> + <real key="value" value="0.0"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + </userDefinedRuntimeAttributes> + </textField> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PXC-NU-oae"> + <rect key="frame" x="0.0" y="95" width="240" height="5"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstAttribute="height" constant="5" id="Rj8-pH-S9A"/> + </constraints> + </view> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter password" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h1h-xB-2Im"> + <rect key="frame" x="0.0" y="110" width="122" height="25"/> + <constraints> + <constraint firstAttribute="height" constant="25" id="oaL-if-aDl"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="N2t-MA-mli" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="0.0" y="145" width="500" height="50"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <constraints> + <constraint firstAttribute="height" constant="50" id="cE3-Nh-dtO"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <textInputTraits key="textInputTraits" autocorrectionType="no" secureTextEntry="YES"/> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> + <real key="value" value="1.5"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> + <color key="value" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> + <real key="value" value="0.0"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + </userDefinedRuntimeAttributes> + </textField> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GBs-8X-160"> + <rect key="frame" x="0.0" y="205" width="240" height="5"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstAttribute="height" constant="5" id="Nfw-l5-Btp"/> + </constraints> + </view> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter address" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fvE-N1-hV5"> + <rect key="frame" x="0.0" y="220" width="109" height="25"/> + <constraints> + <constraint firstAttribute="height" constant="25" id="l8j-PP-hGk"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="SIP server" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Cvg-vc-c1h" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="0.0" y="255" width="500" height="50"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <constraints> + <constraint firstAttribute="height" constant="50" id="RY0-bS-AlD"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <textInputTraits key="textInputTraits" autocorrectionType="no"/> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> + <real key="value" value="1.5"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> + <color key="value" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> + <real key="value" value="0.0"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + </userDefinedRuntimeAttributes> + </textField> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8dc-VU-ZYw"> + <rect key="frame" x="0.0" y="315" width="240" height="5"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstAttribute="height" constant="5" id="7t5-jC-VH8"/> + </constraints> + </view> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter port number" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7Ty-fL-k78"> + <rect key="frame" x="0.0" y="330" width="143.5" height="25"/> + <constraints> + <constraint firstAttribute="height" constant="25" id="xic-Xq-kDh"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Port" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Qnv-UR-Yys" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="0.0" y="365" width="500" height="50"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <constraints> + <constraint firstAttribute="height" constant="50" id="3Rx-v3-noT"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <textInputTraits key="textInputTraits" autocorrectionType="no"/> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> + <real key="value" value="1.5"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> + <color key="value" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> + <real key="value" value="0.0"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + </userDefinedRuntimeAttributes> + </textField> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tAe-tp-fMs"> + <rect key="frame" x="0.0" y="425" width="240" height="5"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstAttribute="height" constant="5" id="ajc-60-oYL"/> + </constraints> + </view> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="31a-Gd-rzz" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="0.0" y="440" width="500" height="50"/> + <constraints> + <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="250" id="cfM-2g-N92"/> + <constraint firstAttribute="height" constant="50" id="gOi-cQ-1dn"/> + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="500" id="lC5-QK-Vni"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <state key="normal" title="Create account"/> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + </userDefinedRuntimeAttributes> + </button> + </subviews> <constraints> - <constraint firstAttribute="height" constant="25" id="9vc-0c-G5e"/> + <constraint firstItem="31a-Gd-rzz" firstAttribute="trailing" secondItem="z8V-FO-hxu" secondAttribute="trailing" id="6XO-Wf-Kmr"/> + <constraint firstItem="N2t-MA-mli" firstAttribute="leading" secondItem="z8V-FO-hxu" secondAttribute="leading" id="Acr-sj-UHT"/> + <constraint firstItem="Qnv-UR-Yys" firstAttribute="leading" secondItem="z8V-FO-hxu" secondAttribute="leading" id="BEK-Zp-ucN"/> + <constraint firstItem="N2t-MA-mli" firstAttribute="trailing" secondItem="z8V-FO-hxu" secondAttribute="trailing" id="V4K-Yu-NzQ"/> + <constraint firstItem="Cvg-vc-c1h" firstAttribute="trailing" secondItem="z8V-FO-hxu" secondAttribute="trailing" id="XxH-Mj-AxB"/> + <constraint firstItem="Cvg-vc-c1h" firstAttribute="leading" secondItem="z8V-FO-hxu" secondAttribute="leading" id="mUc-GG-N9b"/> + <constraint firstAttribute="trailing" secondItem="31a-Gd-rzz" secondAttribute="trailing" id="sKj-U2-J65"/> + <constraint firstItem="Qnv-UR-Yys" firstAttribute="trailing" secondItem="z8V-FO-hxu" secondAttribute="trailing" id="v6i-U1-pPv"/> + <constraint firstItem="31a-Gd-rzz" firstAttribute="leading" secondItem="z8V-FO-hxu" secondAttribute="leading" id="wK4-xm-lJu"/> + <constraint firstItem="31a-Gd-rzz" firstAttribute="leading" secondItem="hXV-Wg-kt6" secondAttribute="leading" id="z6Z-fw-Kka"/> </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Username" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="z8V-FO-hxu" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="20" y="50" width="335" height="50"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="50" id="u9v-7k-LVp"/> - </constraints> - <nil key="textColor"/> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <textInputTraits key="textInputTraits" autocorrectionType="no"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> - <real key="value" value="1.5"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> - <color key="value" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> - <real key="value" value="0.0"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - </userDefinedRuntimeAttributes> - </textField> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter password" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h1h-xB-2Im"> - <rect key="frame" x="20" y="120" width="124" height="25"/> - <constraints> - <constraint firstAttribute="height" constant="25" id="oaL-if-aDl"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="N2t-MA-mli" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="20" y="153" width="335" height="50"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="50" id="cE3-Nh-dtO"/> - </constraints> - <nil key="textColor"/> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <textInputTraits key="textInputTraits" autocorrectionType="no" secureTextEntry="YES"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> - <real key="value" value="1.5"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> - <color key="value" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> - <real key="value" value="0.0"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - </userDefinedRuntimeAttributes> - </textField> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter address" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fvE-N1-hV5"> - <rect key="frame" x="20" y="223" width="111" height="25"/> - <constraints> - <constraint firstAttribute="height" constant="25" id="l8j-PP-hGk"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="SIP server" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Cvg-vc-c1h" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="20" y="256" width="335" height="50"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="50" id="RY0-bS-AlD"/> - </constraints> - <nil key="textColor"/> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <textInputTraits key="textInputTraits" autocorrectionType="no"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> - <real key="value" value="1.5"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> - <color key="value" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> - <real key="value" value="0.0"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - </userDefinedRuntimeAttributes> - </textField> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter port number" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7Ty-fL-k78"> - <rect key="frame" x="20" y="326" width="146.5" height="25"/> - <constraints> - <constraint firstAttribute="height" constant="25" id="xic-Xq-kDh"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Port" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Qnv-UR-Yys" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="20" y="359" width="335" height="50"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="50" id="3Rx-v3-noT"/> - </constraints> - <nil key="textColor"/> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <textInputTraits key="textInputTraits" autocorrectionType="no"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> - <real key="value" value="1.5"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> - <color key="value" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> - <real key="value" value="0.0"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - </userDefinedRuntimeAttributes> - </textField> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="31a-Gd-rzz" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="20" y="429" width="335" height="50"/> - <constraints> - <constraint firstAttribute="height" constant="50" id="gOi-cQ-1dn"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <state key="normal" title="Create account"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - </userDefinedRuntimeAttributes> - </button> + </stackView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> - <constraint firstItem="egE-LH-3eV" firstAttribute="leading" secondItem="z8V-FO-hxu" secondAttribute="leading" id="3og-Yo-Xgg"/> - <constraint firstItem="31a-Gd-rzz" firstAttribute="top" secondItem="Qnv-UR-Yys" secondAttribute="bottom" constant="20" id="5fP-pv-m6f"/> - <constraint firstItem="N2t-MA-mli" firstAttribute="leading" secondItem="z8V-FO-hxu" secondAttribute="leading" id="5mF-bX-wqK"/> - <constraint firstAttribute="trailing" secondItem="31a-Gd-rzz" secondAttribute="trailing" constant="20" id="7WB-jL-7J4"/> - <constraint firstItem="egE-LH-3eV" firstAttribute="top" secondItem="q4D-AI-cLY" secondAttribute="bottom" constant="20" id="8Yd-v1-Oow"/> - <constraint firstItem="7Ty-fL-k78" firstAttribute="top" secondItem="Cvg-vc-c1h" secondAttribute="bottom" constant="20" id="9HP-Hz-CIm"/> - <constraint firstItem="Qnv-UR-Yys" firstAttribute="top" secondItem="7Ty-fL-k78" secondAttribute="bottom" constant="8" id="AJN-PW-ML2"/> - <constraint firstItem="q4D-AI-cLY" firstAttribute="top" secondItem="daQ-3e-VKq" secondAttribute="top" constant="-40" id="CYO-kG-9Mt"/> - <constraint firstItem="fvE-N1-hV5" firstAttribute="top" secondItem="N2t-MA-mli" secondAttribute="bottom" constant="20" id="F6r-0F-D52"/> - <constraint firstItem="Cvg-vc-c1h" firstAttribute="trailing" secondItem="31a-Gd-rzz" secondAttribute="trailing" id="HoI-pa-TLg"/> - <constraint firstItem="h1h-xB-2Im" firstAttribute="top" secondItem="z8V-FO-hxu" secondAttribute="bottom" constant="20" id="LV8-g9-9y5"/> - <constraint firstItem="Cvg-vc-c1h" firstAttribute="leading" secondItem="31a-Gd-rzz" secondAttribute="leading" id="QJv-fs-d6g"/> - <constraint firstItem="N2t-MA-mli" firstAttribute="trailing" secondItem="z8V-FO-hxu" secondAttribute="trailing" id="WlF-XM-ROf"/> - <constraint firstItem="31a-Gd-rzz" firstAttribute="leading" secondItem="daQ-3e-VKq" secondAttribute="leading" constant="20" id="aUB-Vq-LyX"/> - <constraint firstItem="z8V-FO-hxu" firstAttribute="top" secondItem="egE-LH-3eV" secondAttribute="bottom" constant="8" id="boU-wG-gUp"/> - <constraint firstItem="Cvg-vc-c1h" firstAttribute="trailing" secondItem="z8V-FO-hxu" secondAttribute="trailing" id="hVy-P0-IgT"/> - <constraint firstItem="Cvg-vc-c1h" firstAttribute="leading" secondItem="z8V-FO-hxu" secondAttribute="leading" id="hf2-WV-kv6"/> - <constraint firstItem="7Ty-fL-k78" firstAttribute="leading" secondItem="Qnv-UR-Yys" secondAttribute="leading" id="k2m-zT-47V"/> - <constraint firstItem="N2t-MA-mli" firstAttribute="top" secondItem="h1h-xB-2Im" secondAttribute="bottom" constant="8" id="lce-Gy-7bi"/> - <constraint firstItem="q4D-AI-cLY" firstAttribute="centerX" secondItem="daQ-3e-VKq" secondAttribute="centerX" id="qsg-qx-WAf"/> - <constraint firstItem="z8V-FO-hxu" firstAttribute="centerX" secondItem="daQ-3e-VKq" secondAttribute="centerX" id="sfJ-Ok-aD3"/> - <constraint firstItem="fvE-N1-hV5" firstAttribute="leading" secondItem="Cvg-vc-c1h" secondAttribute="leading" id="tnC-mO-z9j"/> - <constraint firstItem="Qnv-UR-Yys" firstAttribute="trailing" secondItem="Cvg-vc-c1h" secondAttribute="trailing" id="uIf-vm-cp4"/> - <constraint firstItem="h1h-xB-2Im" firstAttribute="leading" secondItem="N2t-MA-mli" secondAttribute="leading" id="vde-c5-RpZ"/> - <constraint firstItem="Qnv-UR-Yys" firstAttribute="leading" secondItem="Cvg-vc-c1h" secondAttribute="leading" id="wZr-86-mVg"/> - <constraint firstItem="Cvg-vc-c1h" firstAttribute="top" secondItem="fvE-N1-hV5" secondAttribute="bottom" constant="8" id="xT7-as-01A"/> + <constraint firstAttribute="bottom" secondItem="hXV-Wg-kt6" secondAttribute="bottom" id="Bm9-i4-cTi"/> + <constraint firstAttribute="trailing" secondItem="hXV-Wg-kt6" secondAttribute="trailing" priority="750" constant="40" id="JJO-KH-cOP"/> + <constraint firstItem="hXV-Wg-kt6" firstAttribute="centerX" secondItem="daQ-3e-VKq" secondAttribute="centerX" id="RFU-L5-BJo"/> + <constraint firstItem="hXV-Wg-kt6" firstAttribute="top" secondItem="daQ-3e-VKq" secondAttribute="top" constant="20" id="VAG-cb-TWE"/> + <constraint firstItem="hXV-Wg-kt6" firstAttribute="leading" secondItem="daQ-3e-VKq" secondAttribute="leading" priority="750" constant="40" id="tdh-cX-abZ"/> </constraints> </view> </subviews> <constraints> - <constraint firstAttribute="bottom" secondItem="daQ-3e-VKq" secondAttribute="bottom" id="OH3-eK-jO7"/> - <constraint firstAttribute="trailing" secondItem="daQ-3e-VKq" secondAttribute="trailing" id="ONB-lE-t9I"/> - <constraint firstItem="daQ-3e-VKq" firstAttribute="leading" secondItem="bWc-84-zq0" secondAttribute="leading" id="ps7-7A-rwj"/> - <constraint firstItem="daQ-3e-VKq" firstAttribute="top" secondItem="bWc-84-zq0" secondAttribute="top" id="xiZ-IE-7X9"/> + <constraint firstItem="daQ-3e-VKq" firstAttribute="trailing" secondItem="KRr-aS-KGV" secondAttribute="trailing" id="2j2-PN-wAR"/> + <constraint firstItem="daQ-3e-VKq" firstAttribute="width" secondItem="bWc-84-zq0" secondAttribute="width" id="QX6-4x-Qdq"/> + <constraint firstItem="daQ-3e-VKq" firstAttribute="leading" secondItem="KRr-aS-KGV" secondAttribute="leading" id="hC1-QE-J5Z"/> + <constraint firstItem="daQ-3e-VKq" firstAttribute="bottom" secondItem="KRr-aS-KGV" secondAttribute="bottom" id="iBz-ha-O9K"/> + <constraint firstItem="daQ-3e-VKq" firstAttribute="top" secondItem="KRr-aS-KGV" secondAttribute="top" id="tk9-N6-pmH"/> </constraints> + <viewLayoutGuide key="contentLayoutGuide" id="KRr-aS-KGV"/> + <viewLayoutGuide key="frameLayoutGuide" id="mB0-cN-odP"/> </scrollView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> - <constraint firstItem="daQ-3e-VKq" firstAttribute="height" secondItem="aFo-X0-5xr" secondAttribute="height" id="IGh-bP-XHJ"/> - <constraint firstItem="bWc-84-zq0" firstAttribute="top" secondItem="aFo-X0-5xr" secondAttribute="top" id="NBB-ha-XJP"/> + <constraint firstItem="bWc-84-zq0" firstAttribute="top" secondItem="asY-zx-uYD" secondAttribute="top" id="BWt-Ts-r1X"/> <constraint firstItem="bWc-84-zq0" firstAttribute="bottom" secondItem="asY-zx-uYD" secondAttribute="bottom" id="NaE-Gc-UqN"/> <constraint firstItem="bWc-84-zq0" firstAttribute="trailing" secondItem="asY-zx-uYD" secondAttribute="trailing" id="caV-LG-Eex"/> <constraint firstItem="bWc-84-zq0" firstAttribute="leading" secondItem="asY-zx-uYD" secondAttribute="leading" id="hpi-wM-YSd"/> - <constraint firstItem="daQ-3e-VKq" firstAttribute="width" secondItem="aFo-X0-5xr" secondAttribute="width" id="rrh-dd-NsA"/> </constraints> <viewLayoutGuide key="safeArea" id="asY-zx-uYD"/> </view> <connections> <outlet property="createAccountButton" destination="31a-Gd-rzz" id="emU-Tv-WdU"/> - <outlet property="createAccountLabel" destination="q4D-AI-cLY" id="Vhm-W9-YVC"/> <outlet property="passwordLabel" destination="h1h-xB-2Im" id="gNl-Yq-JdG"/> <outlet property="passwordTextField" destination="N2t-MA-mli" id="A0W-4E-Lmu"/> <outlet property="portLabel" destination="7Ty-fL-k78" id="nOP-9u-2R3"/> @@ -233,7 +247,7 @@ </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="4Xf-UL-hcY" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> - <point key="canvasLocation" x="45.600000000000001" y="147.97601199400302"/> + <point key="canvasLocation" x="45.185185185185183" y="147.77777777777777"/> </scene> </scenes> </document> diff --git a/Ring/Ring/Features/Walkthrough/CreateSipAccount/CreateSipAccountViewController.swift b/Ring/Ring/Features/Walkthrough/CreateSipAccount/CreateSipAccountViewController.swift index 7d660843bbd1afd4a71b5a75929fc977b0430329..cd84bfa0f148ad5f4f59d04fce1a967b530ae981 100644 --- a/Ring/Ring/Features/Walkthrough/CreateSipAccount/CreateSipAccountViewController.swift +++ b/Ring/Ring/Features/Walkthrough/CreateSipAccount/CreateSipAccountViewController.swift @@ -32,7 +32,6 @@ class CreateSipAccountViewController: UIViewController, StoryboardBased, ViewMod @IBOutlet weak var serverTextField: DesignableTextField! @IBOutlet weak var portTextField: DesignableTextField! @IBOutlet weak var scrollView: UIScrollView! - @IBOutlet weak var createAccountLabel: UILabel! @IBOutlet weak var userNameLabel: UILabel! @IBOutlet weak var passwordLabel: UILabel! @IBOutlet weak var serverLabel: UILabel! @@ -46,20 +45,43 @@ class CreateSipAccountViewController: UIViewController, StoryboardBased, ViewMod self.applyL10n() super.viewDidLoad() self.buindViewToViewModel() + self.configureWalkrhroughNavigationBar() self.userNameTextField.becomeFirstResponder() self.configurePasswordField() self.createAccountButton.applyGradient(with: [UIColor.jamiButtonLight, UIColor.jamiButtonDark], gradient: .horizontal) // handle keyboard self.adaptToKeyboardState(for: self.scrollView, with: self.disposeBag) keyboardDismissTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard)) + NotificationCenter.default.rx + .notification(UIDevice.orientationDidChangeNotification) + .observeOn(MainScheduler.instance) + .subscribe(onNext: { [weak self] (_) in + self?.createAccountButton.updateGradientFrame() + self?.configureWalkrhroughNavigationBar() + }).disposed(by: self.disposeBag) + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillAppear(withNotification:)), name: UIResponder.keyboardWillShowNotification, object: nil) + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil) } @objc func dismissKeyboard() { self.isKeyboardOpened = false - self.becomeFirstResponder() + view.endEditing(true) view.removeGestureRecognizer(keyboardDismissTapRecognizer) } + @objc func keyboardWillAppear(withNotification: NSNotification) { + self.isKeyboardOpened = true + self.view.addGestureRecognizer(keyboardDismissTapRecognizer) + } + func configurePasswordField() { let isSecureTextEntry = PublishSubject<Bool>() let rightButton = UIButton(type: .custom) @@ -108,8 +130,9 @@ class CreateSipAccountViewController: UIViewController, StoryboardBased, ViewMod } func applyL10n() { - self.createAccountButton.setTitle(L10n.Account.createSipAccount, for: .normal) - self.createAccountLabel.text = L10n.Account.createSipAccount + self.createAccountButton + .setTitle(L10n.Account.createSipAccount, for: .normal) + self.navigationItem.title = L10n.Account.createSipAccount self.userNameLabel.text = L10n.Account.usernameLabel self.passwordLabel.text = L10n.Account.passwordLabel self.serverLabel.text = L10n.Account.serverLabel diff --git a/Ring/Ring/Features/Walkthrough/LinkDevice/LinkDeviceViewController.storyboard b/Ring/Ring/Features/Walkthrough/LinkDevice/LinkDeviceViewController.storyboard index 22f96be5f7c4e02fc5bd3b4c830ffbc6d39c1bee..931285c8a8fdef6458b7ab3f693614cf4b8243d0 100644 --- a/Ring/Ring/Features/Walkthrough/LinkDevice/LinkDeviceViewController.storyboard +++ b/Ring/Ring/Features/Walkthrough/LinkDevice/LinkDeviceViewController.storyboard @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="1yn-Mj-8Ek"> - <device id="ipad9_7" orientation="portrait"> - <adaptation id="fullscreen"/> - </device> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="1yn-Mj-8Ek"> + <device id="retina4_7" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> @@ -17,182 +15,180 @@ <viewControllerLayoutGuide type="top" id="jiD-fm-HFk"/> <viewControllerLayoutGuide type="bottom" id="GVt-PH-FqG"/> </layoutGuides> - <view key="view" clipsSubviews="YES" contentMode="scaleToFill" id="N1T-Xh-FH1"> - <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <view key="view" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="N1T-Xh-FH1"> + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <subviews> <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" keyboardDismissMode="interactive" translatesAutoresizingMaskIntoConstraints="NO" id="2ZO-zp-5uC"> - <rect key="frame" x="20" y="0.0" width="728" height="1024"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HlM-9Z-7gA" userLabel="Container View" customClass="DesignableView" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="-20" y="18" width="768" height="286"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="343"/> <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Link this Device" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NpV-yY-PPY" userLabel="Link Device Title"> - <rect key="frame" x="286" y="-55" width="196" height="30"/> + <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="fat-TI-8jn"> + <rect key="frame" x="40" y="20" width="295" height="323"/> + <subviews> + <stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="edM-LD-fKX"> + <rect key="frame" x="0.0" y="0.0" width="102" height="22"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter pin" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VN2-rO-YYy"> + <rect key="frame" x="0.0" y="0.0" width="69" height="22"/> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="infoLight" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rtk-w4-zfQ" customClass="ButtonTransparentBackground" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="77" y="0.0" width="25" height="22"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> + <constraints> + <constraint firstAttribute="height" constant="22" id="dIk-SQ-ZCf"/> + </constraints> + <color key="tintColor" red="0.12156862745098039" green="0.28627450980392155" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </button> + </subviews> + </stackView> + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="PIN" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3CA-fY-2S2" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="0.0" y="32" width="295" height="50"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <constraints> + <constraint firstAttribute="height" constant="50" id="qQ4-hd-6jc"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <textInputTraits key="textInputTraits" autocorrectionType="no" secureTextEntry="YES"/> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> + <real key="value" value="1.5"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> + <color key="value" red="0.12156862745098039" green="0.28627450980392155" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </userDefinedRuntimeAttribute> + </userDefinedRuntimeAttributes> + </textField> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cmv-Gr-Jll"> + <rect key="frame" x="0.0" y="92" width="240" height="5"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstAttribute="height" constant="5" id="7e6-DN-j1J"/> + </constraints> + </view> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter password" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9AD-b5-bun"> + <rect key="frame" x="0.0" y="107" width="122" height="25"/> + <constraints> + <constraint firstAttribute="height" constant="25" id="g3B-PW-uya"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="FyJ-Ke-ba3" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="0.0" y="142" width="295" height="50"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <constraints> + <constraint firstAttribute="height" constant="50" id="IYK-P5-8Up"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <textInputTraits key="textInputTraits" autocorrectionType="no" secureTextEntry="YES"/> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> + <real key="value" value="1.5"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> + <color key="value" red="0.12156862745098039" green="0.28627450980392155" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </userDefinedRuntimeAttribute> + </userDefinedRuntimeAttributes> + </textField> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="E9z-o1-3Em"> + <rect key="frame" x="0.0" y="202" width="240" height="5"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstAttribute="height" constant="5" id="qP3-HD-3Si"/> + </constraints> + </view> + <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CLR-na-fmE"> + <rect key="frame" x="0.0" y="217" width="295" height="31"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable notifications" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xYz-Rm-Qsp" userLabel="Enable Notifications Label"> + <rect key="frame" x="0.0" y="0.0" width="246" height="31"/> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1UV-Vn-dMF" userLabel="Notifications Switch"> + <rect key="frame" x="246" y="0.0" width="51" height="31"/> + <color key="onTintColor" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </switch> + </subviews> + <constraints> + <constraint firstAttribute="height" constant="31" id="d8s-qE-6jq"/> + </constraints> + </stackView> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="G3o-xl-CXW"> + <rect key="frame" x="0.0" y="258" width="240" height="5"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstAttribute="height" constant="5" id="O9x-AI-cnI"/> + </constraints> + </view> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BLV-X1-oI7" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="0.0" y="273" width="295" height="50"/> + <constraints> + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="500" id="3lO-u5-XKW"/> + <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="250" id="U4p-lk-qhz"/> + <constraint firstAttribute="height" constant="50" id="pn4-1l-5WE"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <state key="normal" title="Link Device"/> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + </userDefinedRuntimeAttributes> + </button> + </subviews> <constraints> - <constraint firstAttribute="height" constant="30" id="IQC-Gd-aep"/> + <constraint firstItem="BLV-X1-oI7" firstAttribute="trailing" secondItem="3CA-fY-2S2" secondAttribute="trailing" id="72p-25-vgT"/> + <constraint firstItem="FyJ-Ke-ba3" firstAttribute="leading" secondItem="3CA-fY-2S2" secondAttribute="leading" id="DOI-ZG-9xa"/> + <constraint firstItem="CLR-na-fmE" firstAttribute="leading" secondItem="3CA-fY-2S2" secondAttribute="leading" id="S9k-0F-dMm"/> + <constraint firstItem="BLV-X1-oI7" firstAttribute="leading" secondItem="3CA-fY-2S2" secondAttribute="leading" id="XJe-tn-God"/> + <constraint firstItem="CLR-na-fmE" firstAttribute="trailing" secondItem="3CA-fY-2S2" secondAttribute="trailing" id="dIY-mk-l2P"/> + <constraint firstItem="BLV-X1-oI7" firstAttribute="leading" secondItem="fat-TI-8jn" secondAttribute="leading" id="l6g-hM-wgc"/> + <constraint firstAttribute="trailing" secondItem="BLV-X1-oI7" secondAttribute="trailing" id="mvm-Ym-al8"/> + <constraint firstItem="FyJ-Ke-ba3" firstAttribute="trailing" secondItem="3CA-fY-2S2" secondAttribute="trailing" id="s22-Op-DZ4"/> </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="31"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter pin" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VN2-rO-YYy"> - <rect key="frame" x="144" y="15" width="71" height="30"/> - <constraints> - <constraint firstAttribute="height" constant="30" id="TAS-dT-bOV"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="infoLight" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rtk-w4-zfQ" customClass="ButtonTransparentBackground" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="223" y="19" width="22" height="22"/> - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="22" id="dIk-SQ-ZCf"/> - </constraints> - <color key="tintColor" red="0.12156862745098039" green="0.28627450980392155" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - </button> - <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="PIN" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3CA-fY-2S2" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="134" y="53" width="500" height="50"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="50" id="qQ4-hd-6jc"/> - </constraints> - <nil key="textColor"/> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <textInputTraits key="textInputTraits" autocorrectionType="no" secureTextEntry="YES"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> - <real key="value" value="1.5"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> - <color key="value" red="0.12156862745098039" green="0.28627450980392155" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - </userDefinedRuntimeAttribute> - </userDefinedRuntimeAttributes> - </textField> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter password" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9AD-b5-bun"> - <rect key="frame" x="144" y="123" width="124" height="25"/> - <constraints> - <constraint firstAttribute="height" constant="25" id="g3B-PW-uya"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="FyJ-Ke-ba3" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="134" y="156" width="500" height="50"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="50" id="IYK-P5-8Up"/> - </constraints> - <nil key="textColor"/> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <textInputTraits key="textInputTraits" autocorrectionType="no" secureTextEntry="YES"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> - <real key="value" value="1.5"/> - </userDefinedRuntimeAttribute> - <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> - <color key="value" red="0.12156862745098039" green="0.28627450980392155" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - </userDefinedRuntimeAttribute> - </userDefinedRuntimeAttributes> - </textField> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BLV-X1-oI7" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="134" y="236" width="500" height="50"/> - <constraints> - <constraint firstAttribute="width" relation="lessThanOrEqual" constant="500" id="3lO-u5-XKW"/> - <constraint firstAttribute="height" constant="50" id="pn4-1l-5WE"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <state key="normal" title="Link Device"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - </userDefinedRuntimeAttributes> - </button> + </stackView> </subviews> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <constraints> - <constraint firstItem="NpV-yY-PPY" firstAttribute="top" secondItem="HlM-9Z-7gA" secondAttribute="top" constant="-55" id="5th-a8-gmP"/> - <constraint firstItem="BLV-X1-oI7" firstAttribute="trailing" secondItem="3CA-fY-2S2" secondAttribute="trailing" id="6bW-fx-dTp"/> - <constraint firstItem="rtk-w4-zfQ" firstAttribute="centerY" secondItem="VN2-rO-YYy" secondAttribute="centerY" id="9Ie-aD-Xu9"/> - <constraint firstItem="rtk-w4-zfQ" firstAttribute="leading" secondItem="VN2-rO-YYy" secondAttribute="trailing" constant="8" id="Bp6-n1-e71"/> - <constraint firstItem="BLV-X1-oI7" firstAttribute="trailing" secondItem="HlM-9Z-7gA" secondAttribute="trailing" priority="750" constant="-40" id="FAf-y0-SWz"/> - <constraint firstItem="VN2-rO-YYy" firstAttribute="leading" secondItem="3CA-fY-2S2" secondAttribute="leading" constant="10" id="Iqd-Ed-oSA"/> - <constraint firstItem="BLV-X1-oI7" firstAttribute="top" secondItem="FyJ-Ke-ba3" secondAttribute="bottom" constant="30" id="J0W-p0-scm"/> - <constraint firstItem="9AD-b5-bun" firstAttribute="top" secondItem="3CA-fY-2S2" secondAttribute="bottom" constant="20" id="LMr-eA-P35"/> - <constraint firstItem="NpV-yY-PPY" firstAttribute="centerX" secondItem="HlM-9Z-7gA" secondAttribute="centerX" id="P0j-mM-ca0"/> - <constraint firstItem="9AD-b5-bun" firstAttribute="leading" secondItem="VN2-rO-YYy" secondAttribute="leading" id="RKI-YF-jcr"/> - <constraint firstItem="VN2-rO-YYy" firstAttribute="top" secondItem="NpV-yY-PPY" secondAttribute="bottom" constant="40" id="VhQ-gm-OM0"/> - <constraint firstItem="3CA-fY-2S2" firstAttribute="top" secondItem="VN2-rO-YYy" secondAttribute="bottom" constant="8" id="WVd-c7-KZh"/> - <constraint firstItem="BLV-X1-oI7" firstAttribute="trailing" secondItem="FyJ-Ke-ba3" secondAttribute="trailing" id="ZiC-A3-KXj"/> - <constraint firstItem="FyJ-Ke-ba3" firstAttribute="centerX" secondItem="HlM-9Z-7gA" secondAttribute="centerX" id="aRS-da-T00"/> - <constraint firstItem="BLV-X1-oI7" firstAttribute="leading" secondItem="HlM-9Z-7gA" secondAttribute="leading" priority="750" constant="40" id="eOj-pf-UVL"/> - <constraint firstItem="BLV-X1-oI7" firstAttribute="centerX" secondItem="HlM-9Z-7gA" secondAttribute="centerX" id="f05-Dz-L7e"/> - <constraint firstAttribute="bottom" secondItem="BLV-X1-oI7" secondAttribute="bottom" id="kjC-r6-qUW"/> - <constraint firstItem="FyJ-Ke-ba3" firstAttribute="leading" secondItem="VN2-rO-YYy" secondAttribute="leading" constant="-10" id="lAE-FG-kSn"/> - <constraint firstItem="FyJ-Ke-ba3" firstAttribute="top" secondItem="9AD-b5-bun" secondAttribute="bottom" constant="8" id="lD9-0Z-hro"/> - <constraint firstItem="FyJ-Ke-ba3" firstAttribute="leading" secondItem="BLV-X1-oI7" secondAttribute="leading" id="t4u-nO-inp"/> - <constraint firstItem="3CA-fY-2S2" firstAttribute="centerX" secondItem="HlM-9Z-7gA" secondAttribute="centerX" id="thj-Jz-Qvr"/> - <constraint firstItem="3CA-fY-2S2" firstAttribute="leading" secondItem="BLV-X1-oI7" secondAttribute="leading" id="w87-bV-caL"/> + <constraint firstItem="fat-TI-8jn" firstAttribute="top" secondItem="HlM-9Z-7gA" secondAttribute="top" constant="20" id="26U-te-Y7U"/> + <constraint firstItem="fat-TI-8jn" firstAttribute="leading" secondItem="HlM-9Z-7gA" secondAttribute="leading" priority="750" constant="40" id="3uM-7j-awQ"/> + <constraint firstAttribute="trailing" secondItem="fat-TI-8jn" secondAttribute="trailing" priority="750" constant="40" id="GPw-na-Z5B"/> + <constraint firstItem="fat-TI-8jn" firstAttribute="centerX" secondItem="HlM-9Z-7gA" secondAttribute="centerX" id="Stt-gY-7Vh"/> + <constraint firstAttribute="bottom" secondItem="fat-TI-8jn" secondAttribute="bottom" id="jvT-T4-Tex"/> </constraints> </view> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable notifications" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xYz-Rm-Qsp" userLabel="Enable Notifications Label"> - <rect key="frame" x="114" y="339" width="156" height="21"/> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1UV-Vn-dMF" userLabel="Notifications Switch"> - <rect key="frame" x="565" y="334" width="51" height="31"/> - <color key="onTintColor" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - </switch> </subviews> <constraints> <constraint firstAttribute="bottom" secondItem="HlM-9Z-7gA" secondAttribute="bottom" id="69B-Pe-mL7"/> + <constraint firstItem="HlM-9Z-7gA" firstAttribute="width" secondItem="2ZO-zp-5uC" secondAttribute="width" id="9nQ-61-3F8"/> <constraint firstItem="HlM-9Z-7gA" firstAttribute="centerX" secondItem="2ZO-zp-5uC" secondAttribute="centerX" id="A0t-uV-C5f"/> - <constraint firstItem="HlM-9Z-7gA" firstAttribute="top" secondItem="2ZO-zp-5uC" secondAttribute="top" constant="18" id="Dig-j9-XSJ"/> - <constraint firstItem="1UV-Vn-dMF" firstAttribute="top" secondItem="BLV-X1-oI7" secondAttribute="bottom" constant="30" id="Ew8-6y-ogo"/> - <constraint firstAttribute="trailing" secondItem="HlM-9Z-7gA" secondAttribute="trailing" constant="-20" id="LZa-xU-Eh2"/> - <constraint firstItem="HlM-9Z-7gA" firstAttribute="leading" secondItem="2ZO-zp-5uC" secondAttribute="leading" constant="-20" id="NvH-W1-SN5"/> - <constraint firstItem="xYz-Rm-Qsp" firstAttribute="leading" secondItem="FyJ-Ke-ba3" secondAttribute="leading" id="aRq-7u-k2Z"/> - <constraint firstItem="xYz-Rm-Qsp" firstAttribute="centerY" secondItem="1UV-Vn-dMF" secondAttribute="centerY" id="bCp-Qm-SeS"/> - <constraint firstItem="1UV-Vn-dMF" firstAttribute="trailing" secondItem="FyJ-Ke-ba3" secondAttribute="trailing" id="yaA-K4-rfo"/> + <constraint firstItem="HlM-9Z-7gA" firstAttribute="top" secondItem="2ZO-zp-5uC" secondAttribute="top" id="Dig-j9-XSJ"/> + <constraint firstAttribute="trailing" secondItem="HlM-9Z-7gA" secondAttribute="trailing" id="LZa-xU-Eh2"/> + <constraint firstItem="HlM-9Z-7gA" firstAttribute="leading" secondItem="2ZO-zp-5uC" secondAttribute="leading" id="NvH-W1-SN5"/> </constraints> </scrollView> - <visualEffectView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GxF-1Y-H7V" userLabel="Background Navigation Bar"> - <rect key="frame" x="0.0" y="0.0" width="768" height="0.0"/> - <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="acD-PR-Dsa"> - <rect key="frame" x="0.0" y="0.0" width="768" height="0.0"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - </view> - <constraints> - <constraint firstAttribute="height" id="tVI-wi-4Lx"/> - </constraints> - <blurEffect style="light"/> - </visualEffectView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> - <constraint firstItem="HlM-9Z-7gA" firstAttribute="height" secondItem="N1T-Xh-FH1" secondAttribute="height" priority="250" constant="-60" id="2d3-He-Sf0"/> - <constraint firstItem="2ZO-zp-5uC" firstAttribute="leading" secondItem="N1T-Xh-FH1" secondAttribute="leadingMargin" id="4Yi-0N-gCd"/> - <constraint firstItem="GxF-1Y-H7V" firstAttribute="centerX" secondItem="N1T-Xh-FH1" secondAttribute="centerX" id="7O6-R7-yS2"/> - <constraint firstItem="GxF-1Y-H7V" firstAttribute="width" secondItem="N1T-Xh-FH1" secondAttribute="width" id="FSI-Lh-RNA"/> - <constraint firstAttribute="trailingMargin" secondItem="2ZO-zp-5uC" secondAttribute="trailing" id="KoU-wY-ukh"/> - <constraint firstItem="2ZO-zp-5uC" firstAttribute="top" secondItem="N1T-Xh-FH1" secondAttribute="top" id="L02-XW-zma"/> + <constraint firstAttribute="trailing" secondItem="2ZO-zp-5uC" secondAttribute="trailing" id="0CP-iO-M8w"/> <constraint firstItem="GVt-PH-FqG" firstAttribute="top" secondItem="2ZO-zp-5uC" secondAttribute="bottom" id="cx4-FI-wvY"/> - <constraint firstItem="GxF-1Y-H7V" firstAttribute="top" secondItem="N1T-Xh-FH1" secondAttribute="top" id="l12-DM-Yp0"/> + <constraint firstItem="2ZO-zp-5uC" firstAttribute="leading" secondItem="N1T-Xh-FH1" secondAttribute="leading" id="od4-oA-1fC"/> + <constraint firstItem="2ZO-zp-5uC" firstAttribute="top" secondItem="jiD-fm-HFk" secondAttribute="bottom" id="sdP-dd-a89"/> </constraints> </view> <connections> - <outlet property="backgroundNavigationBarHeightConstraint" destination="tVI-wi-4Lx" id="OyH-sV-V86"/> <outlet property="containerViewBottomConstraint" destination="69B-Pe-mL7" id="6gO-aI-ofm"/> <outlet property="enableNotificationsLabel" destination="xYz-Rm-Qsp" id="4N5-pW-3J0"/> <outlet property="linkButton" destination="BLV-X1-oI7" id="6kA-dj-aEA"/> - <outlet property="linkDeviceTitle" destination="NpV-yY-PPY" id="49f-oC-MTs"/> <outlet property="notificationsSwitch" destination="1UV-Vn-dMF" id="K0l-sc-v8w"/> <outlet property="passwordLabel" destination="9AD-b5-bun" id="Neh-tt-Ui8"/> <outlet property="passwordTextField" destination="FyJ-Ke-ba3" id="tGg-8m-QWZ"/> @@ -204,7 +200,7 @@ </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="6ma-i4-SuK" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> - <point key="canvasLocation" x="1104.8" y="366.50246305418722"/> + <point key="canvasLocation" x="1103.2" y="365.66716641679164"/> </scene> </scenes> </document> diff --git a/Ring/Ring/Features/Walkthrough/LinkDevice/LinkDeviceViewController.swift b/Ring/Ring/Features/Walkthrough/LinkDevice/LinkDeviceViewController.swift index a5ef5a95c3668f5d4502726cd408fdb332f71d1a..bfabeb1c13eee06b5e42a0ad850d1e346f1dbc10 100644 --- a/Ring/Ring/Features/Walkthrough/LinkDevice/LinkDeviceViewController.swift +++ b/Ring/Ring/Features/Walkthrough/LinkDevice/LinkDeviceViewController.swift @@ -29,9 +29,7 @@ import SwiftyBeaver class LinkDeviceViewController: UIViewController, StoryboardBased, ViewModelBased { // MARK: outlets - @IBOutlet weak var linkDeviceTitle: UILabel! @IBOutlet weak var linkButton: DesignableButton! - @IBOutlet weak var backgroundNavigationBarHeightConstraint: NSLayoutConstraint! @IBOutlet weak var containerViewBottomConstraint: NSLayoutConstraint! @IBOutlet weak var pinTextField: DesignableTextField! @IBOutlet weak var passwordTextField: DesignableTextField! @@ -60,9 +58,9 @@ class LinkDeviceViewController: UIViewController, StoryboardBased, ViewModelBase // Style self.pinTextField.becomeFirstResponder() + self.configureWalkrhroughNavigationBar() self.view.layoutIfNeeded() self.linkButton.applyGradient(with: [UIColor.jamiButtonLight, UIColor.jamiButtonDark], gradient: .horizontal) - self.backgroundNavigationBarHeightConstraint.constant = UIApplication.shared.statusBarFrame.height self.pinTextField.tintColor = UIColor.jamiSecondary self.passwordTextField.tintColor = UIColor.jamiSecondary @@ -112,6 +110,12 @@ class LinkDeviceViewController: UIViewController, StoryboardBased, ViewModelBase // handle keyboard self.adaptToKeyboardState(for: self.scrollView, with: self.disposeBag) keyboardDismissTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard)) + NotificationCenter.default.rx.notification(UIDevice.orientationDidChangeNotification) + .observeOn(MainScheduler.instance) + .subscribe(onNext: { [weak self] (_) in + self?.linkButton.updateGradientFrame() + self?.configureWalkrhroughNavigationBar() + }).disposed(by: self.disposeBag) } func setContentInset() { @@ -162,7 +166,7 @@ class LinkDeviceViewController: UIViewController, StoryboardBased, ViewModelBase self.passwordLabel.text = L10n.LinkToAccount.passwordLabel self.pinTextField.placeholder = L10n.LinkToAccount.pinPlaceholder self.passwordTextField.placeholder = L10n.LinkToAccount.passwordPlaceholder - self.linkDeviceTitle.text = L10n.LinkToAccount.linkButtonTitle + self.navigationItem.title = L10n.LinkToAccount.linkButtonTitle self.enableNotificationsLabel.text = self.viewModel.enableNotificationsTitle } diff --git a/Ring/Ring/Features/Walkthrough/LinkToAccountManager/LinkToAccountManagerViewController.storyboard b/Ring/Ring/Features/Walkthrough/LinkToAccountManager/LinkToAccountManagerViewController.storyboard index cb4c7290fdebdca760d2b6e09785a5be52a3231c..a9dbc2424f4e54e40d643653f5760135e5cd0392 100644 --- a/Ring/Ring/Features/Walkthrough/LinkToAccountManager/LinkToAccountManagerViewController.storyboard +++ b/Ring/Ring/Features/Walkthrough/LinkToAccountManager/LinkToAccountManagerViewController.storyboard @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="475-LA-El7"> - <device id="retina6_1" orientation="portrait" appearance="light"/> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="475-LA-El7"> + <device id="retina3_5" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -13,20 +13,20 @@ <objects> <viewController id="475-LA-El7" customClass="LinkToAccountManagerViewController" customModule="Ring" customModuleProvider="target" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="kln-mF-Ufp"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tb6-0m-FPR"> - <rect key="frame" x="0.0" y="44" width="414" height="852"/> + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tb6-0m-FPR"> + <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kQW-jH-EMh"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <rect key="frame" x="0.0" y="0.0" width="320" height="800"/> <subviews> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="cZa-pp-ILv"> - <rect key="frame" x="20" y="0.0" width="374" height="476"/> + <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="cZa-pp-ILv"> + <rect key="frame" x="-90" y="0.0" width="500" height="436"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter username" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NdV-rr-P8t"> - <rect key="frame" x="0.0" y="0.0" width="374" height="25"/> + <rect key="frame" x="0.0" y="0.0" width="500" height="25"/> <constraints> <constraint firstAttribute="height" constant="25" id="SBF-JX-Jpe"/> </constraints> @@ -35,7 +35,7 @@ <nil key="highlightedColor"/> </label> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Username" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ek6-hD-jH1" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="0.0" y="45" width="374" height="50"/> + <rect key="frame" x="0.0" y="35" width="500" height="50"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <constraints> <constraint firstAttribute="height" constant="50" id="gO1-Zq-rUG"/> @@ -55,8 +55,14 @@ <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> </userDefinedRuntimeAttributes> </textField> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qwC-ec-DUU"> + <rect key="frame" x="0.0" y="95" width="500" height="5"/> + <constraints> + <constraint firstAttribute="height" constant="5" id="6I3-fv-clg"/> + </constraints> + </view> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter password" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KU1-cn-Bdu" userLabel="Enter Password"> - <rect key="frame" x="0.0" y="115" width="374" height="25"/> + <rect key="frame" x="0.0" y="110" width="500" height="25"/> <constraints> <constraint firstAttribute="height" constant="25" id="Fy2-AY-s4A"/> </constraints> @@ -65,7 +71,7 @@ <nil key="highlightedColor"/> </label> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="VrN-QN-7DO" userLabel="Password" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="0.0" y="160" width="374" height="50"/> + <rect key="frame" x="0.0" y="145" width="500" height="50"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <constraints> <constraint firstAttribute="height" constant="50" id="6YJ-GL-6XI"/> @@ -85,8 +91,14 @@ <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> </userDefinedRuntimeAttributes> </textField> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kQZ-wL-1My"> + <rect key="frame" x="0.0" y="205" width="500" height="5"/> + <constraints> + <constraint firstAttribute="height" constant="5" id="ipa-wB-RL3"/> + </constraints> + </view> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enter manager URI" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B54-is-2Bf" userLabel="Enter Manager URI"> - <rect key="frame" x="0.0" y="230" width="374" height="25"/> + <rect key="frame" x="0.0" y="220" width="500" height="25"/> <constraints> <constraint firstAttribute="height" constant="25" id="KfB-wx-b5e"/> </constraints> @@ -95,7 +107,7 @@ <nil key="highlightedColor"/> </label> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Manager URI" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="wbQ-hE-Hr6" userLabel="Manager URI" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="0.0" y="275" width="374" height="50"/> + <rect key="frame" x="0.0" y="255" width="500" height="50"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <constraints> <constraint firstAttribute="height" constant="50" id="7hP-rE-zTa"/> @@ -115,31 +127,39 @@ <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> </userDefinedRuntimeAttributes> </textField> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DJz-Eo-M99"> + <rect key="frame" x="0.0" y="315" width="500" height="5"/> + <constraints> + <constraint firstAttribute="height" constant="5" id="sDH-fq-2VS"/> + </constraints> + </view> <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Anq-6W-oa8"> - <rect key="frame" x="0.0" y="345" width="374" height="31"/> + <rect key="frame" x="0.0" y="330" width="500" height="31"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable notifications" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bsq-Pz-NtT" userLabel="Enable Notifications Label"> - <rect key="frame" x="0.0" y="0.0" width="325" height="31"/> + <rect key="frame" x="0.0" y="0.0" width="451" height="31"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MSp-53-0zY" userLabel="Notifications Switch"> - <rect key="frame" x="325" y="0.0" width="51" height="31"/> + <rect key="frame" x="451" y="0.0" width="51" height="31"/> <color key="onTintColor" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </switch> </subviews> </stackView> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8t8-Fo-Eog"> - <rect key="frame" x="0.0" y="396" width="374" height="10"/> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="g3R-zY-gQR"> + <rect key="frame" x="0.0" y="371" width="500" height="5"/> <constraints> - <constraint firstAttribute="height" constant="10" id="njD-ob-x69"/> + <constraint firstAttribute="height" constant="5" id="L7Z-Hg-PUk"/> </constraints> </view> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="UIH-8R-fSe" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="0.0" y="426" width="374" height="50"/> + <rect key="frame" x="0.0" y="386" width="500" height="50"/> <constraints> <constraint firstAttribute="height" constant="50" id="9PT-1M-HRn"/> + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="500" id="gOm-l6-Y2p"/> + <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="250" id="oic-V3-GZX"/> </constraints> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/> @@ -149,19 +169,26 @@ </userDefinedRuntimeAttributes> </button> </subviews> + <constraints> + <constraint firstItem="UIH-8R-fSe" firstAttribute="leading" secondItem="wbQ-hE-Hr6" secondAttribute="leading" id="TXm-BD-uyV"/> + <constraint firstItem="UIH-8R-fSe" firstAttribute="trailing" secondItem="wbQ-hE-Hr6" secondAttribute="trailing" id="gLK-Q7-hhI"/> + </constraints> </stackView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> + <constraint firstAttribute="height" constant="800" id="BuH-dc-4uY"/> + <constraint firstItem="cZa-pp-ILv" firstAttribute="centerX" secondItem="kQW-jH-EMh" secondAttribute="centerX" id="J9V-hd-HTu"/> <constraint firstItem="cZa-pp-ILv" firstAttribute="top" secondItem="kQW-jH-EMh" secondAttribute="top" id="Vg5-Be-bil"/> - <constraint firstItem="cZa-pp-ILv" firstAttribute="leading" secondItem="kQW-jH-EMh" secondAttribute="leading" constant="20" id="mBs-Fq-N0u"/> - <constraint firstAttribute="trailing" secondItem="cZa-pp-ILv" secondAttribute="trailing" constant="20" id="v3a-QY-a5x"/> + <constraint firstItem="cZa-pp-ILv" firstAttribute="leading" secondItem="kQW-jH-EMh" secondAttribute="leading" priority="750" constant="40" id="mBs-Fq-N0u"/> + <constraint firstAttribute="trailing" secondItem="cZa-pp-ILv" secondAttribute="trailing" priority="750" constant="40" id="v3a-QY-a5x"/> </constraints> </view> </subviews> <constraints> <constraint firstItem="kQW-jH-EMh" firstAttribute="top" secondItem="9LR-Pb-L33" secondAttribute="top" id="WMC-QG-ZUi"/> <constraint firstItem="kQW-jH-EMh" firstAttribute="trailing" secondItem="9LR-Pb-L33" secondAttribute="trailing" id="dXe-yQ-aEc"/> + <constraint firstItem="kQW-jH-EMh" firstAttribute="width" secondItem="Tb6-0m-FPR" secondAttribute="width" id="jFf-pR-6Ih"/> <constraint firstItem="kQW-jH-EMh" firstAttribute="bottom" secondItem="9LR-Pb-L33" secondAttribute="bottom" id="mjC-Pw-Mdv"/> <constraint firstItem="kQW-jH-EMh" firstAttribute="leading" secondItem="9LR-Pb-L33" secondAttribute="leading" id="rk8-IN-oQe"/> </constraints> @@ -172,9 +199,9 @@ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> <constraint firstItem="Tb6-0m-FPR" firstAttribute="trailing" secondItem="hsz-cI-2Eb" secondAttribute="trailing" id="5vR-sQ-ksF"/> - <constraint firstItem="kQW-jH-EMh" firstAttribute="width" secondItem="kln-mF-Ufp" secondAttribute="width" id="K5V-1T-z9W"/> + <constraint firstItem="kQW-jH-EMh" firstAttribute="leading" secondItem="hsz-cI-2Eb" secondAttribute="leading" id="J8u-vO-F2q"/> + <constraint firstItem="hsz-cI-2Eb" firstAttribute="trailing" secondItem="kQW-jH-EMh" secondAttribute="trailing" id="fqW-W2-7XZ"/> <constraint firstAttribute="bottom" secondItem="Tb6-0m-FPR" secondAttribute="bottom" id="g3l-Vj-YbD"/> - <constraint firstItem="kQW-jH-EMh" firstAttribute="height" secondItem="kln-mF-Ufp" secondAttribute="height" id="gHi-jV-47A"/> <constraint firstItem="Tb6-0m-FPR" firstAttribute="leading" secondItem="hsz-cI-2Eb" secondAttribute="leading" id="pRG-Bm-el3"/> <constraint firstItem="Tb6-0m-FPR" firstAttribute="top" secondItem="hsz-cI-2Eb" secondAttribute="top" id="uSf-0R-JGk"/> </constraints> @@ -195,7 +222,7 @@ </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="wIX-ef-x98" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> </objects> - <point key="canvasLocation" x="137.68115942028987" y="83.705357142857139"/> + <point key="canvasLocation" x="36" y="70"/> </scene> </scenes> </document> diff --git a/Ring/Ring/Features/Walkthrough/LinkToAccountManager/LinkToAccountManagerViewController.swift b/Ring/Ring/Features/Walkthrough/LinkToAccountManager/LinkToAccountManagerViewController.swift index a5ba52a98125ce47cb3f2dae410108fcb53474cc..385d9b42f4492bd86d123980318c91b4b3657115 100644 --- a/Ring/Ring/Features/Walkthrough/LinkToAccountManager/LinkToAccountManagerViewController.swift +++ b/Ring/Ring/Features/Walkthrough/LinkToAccountManager/LinkToAccountManagerViewController.swift @@ -44,13 +44,18 @@ var viewModel: LinkToAccountManagerViewModel! super.viewDidLoad() self.bindViewToViewModel() self.applyL10() + self.view.layoutIfNeeded() self.userNameTextField.becomeFirstResponder() self.signInButton.applyGradient(with: [UIColor.jamiButtonLight, UIColor.jamiButtonDark], gradient: .horizontal) - let attr = [NSAttributedString.Key.foregroundColor: UIColor(red: 0, green: 0, blue: 0, alpha: 0.5), - NSAttributedString.Key.font: UIFont.systemFont(ofSize: 31, weight: .thin)] - self.navigationController?.navigationBar.titleTextAttributes = attr + configureWalkrhroughNavigationBar() self.adaptToKeyboardState(for: self.scrollView, with: self.disposeBag) keyboardDismissTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard)) + NotificationCenter.default.rx.notification(UIDevice.orientationDidChangeNotification) + .observeOn(MainScheduler.instance) + .subscribe(onNext: { [weak self] (_) in + self?.signInButton.updateGradientFrame() + self?.configureWalkrhroughNavigationBar() + }).disposed(by: self.disposeBag) } override func viewWillAppear(_ animated: Bool) { diff --git a/Ring/Ring/Features/Walkthrough/Welcome/WelcomeViewController.storyboard b/Ring/Ring/Features/Walkthrough/Welcome/WelcomeViewController.storyboard index 7a26bb466a43705d54b3935aaaa53cb8232d4964..dc69ff96901c7674a37615ba5f4070c605083717 100644 --- a/Ring/Ring/Features/Walkthrough/Welcome/WelcomeViewController.storyboard +++ b/Ring/Ring/Features/Walkthrough/Welcome/WelcomeViewController.storyboard @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ILs-xb-iKr"> - <device id="retina5_9" orientation="portrait" appearance="light"/> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ILs-xb-iKr"> + <device id="ipad12_9rounded" orientation="portrait" layout="fullscreen" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -13,109 +13,140 @@ <objects> <viewController id="ILs-xb-iKr" customClass="WelcomeViewController" customModule="Ring" customModuleProvider="target" sceneMemberID="viewController"> <view key="view" clipsSubviews="YES" contentMode="scaleToFill" id="Dg0-kS-rT7"> - <rect key="frame" x="0.0" y="0.0" width="375" height="812"/> + <rect key="frame" x="0.0" y="0.0" width="1024" height="1366"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" verticalHuggingPriority="251" image="jamiIcon" translatesAutoresizingMaskIntoConstraints="NO" id="2Pc-uJ-SAI"> - <rect key="frame" x="137.66666666666666" y="358.66666666666669" width="100" height="95"/> - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="X8i-r8-BbF"> + <rect key="frame" x="0.0" y="0.0" width="1024" height="1346"/> + <subviews> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="djg-zh-qNA"> + <rect key="frame" x="0.0" y="0.0" width="1024" height="650"/> + <subviews> + <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" verticalHuggingPriority="251" image="jamiIcon" translatesAutoresizingMaskIntoConstraints="NO" id="2Pc-uJ-SAI"> + <rect key="frame" x="462" y="96" width="100" height="95"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> + <constraints> + <constraint firstAttribute="width" secondItem="2Pc-uJ-SAI" secondAttribute="height" multiplier="20:19" id="5fN-uH-uSi"/> + <constraint firstAttribute="width" constant="100" id="TaY-2a-CCG"/> + </constraints> + </imageView> + <label opaque="NO" userInteractionEnabled="NO" alpha="0.0" contentMode="left" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="Welcome to jami !" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="E4b-Zv-unB"> + <rect key="frame" x="383.5" y="221" width="257.5" height="43"/> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="36"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <button opaque="NO" alpha="0.0" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bu0-90-MB5" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="362" y="304" width="300" height="50"/> + <constraints> + <constraint firstAttribute="height" constant="50" id="FEf-kf-jCs"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <inset key="titleEdgeInsets" minX="5" minY="0.0" maxX="5" maxY="0.0"/> + <state key="normal" title="Create a Ring account"> + <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + </state> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + </userDefinedRuntimeAttributes> + </button> + <button opaque="NO" alpha="0.0" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QLK-gs-fOJ" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="362" y="374" width="300" height="50"/> + <constraints> + <constraint firstAttribute="height" constant="50" id="YW4-Sc-61P"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <inset key="titleEdgeInsets" minX="5" minY="0.0" maxX="5" maxY="0.0"/> + <state key="normal" title="Link this device to an account"> + <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + </state> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + </userDefinedRuntimeAttributes> + </button> + <button opaque="NO" alpha="0.0" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Wd6-vQ-gaH" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="362" y="444" width="300" height="50"/> + <constraints> + <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="300" id="dWY-2h-Jo8"/> + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="500" id="xe5-20-YOQ"/> + <constraint firstAttribute="height" constant="50" id="xto-yX-yFM"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> + <inset key="titleEdgeInsets" minX="5" minY="0.0" maxX="5" maxY="0.0"/> + <state key="normal" title="Connect to account manager"> + <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + </state> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + </userDefinedRuntimeAttributes> + </button> + <button opaque="NO" alpha="0.0" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kHN-iS-Mdb" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="362" y="514" width="300" height="50"/> + <constraints> + <constraint firstAttribute="height" constant="50" id="o1x-x5-0z2"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="thin" pointSize="22"/> + <state key="normal" title="create Sip account"> + <color key="titleColor" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </state> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> + </userDefinedRuntimeAttributes> + </button> + </subviews> + <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> + <constraints> + <constraint firstItem="E4b-Zv-unB" firstAttribute="centerX" secondItem="djg-zh-qNA" secondAttribute="centerX" id="2I1-0R-aRl"/> + <constraint firstItem="kHN-iS-Mdb" firstAttribute="leading" secondItem="bu0-90-MB5" secondAttribute="leading" id="7r4-TP-Df9"/> + <constraint firstItem="Wd6-vQ-gaH" firstAttribute="trailing" secondItem="bu0-90-MB5" secondAttribute="trailing" id="9XM-f1-twm"/> + <constraint firstItem="QLK-gs-fOJ" firstAttribute="top" secondItem="bu0-90-MB5" secondAttribute="bottom" constant="20" id="Edo-KX-6sz"/> + <constraint firstItem="2Pc-uJ-SAI" firstAttribute="centerY" secondItem="djg-zh-qNA" secondAttribute="centerY" constant="-181.5" id="OH8-EL-DdN"/> + <constraint firstItem="Wd6-vQ-gaH" firstAttribute="top" secondItem="QLK-gs-fOJ" secondAttribute="bottom" constant="20" id="Rpw-PU-14b"/> + <constraint firstItem="kHN-iS-Mdb" firstAttribute="top" secondItem="Wd6-vQ-gaH" secondAttribute="bottom" constant="20" id="eKk-yN-Id4"/> + <constraint firstItem="bu0-90-MB5" firstAttribute="centerX" secondItem="djg-zh-qNA" secondAttribute="centerX" id="fuH-3p-ssn"/> + <constraint firstItem="QLK-gs-fOJ" firstAttribute="centerX" secondItem="djg-zh-qNA" secondAttribute="centerX" id="lwf-Rd-3hc"/> + <constraint firstItem="QLK-gs-fOJ" firstAttribute="trailing" secondItem="bu0-90-MB5" secondAttribute="trailing" id="lzM-cm-1nj"/> + <constraint firstItem="QLK-gs-fOJ" firstAttribute="leading" secondItem="bu0-90-MB5" secondAttribute="leading" id="mt4-7Z-eR3"/> + <constraint firstItem="2Pc-uJ-SAI" firstAttribute="centerX" secondItem="djg-zh-qNA" secondAttribute="centerX" id="oJD-7p-Zee"/> + <constraint firstItem="Wd6-vQ-gaH" firstAttribute="leading" secondItem="bu0-90-MB5" secondAttribute="leading" id="qQF-mv-aU4"/> + <constraint firstItem="kHN-iS-Mdb" firstAttribute="trailing" secondItem="bu0-90-MB5" secondAttribute="trailing" id="r8u-YI-WpC"/> + <constraint firstItem="bu0-90-MB5" firstAttribute="top" secondItem="E4b-Zv-unB" secondAttribute="bottom" constant="40" id="rNa-Lz-fF2"/> + <constraint firstItem="E4b-Zv-unB" firstAttribute="top" secondItem="2Pc-uJ-SAI" secondAttribute="bottom" constant="30" id="uqF-tz-TA3"/> + <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="kHN-iS-Mdb" secondAttribute="bottom" constant="20" id="wAX-eY-8Cc"/> + <constraint firstItem="kHN-iS-Mdb" firstAttribute="centerX" secondItem="djg-zh-qNA" secondAttribute="centerX" id="xCk-wd-xlo"/> + <constraint firstAttribute="height" constant="650" id="yed-0d-kKi"/> + </constraints> + </view> + </subviews> <constraints> - <constraint firstAttribute="width" secondItem="2Pc-uJ-SAI" secondAttribute="height" multiplier="20:19" id="5fN-uH-uSi"/> - <constraint firstAttribute="width" constant="100" id="TaY-2a-CCG"/> + <constraint firstItem="djg-zh-qNA" firstAttribute="leading" secondItem="WOA-YS-hhU" secondAttribute="leading" id="NVB-Mh-6Mh"/> + <constraint firstItem="djg-zh-qNA" firstAttribute="trailing" secondItem="WOA-YS-hhU" secondAttribute="trailing" id="a3A-d3-Q1D"/> + <constraint firstItem="djg-zh-qNA" firstAttribute="bottom" secondItem="WOA-YS-hhU" secondAttribute="bottom" id="iPL-YC-e44"/> + <constraint firstItem="djg-zh-qNA" firstAttribute="centerX" secondItem="X8i-r8-BbF" secondAttribute="centerX" id="qJX-a9-Ihb"/> + <constraint firstItem="djg-zh-qNA" firstAttribute="top" secondItem="WOA-YS-hhU" secondAttribute="top" id="zes-gc-CwJ"/> </constraints> - </imageView> - <label opaque="NO" userInteractionEnabled="NO" alpha="0.0" contentMode="left" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="Welcome to jami !" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="E4b-Zv-unB"> - <rect key="frame" x="59" y="483.66666666666669" width="257.33333333333331" height="43.000000000000057"/> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="36"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <button opaque="NO" alpha="0.0" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bu0-90-MB5" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="40" y="566.66666666666663" width="295" height="50"/> - <constraints> - <constraint firstAttribute="height" constant="50" id="FEf-kf-jCs"/> - <constraint firstAttribute="width" relation="lessThanOrEqual" constant="500" id="epE-7u-SMQ"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <state key="normal" title="Create a Ring account"> - <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - </state> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - </userDefinedRuntimeAttributes> - </button> - <button opaque="NO" alpha="0.0" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QLK-gs-fOJ" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="40" y="636.66666666666663" width="295" height="50"/> - <constraints> - <constraint firstAttribute="height" constant="50" id="YW4-Sc-61P"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <state key="normal" title="Link this device to an account"> - <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - </state> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - </userDefinedRuntimeAttributes> - </button> - <button opaque="NO" alpha="0.0" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NJY-jT-cMC" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="40" y="706.66666666666663" width="295" height="50"/> - <constraints> - <constraint firstAttribute="width" relation="lessThanOrEqual" constant="500" id="AjX-nt-0Kt"/> - <constraint firstAttribute="height" constant="50" id="CFH-W9-jIs"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> - <state key="normal" title="Connect to account manager"> - <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - </state> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - </userDefinedRuntimeAttributes> - </button> - <button opaque="NO" alpha="0.0" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kHN-iS-Mdb" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="40" y="776.66666666666663" width="295" height="50"/> - <constraints> - <constraint firstAttribute="height" constant="50" id="o1x-x5-0z2"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="thin" pointSize="22"/> - <state key="normal" title="create Sip account"> - <color key="titleColor" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - </state> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> - </userDefinedRuntimeAttributes> - </button> + <viewLayoutGuide key="contentLayoutGuide" id="WOA-YS-hhU"/> + <viewLayoutGuide key="frameLayoutGuide" id="ahR-LE-Or6"/> + </scrollView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> - <constraint firstItem="bu0-90-MB5" firstAttribute="top" secondItem="E4b-Zv-unB" secondAttribute="bottom" constant="40" id="0hJ-6T-D3J"/> - <constraint firstItem="kHN-iS-Mdb" firstAttribute="leading" secondItem="bu0-90-MB5" secondAttribute="leading" id="1lb-s9-YvQ"/> - <constraint firstItem="2Pc-uJ-SAI" firstAttribute="centerY" secondItem="Dg0-kS-rT7" secondAttribute="centerY" id="2w4-nZ-VwS"/> - <constraint firstItem="NJY-jT-cMC" firstAttribute="leading" secondItem="QLK-gs-fOJ" secondAttribute="leading" id="7CE-5S-iVD"/> - <constraint firstItem="E4b-Zv-unB" firstAttribute="top" secondItem="2Pc-uJ-SAI" secondAttribute="bottom" constant="30" id="99p-KU-QhW"/> - <constraint firstItem="kHN-iS-Mdb" firstAttribute="trailing" secondItem="bu0-90-MB5" secondAttribute="trailing" id="B1I-cA-15P"/> - <constraint firstItem="bu0-90-MB5" firstAttribute="leading" secondItem="hvJ-fJ-PMc" secondAttribute="leading" priority="750" constant="40" id="OTd-qD-as2"/> - <constraint firstItem="QLK-gs-fOJ" firstAttribute="leading" secondItem="bu0-90-MB5" secondAttribute="leading" id="U37-r7-lNe"/> - <constraint firstItem="bu0-90-MB5" firstAttribute="centerX" secondItem="Dg0-kS-rT7" secondAttribute="centerX" id="YLx-WX-rgL"/> - <constraint firstItem="QLK-gs-fOJ" firstAttribute="top" secondItem="bu0-90-MB5" secondAttribute="bottom" constant="20" id="cYv-WZ-CCB"/> - <constraint firstItem="NJY-jT-cMC" firstAttribute="trailing" secondItem="QLK-gs-fOJ" secondAttribute="trailing" id="gOO-EN-J5g"/> - <constraint firstItem="QLK-gs-fOJ" firstAttribute="centerX" secondItem="Dg0-kS-rT7" secondAttribute="centerX" id="gQM-Bw-BRN"/> - <constraint firstItem="NJY-jT-cMC" firstAttribute="top" secondItem="QLK-gs-fOJ" secondAttribute="bottom" constant="20" id="iNt-ej-M8W"/> - <constraint firstItem="2Pc-uJ-SAI" firstAttribute="centerX" secondItem="Dg0-kS-rT7" secondAttribute="centerX" id="qaX-bX-RjJ"/> - <constraint firstItem="kHN-iS-Mdb" firstAttribute="centerX" secondItem="Dg0-kS-rT7" secondAttribute="centerX" id="r8E-fx-VRu"/> - <constraint firstItem="QLK-gs-fOJ" firstAttribute="trailing" secondItem="bu0-90-MB5" secondAttribute="trailing" id="uLc-95-Qpb"/> - <constraint firstItem="E4b-Zv-unB" firstAttribute="centerX" secondItem="Dg0-kS-rT7" secondAttribute="centerX" id="ukg-Rd-bL3"/> - <constraint firstItem="hvJ-fJ-PMc" firstAttribute="trailing" secondItem="bu0-90-MB5" secondAttribute="trailing" priority="750" constant="40" id="vGg-V2-7OH"/> - <constraint firstItem="kHN-iS-Mdb" firstAttribute="top" secondItem="NJY-jT-cMC" secondAttribute="bottom" constant="20" id="ydt-Yr-QCi"/> + <constraint firstItem="X8i-r8-BbF" firstAttribute="top" secondItem="Dg0-kS-rT7" secondAttribute="top" id="4Eh-OM-QvP"/> + <constraint firstItem="X8i-r8-BbF" firstAttribute="trailing" secondItem="hvJ-fJ-PMc" secondAttribute="trailing" id="InM-7Y-w4b"/> + <constraint firstItem="X8i-r8-BbF" firstAttribute="leading" secondItem="hvJ-fJ-PMc" secondAttribute="leading" id="Mxh-zn-bSX"/> + <constraint firstItem="X8i-r8-BbF" firstAttribute="bottom" secondItem="hvJ-fJ-PMc" secondAttribute="bottom" id="bnM-Bf-Zwh"/> + <constraint firstItem="hvJ-fJ-PMc" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="bu0-90-MB5" secondAttribute="trailing" constant="10" id="h6u-zb-Bvk"/> + <constraint firstItem="bu0-90-MB5" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="hvJ-fJ-PMc" secondAttribute="leading" constant="10" id="pf3-7r-uP4"/> </constraints> <viewLayoutGuide key="safeArea" id="hvJ-fJ-PMc"/> </view> <navigationItem key="navigationItem" id="SVR-Ry-7d7"/> <connections> - <outlet property="connectToAccountManagerButton" destination="NJY-jT-cMC" id="I3n-qu-t6f"/> + <outlet property="connectToAccountManagerButton" destination="Wd6-vQ-gaH" id="cNX-WT-aPP"/> <outlet property="createAccountButton" destination="bu0-90-MB5" id="YNt-Tc-Snc"/> <outlet property="createSipAccountButton" destination="kHN-iS-Mdb" id="eJ4-Qz-agr"/> <outlet property="linkDeviceButton" destination="QLK-gs-fOJ" id="AXP-0r-10g"/> - <outlet property="ringLogoBottomConstraint" destination="2w4-nZ-VwS" id="QZo-N3-iCa"/> + <outlet property="ringLogoBottomConstraint" destination="OH8-EL-DdN" id="CIb-Qh-H7u"/> <outlet property="welcomeTextLabel" destination="E4b-Zv-unB" id="ygV-A3-EZD"/> </connections> </viewController> @@ -125,6 +156,6 @@ </scene> </scenes> <resources> - <image name="jamiIcon" width="66.666664123535156" height="63.333332061767578"/> + <image name="jamiIcon" width="100" height="95"/> </resources> </document> diff --git a/Ring/Ring/Features/Walkthrough/Welcome/WelcomeViewController.swift b/Ring/Ring/Features/Walkthrough/Welcome/WelcomeViewController.swift index 4a7bf957f762c5445b21c3a42f8be2044e054922..2316c5addaf40cc6b66f8eaa85af350a75bc9ec6 100644 --- a/Ring/Ring/Features/Walkthrough/Welcome/WelcomeViewController.swift +++ b/Ring/Ring/Features/Walkthrough/Welcome/WelcomeViewController.swift @@ -49,10 +49,11 @@ class WelcomeViewController: UIViewController, StoryboardBased, ViewModelBased { override func viewDidLoad() { super.viewDidLoad() self.view.layoutIfNeeded() + self.applyL10n() if self.viewModel.isAnimatable { self.initialAnimation() } else { - self.ringLogoBottomConstraint.constant = -200 + self.ringLogoBottomConstraint.constant = -220 self.welcomeTextLabel.alpha = 1 self.createAccountButton.alpha = 1 self.linkDeviceButton.alpha = 1 @@ -101,13 +102,22 @@ class WelcomeViewController: UIViewController, StoryboardBased, ViewModelBased { }).disposed(by: self.disposeBag) } + func applyL10n() { + createSipAccountButton.setTitle(L10n.Account.createSipAccount, for: .normal) + linkDeviceButton.setTitle(L10n.Welcome.linkDevice, for: .normal) + connectToAccountManagerButton + .setTitle(L10n.Welcome.connectToManager, for: .normal) + createAccountButton.setTitle(L10n.Welcome.createAccount, for: .normal) + welcomeTextLabel.text = L10n.Welcome.title + } + func initialAnimation() { DispatchQueue.global(qos: .background).async { sleep(1) DispatchQueue.main.async { [weak self] in self?.ringLogoBottomConstraint.constant = -72 UIView.animate(withDuration: 0.5, animations: { - self?.ringLogoBottomConstraint.constant = -200 + self?.ringLogoBottomConstraint.constant = -220 self?.welcomeTextLabel.alpha = 1 self?.createAccountButton.alpha = 1 self?.linkDeviceButton.alpha = 1 diff --git a/Ring/Ring/Info.plist b/Ring/Ring/Info.plist index 7e490db6f75aab89f44daa9a1a8cfc208f568555..addb80c12c5319fbc57d9a3e6391046d59aca16e 100644 --- a/Ring/Ring/Info.plist +++ b/Ring/Ring/Info.plist @@ -84,10 +84,9 @@ <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> - </array> - <key>UISupportedInterfaceOrientations~ipad</key> - <array> - <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationPortraitUpsideDown</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationLandscapeRight</string> </array> <key>UIViewControllerBasedStatusBarAppearance</key> <false/> diff --git a/Ring/Ring/MigrateAccount/MigrateAccountViewController.storyboard b/Ring/Ring/MigrateAccount/MigrateAccountViewController.storyboard index 6c828580e972709a6d764f877521266f25863f96..9bd6cf31a327c1724637ba5a16160d7fca4a54d4 100644 --- a/Ring/Ring/MigrateAccount/MigrateAccountViewController.storyboard +++ b/Ring/Ring/MigrateAccount/MigrateAccountViewController.storyboard @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="I45-p9-wiJ"> - <device id="retina3_5" orientation="portrait" appearance="light"/> + <device id="ipad12_9rounded" orientation="landscape" layout="fullscreen" appearance="light"/> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> @@ -13,37 +13,37 @@ <objects> <viewController id="I45-p9-wiJ" customClass="MigrateAccountViewController" customModule="Ring" customModuleProvider="target" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="jwh-ov-ZTe"> - <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> + <rect key="frame" x="0.0" y="0.0" width="1366" height="1024"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7d6-pG-6l0"> - <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7d6-pG-6l0"> + <rect key="frame" x="0.0" y="0.0" width="1366" height="1004"/> <subviews> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="vzy-gI-nsl"> - <rect key="frame" x="0.0" y="0.0" width="320" height="819"/> + <rect key="frame" x="0.0" y="0.0" width="1366" height="819"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ulo-nG-5M6"> - <rect key="frame" x="40" y="0.0" width="240" height="5"/> + <rect key="frame" x="563" y="0.0" width="240" height="5"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <constraints> <constraint firstAttribute="height" constant="5" id="mUR-6q-HFe"/> </constraints> </view> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" preservesSuperviewLayoutMargins="YES" text="Migrate Account" textAlignment="center" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7cx-Cx-B4d"> - <rect key="frame" x="56.5" y="20" width="207.5" height="37"/> + <rect key="frame" x="579.5" y="20" width="207.5" height="37"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="31"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="to1-4Z-2pu"> - <rect key="frame" x="40" y="72" width="240" height="2"/> + <rect key="frame" x="563" y="72" width="240" height="2"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <constraints> <constraint firstAttribute="height" constant="2" id="Uv2-gv-OQW"/> </constraints> </view> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gMv-Zj-xNb"> - <rect key="frame" x="100" y="89" width="120" height="120"/> + <rect key="frame" x="623" y="89" width="120" height="120"/> <color key="backgroundColor" red="0.1215686275" green="0.28627450980000002" blue="0.4431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <constraints> @@ -58,47 +58,47 @@ </userDefinedRuntimeAttributes> </imageView> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4Qu-Tn-8Vs"> - <rect key="frame" x="135" y="224" width="50" height="50"/> + <rect key="frame" x="658" y="224" width="50" height="50"/> <fontDescription key="fontDescription" type="system" pointSize="20"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ANJ-7w-b6m"> - <rect key="frame" x="135" y="289" width="50" height="50"/> + <rect key="frame" x="658" y="289" width="50" height="50"/> <fontDescription key="fontDescription" type="system" weight="light" pointSize="12"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j7r-kl-wpk"> - <rect key="frame" x="135" y="354" width="50" height="50"/> + <rect key="frame" x="658" y="354" width="50" height="50"/> <fontDescription key="fontDescription" type="system" pointSize="16"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VF6-UM-QQD"> - <rect key="frame" x="160" y="419" width="0.0" height="0.0"/> + <rect key="frame" x="683" y="419" width="0.0" height="0.0"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="AOb-YI-rFt"> - <rect key="frame" x="0.0" y="434" width="320" height="85"/> + <rect key="frame" x="0.0" y="434" width="1366" height="85"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QVW-Uv-aOb"> - <rect key="frame" x="40" y="0.0" width="240" height="5"/> + <rect key="frame" x="563" y="0.0" width="240" height="5"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <constraints> <constraint firstAttribute="height" constant="5" id="BFb-EB-Oli"/> </constraints> </view> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="80a-aC-ZIz"> - <rect key="frame" x="160" y="20" width="0.0" height="0.0"/> + <rect key="frame" x="683" y="20" width="0.0" height="0.0"/> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Euy-dM-ftO" customClass="DesignableTextField" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="35" y="35" width="250" height="50"/> + <rect key="frame" x="433" y="35" width="500" height="50"/> <constraints> <constraint firstAttribute="height" constant="50" id="eOA-6S-c8L"/> </constraints> @@ -117,15 +117,16 @@ </subviews> </stackView> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="A4A-8T-5Ng"> - <rect key="frame" x="40" y="534" width="240" height="5"/> + <rect key="frame" x="563" y="534" width="240" height="5"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <constraints> <constraint firstAttribute="height" constant="5" id="LUv-rx-b6i"/> </constraints> </view> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kXr-kh-VHY" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="35" y="554" width="250" height="50"/> + <rect key="frame" x="433" y="554" width="500" height="50"/> <constraints> + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="500" id="EaK-Hz-fX0"/> <constraint firstAttribute="height" constant="50" id="cTQ-EL-Rrz"/> <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="250" id="dfP-Nf-Pcq"/> </constraints> @@ -137,10 +138,10 @@ <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> </userDefinedRuntimeAttributes> </button> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="X2k-bC-JyK" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="35" y="619" width="250" height="50"/> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WY5-ow-27r" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="433" y="619" width="500" height="50"/> <constraints> - <constraint firstAttribute="height" constant="50" id="Gke-Sc-VBY"/> + <constraint firstAttribute="height" constant="50" id="RyV-6r-ntt"/> </constraints> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <state key="normal"> @@ -150,10 +151,10 @@ <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> </userDefinedRuntimeAttributes> </button> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WY5-ow-27r" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="35" y="684" width="250" height="50"/> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zbl-Ns-5VY" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="433" y="684" width="500" height="50"/> <constraints> - <constraint firstAttribute="height" constant="50" id="RyV-6r-ntt"/> + <constraint firstAttribute="height" constant="50" id="624-mA-tZA"/> </constraints> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <state key="normal"> @@ -163,21 +164,21 @@ <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> </userDefinedRuntimeAttributes> </button> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zbl-Ns-5VY" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> - <rect key="frame" x="35" y="749" width="250" height="50"/> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="X2k-bC-JyK" customClass="DesignableButton" customModule="Ring" customModuleProvider="target"> + <rect key="frame" x="433" y="749" width="500" height="50"/> <constraints> - <constraint firstAttribute="height" constant="50" id="624-mA-tZA"/> + <constraint firstAttribute="height" constant="50" id="Gke-Sc-VBY"/> </constraints> <fontDescription key="fontDescription" type="system" weight="thin" pointSize="18"/> <state key="normal"> - <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <color key="titleColor" systemColor="systemRedColor" red="1" green="0.23137254900000001" blue="0.18823529410000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </state> <userDefinedRuntimeAttributes> <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> </userDefinedRuntimeAttributes> </button> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aej-OO-04e"> - <rect key="frame" x="40" y="814" width="240" height="5"/> + <rect key="frame" x="563" y="814" width="240" height="5"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <constraints> <constraint firstAttribute="height" constant="5" id="BdO-MN-W1G"/> @@ -189,14 +190,16 @@ <constraint firstItem="kXr-kh-VHY" firstAttribute="leading" secondItem="Euy-dM-ftO" secondAttribute="leading" id="FzA-E3-vCc"/> <constraint firstItem="Zbl-Ns-5VY" firstAttribute="leading" secondItem="X2k-bC-JyK" secondAttribute="leading" id="P2t-JO-o2E"/> <constraint firstItem="kXr-kh-VHY" firstAttribute="trailing" secondItem="Euy-dM-ftO" secondAttribute="trailing" id="P3V-js-vog"/> - <constraint firstItem="kXr-kh-VHY" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="vzy-gI-nsl" secondAttribute="leading" constant="10" id="Vvi-OM-kl4"/> + <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="VF6-UM-QQD" secondAttribute="trailing" constant="20" id="RIm-Cc-M7D"/> + <constraint firstItem="kXr-kh-VHY" firstAttribute="leading" secondItem="vzy-gI-nsl" secondAttribute="leading" priority="750" constant="40" id="Vvi-OM-kl4"/> <constraint firstItem="WY5-ow-27r" firstAttribute="trailing" secondItem="X2k-bC-JyK" secondAttribute="trailing" id="WqR-oi-Ylo"/> <constraint firstItem="AOb-YI-rFt" firstAttribute="leading" secondItem="vzy-gI-nsl" secondAttribute="leading" id="Y0M-3H-snM"/> <constraint firstItem="WY5-ow-27r" firstAttribute="leading" secondItem="X2k-bC-JyK" secondAttribute="leading" id="alS-YH-SNh"/> <constraint firstItem="X2k-bC-JyK" firstAttribute="leading" secondItem="kXr-kh-VHY" secondAttribute="leading" id="ccz-pD-v7r"/> <constraint firstItem="X2k-bC-JyK" firstAttribute="trailing" secondItem="kXr-kh-VHY" secondAttribute="trailing" id="jgp-vL-hXX"/> + <constraint firstItem="VF6-UM-QQD" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="vzy-gI-nsl" secondAttribute="leading" constant="20" id="quB-Jj-eoZ"/> <constraint firstItem="Zbl-Ns-5VY" firstAttribute="trailing" secondItem="X2k-bC-JyK" secondAttribute="trailing" id="sPo-Rn-1fh"/> - <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="kXr-kh-VHY" secondAttribute="trailing" constant="10" id="w4D-8T-3bH"/> + <constraint firstAttribute="trailing" secondItem="kXr-kh-VHY" secondAttribute="trailing" priority="750" constant="40" id="w4D-8T-3bH"/> </constraints> </stackView> </subviews> diff --git a/Ring/Ring/MigrateAccount/MigrateAccountViewController.swift b/Ring/Ring/MigrateAccount/MigrateAccountViewController.swift index 1eaf4b979eff4ec1a3abadc58f0773a29daf1371..c628668e77e4a22cd130a606712976b4328ad646 100644 --- a/Ring/Ring/MigrateAccount/MigrateAccountViewController.swift +++ b/Ring/Ring/MigrateAccount/MigrateAccountViewController.swift @@ -52,10 +52,10 @@ class MigrateAccountViewController: UIViewController, StoryboardBased, ViewModel override func viewDidLoad() { super.viewDidLoad() + self.view.layoutIfNeeded() self.scrollView.alwaysBounceHorizontal = false self.scrollView.alwaysBounceVertical = true self.migrateButton.applyGradient(with: [UIColor.jamiButtonLight, UIColor.jamiButtonDark], gradient: .horizontal) - self.removeAccountButton.applyGradient(with: [UIColor.jamiButtonLight, UIColor.jamiButtonDark], gradient: .horizontal) self.cancelButton.applyGradient(with: [UIColor.jamiButtonLight, UIColor.jamiButtonDark], gradient: .horizontal) self.migrateOtherAccountButton.applyGradient(with: [UIColor.jamiButtonLight, UIColor.jamiButtonDark], gradient: .horizontal) self.bindViewToViewModel() @@ -64,6 +64,14 @@ class MigrateAccountViewController: UIViewController, StoryboardBased, ViewModel // handle keyboard self.adaptToKeyboardState(for: self.scrollView, with: self.disposeBag) keyboardDismissTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard)) + NotificationCenter.default.rx + .notification(UIDevice.orientationDidChangeNotification) + .observeOn(MainScheduler.instance) + .subscribe(onNext: { [weak self] (_) in + self?.migrateButton.updateGradientFrame() + self?.cancelButton.updateGradientFrame() + self?.migrateOtherAccountButton.updateGradientFrame() + }).disposed(by: self.disposeBag) } override func viewWillAppear(_ animated: Bool) { diff --git a/Ring/Ring/QRCode/ScanViewController.swift b/Ring/Ring/QRCode/ScanViewController.swift index da163c209cae084bc2aa6e5bf61513f69de82d2d..006da5caf12552d26cd1cd94894aa979913ba17c 100644 --- a/Ring/Ring/QRCode/ScanViewController.swift +++ b/Ring/Ring/QRCode/ScanViewController.swift @@ -31,6 +31,7 @@ class ScanViewController: UIViewController, StoryboardBased, AVCaptureMetadataOu @IBOutlet weak var searchTitle: UILabel! @IBOutlet weak var bottomMarginTitleConstraint: NSLayoutConstraint! @IBOutlet weak var bottomCloseButtonConstraint: NSLayoutConstraint! + let disposeBag = DisposeBag() // MARK: variables let systemSoundId: SystemSoundID = 1016 @@ -101,15 +102,47 @@ class ScanViewController: UIViewController, StoryboardBased, AVCaptureMetadataOu //The videoPreviewLayer displays video in conjunction with the captureSession videoPreviewLayer = AVCaptureVideoPreviewLayer(session: captureSession!) + if videoPreviewLayer?.connection?.isVideoMirroringSupported ?? false { + videoPreviewLayer?.connection?.automaticallyAdjustsVideoMirroring = false + videoPreviewLayer?.connection?.isVideoMirrored = false + } videoPreviewLayer?.videoGravity = .resizeAspectFill - videoPreviewLayer?.frame = view.layer.bounds + videoPreviewLayer?.frame = view.bounds self.searchTitle.text = L10n.Scan.search view.layer.addSublayer(videoPreviewLayer!) view.bringSubviewToFront(header) view.bringSubviewToFront(self.scanImage) } catch { print("Error") } } + self.updateOrientation() + NotificationCenter.default.rx + .notification(UIDevice.orientationDidChangeNotification) + .observeOn(MainScheduler.instance) + .subscribe(onNext: {[weak self] (_) in + guard let self = self else {return} + self.videoPreviewLayer?.frame = self.view.bounds + self.updateOrientation() + self.view.layoutSubviews() + self.view.layer.layoutSublayers() + }).disposed(by: self.disposeBag) + } + func updateOrientation() { + if self.videoPreviewLayer?.connection!.isVideoOrientationSupported ?? false { + let orientation: UIDeviceOrientation = UIDevice.current.orientation + var cameraOrientation = AVCaptureVideoOrientation.portrait + switch orientation { + case .landscapeRight: + cameraOrientation = AVCaptureVideoOrientation.landscapeLeft + case .landscapeLeft: + cameraOrientation = AVCaptureVideoOrientation.landscapeRight + case .portraitUpsideDown: + cameraOrientation = AVCaptureVideoOrientation.portraitUpsideDown + default: + cameraOrientation = AVCaptureVideoOrientation.portrait + } + self.videoPreviewLayer?.connection?.videoOrientation = cameraOrientation + } } // the metadataOutput function informs our delegate (the ScanViewController) that the captureOutput emitted a new metaData Object diff --git a/Ring/Ring/Resources/en.lproj/Localizable.strings b/Ring/Ring/Resources/en.lproj/Localizable.strings index aa5dea4f30bf1ae297573a92ef05d0a2ac06537f..58116dbc2c2bf3f0f218ce2c3bfe4500108b872b 100644 --- a/Ring/Ring/Resources/en.lproj/Localizable.strings +++ b/Ring/Ring/Resources/en.lproj/Localizable.strings @@ -57,6 +57,7 @@ "welcome.text" = "Jami is a free and universal communication platform which preserves the users' privacy and freedoms"; "welcome.linkDevice" = "Link this device to an account"; "welcome.createAccount" = "Create a Jami account"; +"welcome.connectToManager" = "Connect to account manager"; //Creation Profile Screen "createProfile.skipCreateProfile" = "Skip";