Some style for the QR code scanner.

Also made identity key scanner appear faster. Previously we were
waiting for camera to initialize. Now we do this after the view has
loaded - with a black background, the affect is preferable than
lagging on the transition.

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent f28400146f
commit 7e67fb1939

@ -77,6 +77,11 @@
"idiom" : "ipad",
"filename" : "launch-icon-ipad@2x.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

@ -0,0 +1,26 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_devices_ios.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_devices_ios@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_devices_ios@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

@ -38,7 +38,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>2.5.0.4</string>
<string>2.5.0.5</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LOGS_EMAIL</key>

@ -3,6 +3,7 @@
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
@ -365,7 +366,7 @@ A0 09 9A FF A8 8A 09 99</string>
</connections>
</tapGestureRecognizer>
</objects>
<point key="canvasLocation" x="-1935.2" y="-2598.5999999999999"/>
<point key="canvasLocation" x="-1944" y="-2339"/>
</scene>
<!--Show Group Members View Controller-->
<scene sceneID="VBt-Ax-0G9">
@ -380,7 +381,7 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="22" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hyn-Ss-OAa" id="4XE-JO-Upr">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
@ -453,7 +454,7 @@ A0 09 9A FF A8 8A 09 99</string>
<placeholder placeholderIdentifier="IBFirstResponder" id="Zk1-cK-ftT" userLabel="First Responder" sceneMemberID="firstResponder"/>
<exit id="MWg-NL-WXh" userLabel="Exit" sceneMemberID="exit"/>
</objects>
<point key="canvasLocation" x="-1494.4000000000001" y="-1967.1733333333334"/>
<point key="canvasLocation" x="-1495" y="-1940"/>
</scene>
<!--Scan Identity Barcode View Controller-->
<scene sceneID="f84-pF-1is">
@ -481,7 +482,7 @@ A0 09 9A FF A8 8A 09 99</string>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="bag-cN-IZy" firstAttribute="leading" secondItem="Du7-nD-ScY" secondAttribute="leadingMargin" id="vL9-x7-knG"/>
<constraint firstAttribute="bottom" secondItem="bag-cN-IZy" secondAttribute="bottom" constant="20" symbolic="YES" id="zaD-R1-jw2"/>
@ -495,7 +496,7 @@ A0 09 9A FF A8 8A 09 99</string>
<placeholder placeholderIdentifier="IBFirstResponder" id="VTv-Ry-X99" userLabel="First Responder" sceneMemberID="firstResponder"/>
<exit id="aQ6-9V-CJA" userLabel="Exit" sceneMemberID="exit"/>
</objects>
<point key="canvasLocation" x="-1493.5999999999999" y="-2814.4400000000001"/>
<point key="canvasLocation" x="-1495" y="-2584"/>
</scene>
<!--_1.0 Registration Screen-->
<scene sceneID="okO-46-HuB">
@ -745,7 +746,7 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="130" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hpG-pz-GPZ" id="gVo-Nw-ff7" userLabel="Country Code Table Row">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" tag="1" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="United states" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SDz-Ag-lp3">
@ -1360,10 +1361,10 @@ A0 09 9A FF A8 8A 09 99</string>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="ExistingDevice" rowHeight="72" id="XjV-oU-jSb" customClass="OWSDeviceTableViewCell">
<rect key="frame" x="0.0" y="114" width="320" height="72"/>
<rect key="frame" x="0.0" y="113.5" width="320" height="72"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="XjV-oU-jSb" id="XqL-QG-IbY">
<rect key="frame" x="0.0" y="0.0" width="320" height="71"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="71.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Signal on Chrome" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="57o-uV-YOg">
@ -1372,13 +1373,13 @@ A0 09 9A FF A8 8A 09 99</string>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" misplaced="YES" text="Linked: Jun 12, 2016" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uL2-wj-OZr">
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Linked: Jun 12, 2016" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uL2-wj-OZr">
<rect key="frame" x="17" y="28" width="116" height="17"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" misplaced="YES" text="Last Seen: Aug 25, 2016" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Kek-MK-oLy">
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Last Seen: Aug 25, 2016" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Kek-MK-oLy">
<rect key="frame" x="17" y="45" width="138" height="18"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@ -1404,21 +1405,21 @@ A0 09 9A FF A8 8A 09 99</string>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="AddNewDevice" textLabel="w80-IJ-E6R" detailTextLabel="8ft-2u-wBF" style="IBUITableViewCellStyleSubtitle" id="6h2-gg-1C6">
<rect key="frame" x="0.0" y="186" width="320" height="44"/>
<rect key="frame" x="0.0" y="185.5" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="6h2-gg-1C6" id="RKi-c6-pzb">
<rect key="frame" x="0.0" y="0.0" width="287" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="287" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Link New Device" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="w80-IJ-E6R">
<rect key="frame" x="15" y="4" width="121" height="20"/>
<rect key="frame" x="15" y="5" width="120.5" height="19.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Scan QR Code" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="8ft-2u-wBF">
<rect key="frame" x="15" y="24" width="82" height="15"/>
<rect key="frame" x="15" y="24.5" width="82" height="14.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@ -1457,7 +1458,7 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="64" width="320" height="118"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="5zF-Ko-9qU" id="gr7-Sm-bcs">
<rect key="frame" x="0.0" y="0.0" width="320" height="117"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="117.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1 (708) 000-1234" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ipE-BI-sLL">
@ -1498,7 +1499,7 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="182" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="8rk-06-1ZS" id="hqv-P5-du9">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Network Status" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uNq-FV-lwt">
@ -1537,11 +1538,11 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="226" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ITG-sW-Zn0" id="vOb-SA-SH2">
<rect key="frame" x="0.0" y="0.0" width="287" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="287" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Privacy" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="i1f-DT-7rL">
<rect key="frame" x="15" y="0.0" width="270" height="43"/>
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@ -1554,11 +1555,11 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="270" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="jp5-vZ-AhJ" id="sji-CJ-bhq">
<rect key="frame" x="0.0" y="0.0" width="287" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="287" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Notifications" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="tRQ-1p-6aT">
<rect key="frame" x="15" y="0.0" width="270" height="43"/>
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@ -1571,11 +1572,11 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="314" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="wZ8-fs-Ylw" id="Ua5-nw-s2z">
<rect key="frame" x="0.0" y="0.0" width="287" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="287" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Linked Devices" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="hrc-lZ-NeA">
<rect key="frame" x="15" y="0.0" width="270" height="43"/>
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@ -1591,11 +1592,11 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="358" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Xx7-pz-aLN" id="pMA-vR-8Ae">
<rect key="frame" x="0.0" y="0.0" width="287" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="287" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Advanced" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="dkL-Nz-E6H">
<rect key="frame" x="15" y="0.0" width="270" height="43"/>
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@ -1608,11 +1609,11 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="402" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="EI4-kQ-MMA" id="czg-5p-aVz">
<rect key="frame" x="0.0" y="0.0" width="287" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="287" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="About" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="qeN-f1-cIQ">
<rect key="frame" x="15" y="0.0" width="270" height="43"/>
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@ -1629,7 +1630,7 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="446" width="320" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="R82-FT-SEA" id="Ok9-fE-WhB">
<rect key="frame" x="0.0" y="0.0" width="320" height="99"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="99.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4Mk-ly-6fq">
@ -1702,9 +1703,80 @@ A0 09 9A FF A8 8A 09 99</string>
<view key="view" contentMode="scaleToFill" id="XYT-jy-1yR">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6B0-ZZ-d6K" userLabel="Instructions">
<rect key="frame" x="16" y="294" width="288" height="230"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Oqf-fj-8Va" userLabel="Spacer">
<rect key="frame" x="0.0" y="0.0" width="288" height="40"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="16" id="Xq5-fV-fUr"/>
</constraints>
</view>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="devices-icon" translatesAutoresizingMaskIntoConstraints="NO" id="zl7-KG-ma4">
<rect key="frame" x="72" y="40" width="144" height="115"/>
<color key="tintColor" red="0.67450980392156867" green="0.67450980392156867" blue="0.67450980392156867" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" secondItem="zl7-KG-ma4" secondAttribute="height" multiplier="5:4" id="RKt-hc-iWB"/>
</constraints>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GMf-cM-kQN" userLabel="Spacer">
<rect key="frame" x="0.0" y="190.5" width="288" height="39.5"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Scan the QR code displayed on the device to link." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="3D8-yn-TJ8">
<rect key="frame" x="0.0" y="171" width="288" height="19.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="GMf-cM-kQN" firstAttribute="top" secondItem="3D8-yn-TJ8" secondAttribute="bottom" id="1Aa-eC-Btt"/>
<constraint firstAttribute="trailing" secondItem="3D8-yn-TJ8" secondAttribute="trailing" id="3nn-2q-410"/>
<constraint firstItem="3D8-yn-TJ8" firstAttribute="centerX" secondItem="6B0-ZZ-d6K" secondAttribute="centerX" id="4RV-Ni-MSU"/>
<constraint firstItem="zl7-KG-ma4" firstAttribute="centerX" secondItem="6B0-ZZ-d6K" secondAttribute="centerX" id="Gto-9J-MBy"/>
<constraint firstItem="Oqf-fj-8Va" firstAttribute="top" secondItem="6B0-ZZ-d6K" secondAttribute="top" id="I98-tS-4Zz"/>
<constraint firstItem="zl7-KG-ma4" firstAttribute="width" secondItem="6B0-ZZ-d6K" secondAttribute="width" multiplier="0.5" id="LRW-Tk-Iqw"/>
<constraint firstItem="Oqf-fj-8Va" firstAttribute="height" secondItem="GMf-cM-kQN" secondAttribute="height" id="PCs-h1-GSh"/>
<constraint firstAttribute="bottom" secondItem="GMf-cM-kQN" secondAttribute="bottom" id="WUh-ur-3Yy"/>
<constraint firstItem="3D8-yn-TJ8" firstAttribute="top" secondItem="zl7-KG-ma4" secondAttribute="bottom" constant="16" id="XFH-UK-1mo"/>
<constraint firstItem="GMf-cM-kQN" firstAttribute="width" secondItem="6B0-ZZ-d6K" secondAttribute="width" id="cAj-Ii-Nxv"/>
<constraint firstItem="Oqf-fj-8Va" firstAttribute="width" secondItem="6B0-ZZ-d6K" secondAttribute="width" id="eVH-uq-RPl"/>
<constraint firstItem="3D8-yn-TJ8" firstAttribute="leading" secondItem="6B0-ZZ-d6K" secondAttribute="leading" id="gBK-bQ-mel"/>
<constraint firstItem="zl7-KG-ma4" firstAttribute="top" secondItem="Oqf-fj-8Va" secondAttribute="bottom" id="rhg-sr-hER"/>
<constraint firstItem="Oqf-fj-8Va" firstAttribute="centerX" secondItem="6B0-ZZ-d6K" secondAttribute="centerX" id="udm-8V-xQ0"/>
<constraint firstItem="GMf-cM-kQN" firstAttribute="centerX" secondItem="6B0-ZZ-d6K" secondAttribute="centerX" id="xMi-b6-Px2"/>
</constraints>
</view>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eF5-us-VJe">
<rect key="frame" x="0.0" y="64" width="320" height="230"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<segue destination="xDh-Mk-Yo9" kind="embed" identifier="embedDeviceQRScanner" id="mve-0t-D0g"/>
</connections>
</containerView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="eF5-us-VJe" firstAttribute="leading" secondItem="XYT-jy-1yR" secondAttribute="leading" id="Dhy-We-RwI"/>
<constraint firstItem="6B0-ZZ-d6K" firstAttribute="leading" secondItem="XYT-jy-1yR" secondAttribute="leadingMargin" id="EUH-nz-kiP"/>
<constraint firstItem="6B0-ZZ-d6K" firstAttribute="height" secondItem="eF5-us-VJe" secondAttribute="height" id="Fj7-4c-vv9"/>
<constraint firstAttribute="trailing" secondItem="eF5-us-VJe" secondAttribute="trailing" id="Iag-Z0-aIy"/>
<constraint firstItem="eF5-us-VJe" firstAttribute="top" secondItem="HSZ-fb-tHK" secondAttribute="bottom" id="JW1-ne-tF7"/>
<constraint firstItem="6B0-ZZ-d6K" firstAttribute="top" secondItem="eF5-us-VJe" secondAttribute="bottom" id="UJr-YC-IcC"/>
<constraint firstItem="nre-8Q-MvI" firstAttribute="top" secondItem="6B0-ZZ-d6K" secondAttribute="bottom" id="c2b-Wz-z6U"/>
<constraint firstItem="eF5-us-VJe" firstAttribute="width" secondItem="XYT-jy-1yR" secondAttribute="width" id="gOe-Rq-SKo"/>
<constraint firstAttribute="trailingMargin" secondItem="6B0-ZZ-d6K" secondAttribute="trailing" id="qBl-kf-5Fr"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="Link Device" id="OnR-Ni-zff"/>
<connections>
<outlet property="qrScanningView" destination="eF5-us-VJe" id="du3-ov-cGw"/>
<outlet property="scanningInstructionsLabel" destination="3D8-yn-TJ8" id="roC-Qj-INs"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="lPR-Bk-TZT" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
@ -1742,7 +1814,7 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="22" width="320" height="48"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Ld5-sX-pB8" id="EqP-87-4hZ">
<rect key="frame" x="0.0" y="0.0" width="320" height="47"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="47.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="urb-Me-knG">
@ -1865,11 +1937,11 @@ A0 09 9A FF A8 8A 09 99</string>
<rect key="frame" x="0.0" y="62" width="320" height="60"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="yfF-Jl-bZ1" id="f0v-od-N9K">
<rect key="frame" x="0.0" y="0.0" width="320" height="59"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="59.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="a4j-OQ-ala">
<rect key="frame" x="15" y="0.0" width="290" height="59"/>
<rect key="frame" x="15" y="0.0" width="290" height="59.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@ -1936,6 +2008,24 @@ A0 09 9A FF A8 8A 09 99</string>
</objects>
<point key="canvasLocation" x="-4372" y="-732.72000000000003"/>
</scene>
<!--Code Scanning View Controller-->
<scene sceneID="f3S-St-vF2">
<objects>
<viewController id="xDh-Mk-Yo9" customClass="OWSQRCodeScanningViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="YV9-ra-E3e"/>
<viewControllerLayoutGuide type="bottom" id="s4y-gf-WU5"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="aYO-nF-lxB">
<rect key="frame" x="0.0" y="0.0" width="320" height="230"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="sg5-uD-LVc" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1632" y="-3228"/>
</scene>
</scenes>
<resources>
<image name="_arrow_button" width="12" height="23"/>
@ -1946,6 +2036,7 @@ A0 09 9A FF A8 8A 09 99</string>
<image name="btnQRShow--white-1" width="66" height="66"/>
<image name="call.png" width="100" height="100"/>
<image name="contact-options-action" width="44" height="44"/>
<image name="devices-icon" width="180" height="144"/>
<image name="empty-group-avatar" width="53" height="53"/>
<image name="endcall.png" width="100" height="100"/>
<image name="logoSignal" width="138" height="139"/>

@ -4,7 +4,7 @@
@class OWSLinkedDevicesTableViewController;
@interface OWSLinkDeviceViewController : OWSQRCodeScanningViewController
@interface OWSLinkDeviceViewController : UIViewController <OWSQRScannerDelegate>
@property OWSLinkedDevicesTableViewController *linkedDevicesTableViewController;

@ -11,20 +11,50 @@
NS_ASSUME_NONNULL_BEGIN
@interface OWSLinkDeviceViewController ()
@property (strong, nonatomic) IBOutlet UIView *qrScanningView;
@property (strong, nonatomic) IBOutlet UILabel *scanningInstructionsLabel;
@property (strong, nonatomic) OWSQRCodeScanningViewController *qrScanningController;
@end
@implementation OWSLinkDeviceViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// HACK to get full width preview layer
CGRect oldFrame = self.qrScanningView.frame;
self.qrScanningView.frame = CGRectMake(
oldFrame.origin.x, oldFrame.origin.y, self.view.frame.size.width, self.view.frame.size.height / 2.0 - 32.0);
[self.qrScanningController resizeViews];
// END HACK to get full width preview layer
self.scanningInstructionsLabel.text = NSLocalizedString(
@"Scan the QR code displayed on the device to link.", @"QR Scanning screen instructions label");
self.title = NSLocalizedString(@"Link New Device", "Navigation title when scanning QR code to add new device.");
}
- (void)viewDidAppear:(BOOL)animated
- (void)viewWillAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[super viewWillAppear:animated];
}
- (void)didDetectQRCodeWithString:(NSString *)string
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(nullable id)sender
{
if ([segue.identifier isEqualToString:@"embedDeviceQRScanner"]) {
OWSQRCodeScanningViewController *qrScanningController
= (OWSQRCodeScanningViewController *)segue.destinationViewController;
qrScanningController.scanDelegate = self;
self.qrScanningController = qrScanningController;
}
}
// pragma mark - OWSQRScannerDelegate
- (void)controller:(OWSQRCodeScanningViewController *)controller didDetectQRCodeWithString:(NSString *)string
{
NSString *title = NSLocalizedString(@"Link this device?", @"Alert title");
NSString *linkingDescription = NSLocalizedString(@"This device will be able to see your groups and contacts, read "

@ -3,6 +3,14 @@
#import <AVFoundation/AVFoundation.h>
#import <UIKit/UIKit.h>
@class OWSQRCodeScanningViewController;
@protocol OWSQRScannerDelegate
- (void)controller:(OWSQRCodeScanningViewController *)controller didDetectQRCodeWithString:(NSString *)scannedString;
@end
@interface OWSQRCodeScanningViewController : UIViewController <AVCaptureMetadataOutputObjectsDelegate>
@property (nonatomic, strong) AVCaptureSession *session;
@ -12,5 +20,9 @@
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *prevLayer;
@property (nonatomic, strong) UIView *highlightView;
@property (nonatomic, weak) UIViewController<OWSQRScannerDelegate> *scanDelegate;
// HACK to resize views after embedding. Better would be to specify layout of preview layer as constraints.
- (void)resizeViews;
@end

@ -10,7 +10,6 @@
[super viewDidLoad];
self.title = NSLocalizedString(@"SCAN_KEY", @"");
self.highlightView = [[UIView alloc] init];
self.highlightView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin
| UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
@ -36,15 +35,29 @@
self.output.metadataObjectTypes = [self.output availableMetadataObjectTypes];
self.prevLayer = [AVCaptureVideoPreviewLayer layerWithSession:self.session];
self.prevLayer.frame = self.view.bounds;
self.prevLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
[self.view.layer insertSublayer:self.prevLayer atIndex:0];
[self.session startRunning];
[self.view bringSubviewToFront:self.highlightView];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self resizeViews];
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.session startRunning];
}
- (void)resizeViews
{
self.prevLayer.frame = self.view.bounds;
}
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputMetadataObjects:(NSArray *)metadataObjects
@ -77,8 +90,10 @@
- (void)didDetectQRCodeWithString:(NSString *)string
{
// Override in subclass. Subclass is responsible for dismissing this view controller.
DDLogInfo(@"Scanned QRCode with string value: %@", string);
DDLogDebug(@"Scanned QRCode with string value: %@", string);
if (self.scanDelegate) {
[self.scanDelegate controller:self didDetectQRCodeWithString:string];
}
}

Loading…
Cancel
Save