Skip to content

Commit

Permalink
Fix all auto layout issues with the On/Off Cluster View
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-apple committed Jun 3, 2020
1 parent 178ba83 commit 2526888
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 34 deletions.
3 changes: 1 addition & 2 deletions src/darwin/CHIPTool/CHIPTool/QRCode/QRCodeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define MAX_SSID_LEN 32

#define EXAMPLE_VENDOR_TAG_IP 2
#define MAX_IP_LEN 15
#define MAX_IP_LEN 46

#define NOT_APPLICABLE_STRING @"N/A"

Expand Down Expand Up @@ -202,7 +202,6 @@ - (void)showPayload:(CHIPSetupPayload *)payload decimalString:(nullable NSString
}
break;
}
// If the vendor id and tag match the example values, there should be an ssid encoded
}
}
}
Expand Down
75 changes: 43 additions & 32 deletions src/darwin/CHIPTool/CHIPTool/UI/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -349,16 +349,16 @@
<textInputTraits key="textInputTraits" keyboardType="decimalPad"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Hello from iOS!" textAlignment="natural" adjustsFontSizeToFit="NO" minimumFontSize="14" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="lvN-Eg-W6F">
<rect key="frame" x="16" y="323" width="283" height="34"/>
<rect key="frame" x="16" y="323" width="263" height="34"/>
<color key="backgroundColor" white="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" reversesTitleShadowWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cfO-gM-sug">
<rect key="frame" x="309" y="323" width="50" height="34"/>
<rect key="frame" x="289" y="323" width="70" height="34"/>
<color key="backgroundColor" systemColor="systemBlueColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="50" id="hYC-K5-DeY"/>
<constraint firstAttribute="width" constant="70" id="hYC-K5-DeY"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<state key="normal" title="Send">
Expand All @@ -368,7 +368,7 @@
<action selector="sendAction:" destination="NR6-8N-IDd" eventType="touchUpInside" id="zLO-Yj-bAY"/>
</connections>
</button>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ERROR" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" autoshrinkMode="minimumScaleFactor" translatesAutoresizingMaskIntoConstraints="NO" id="6Z1-j3-AvT">
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ERROR" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6Z1-j3-AvT">
<rect key="frame" x="16" y="397" width="343" height="14.333333333333314"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
Expand Down Expand Up @@ -550,36 +550,23 @@
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" keyboardType="decimalPad"/>
</textField>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="ERROR" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" autoshrinkMode="minimumScaleFactor" translatesAutoresizingMaskIntoConstraints="NO" id="ERS-fv-Yhs">
<rect key="frame" x="35" y="433" width="343" height="14.333333333333314"/>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ERROR" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ERS-fv-Yhs">
<rect key="frame" x="16" y="380" width="343" height="14.333333333333314"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" reversesTitleShadowWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jhI-Pt-QaG">
<rect key="frame" x="35" y="316" width="30" height="37"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" reversesTitleShadowWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jhI-Pt-QaG">
<rect key="frame" x="16" y="310" width="62" height="40"/>
<color key="backgroundColor" systemColor="systemBlueColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="Pkn-Un-j1t"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="On">
<preferredSymbolConfiguration key="preferredSymbolConfiguration" scale="default" weight="bold"/>
</state>
<connections>
<action selector="onButtonTapped:" destination="UgW-Ob-0KX" eventType="touchUpInside" id="vWi-b0-t9k"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" reversesTitleShadowWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cwX-vi-vgG">
<rect key="frame" x="157" y="316" width="39" height="37"/>
<color key="backgroundColor" systemColor="systemBlueColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="Off">
<preferredSymbolConfiguration key="preferredSymbolConfiguration" scale="default" weight="bold"/>
</state>
<connections>
<action selector="offButtonTapped:" destination="UgW-Ob-0KX" eventType="touchUpInside" id="JJt-5D-6pb"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="On / Off cluster" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eg3-7c-7WS">
<rect key="frame" x="77" y="107" width="242" height="72"/>
<constraints>
Expand All @@ -589,37 +576,61 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" reversesTitleShadowWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1XM-cR-Y6o">
<rect key="frame" x="35" y="382" width="55" height="30"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" reversesTitleShadowWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1XM-cR-Y6o">
<rect key="frame" x="160" y="310" width="62" height="40"/>
<color key="backgroundColor" systemColor="systemBlueColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="62" id="Aps-iV-q27"/>
<constraint firstAttribute="height" constant="40" id="fC7-42-Oyl"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="Toggle"/>
<connections>
<action selector="toggleButtonTapped:" destination="UgW-Ob-0KX" eventType="touchUpInside" id="tnj-3E-KKW"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" reversesTitleShadowWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cwX-vi-vgG">
<rect key="frame" x="88" y="310" width="62" height="40"/>
<color key="backgroundColor" systemColor="systemBlueColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="Off">
<preferredSymbolConfiguration key="preferredSymbolConfiguration" scale="default" weight="bold"/>
</state>
<connections>
<action selector="offButtonTapped:" destination="UgW-Ob-0KX" eventType="touchUpInside" id="JJt-5D-6pb"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="cwX-vi-vgG" firstAttribute="leading" secondItem="jhI-Pt-QaG" secondAttribute="trailing" constant="90" id="2pP-hz-iTG"/>
<constraint firstItem="cwX-vi-vgG" firstAttribute="width" secondItem="1XM-cR-Y6o" secondAttribute="width" id="582-Pj-QoZ"/>
<constraint firstItem="XIj-Oo-qmz" firstAttribute="leading" secondItem="kG5-yT-GzM" secondAttribute="leading" constant="16" id="6o4-kh-TOw"/>
<constraint firstItem="jhI-Pt-QaG" firstAttribute="top" secondItem="23l-Oa-cls" secondAttribute="bottom" constant="46" id="79r-Fr-K9c"/>
<constraint firstItem="cwX-vi-vgG" firstAttribute="height" secondItem="1XM-cR-Y6o" secondAttribute="height" id="ARb-ea-aSV"/>
<constraint firstItem="eg3-7c-7WS" firstAttribute="top" secondItem="kG5-yT-GzM" secondAttribute="top" constant="19" id="Eu0-fd-IpC"/>
<constraint firstItem="XIj-Oo-qmz" firstAttribute="leading" secondItem="c45-FF-oLb" secondAttribute="leadingMargin" id="KLq-hK-kli"/>
<constraint firstItem="ERS-fv-Yhs" firstAttribute="leading" secondItem="kG5-yT-GzM" secondAttribute="leading" constant="16" id="LVO-tn-vpG"/>
<constraint firstItem="eg3-7c-7WS" firstAttribute="leading" secondItem="kG5-yT-GzM" secondAttribute="leading" constant="77" id="LyU-T1-mwz"/>
<constraint firstItem="jhI-Pt-QaG" firstAttribute="baseline" secondItem="cwX-vi-vgG" secondAttribute="baseline" id="M7U-kC-85C"/>
<constraint firstItem="23l-Oa-cls" firstAttribute="leading" secondItem="Ezc-du-JDZ" secondAttribute="trailing" constant="96" id="NtY-zP-Rlc"/>
<constraint firstItem="23l-Oa-cls" firstAttribute="top" secondItem="WTA-xG-Iyv" secondAttribute="bottom" constant="9" id="Oow-zL-KUd"/>
<constraint firstItem="1XM-cR-Y6o" firstAttribute="top" relation="greaterThanOrEqual" secondItem="jhI-Pt-QaG" secondAttribute="bottom" constant="20" id="Pw9-4K-7au"/>
<constraint firstItem="1XM-cR-Y6o" firstAttribute="centerY" secondItem="cwX-vi-vgG" secondAttribute="centerY" id="PIV-cB-jxE"/>
<constraint firstItem="23l-Oa-cls" firstAttribute="centerY" secondItem="Ezc-du-JDZ" secondAttribute="centerY" id="QVB-6k-YPM"/>
<constraint firstItem="1XM-cR-Y6o" firstAttribute="leading" secondItem="kG5-yT-GzM" secondAttribute="leading" constant="35" id="Ux0-gv-R5P"/>
<constraint firstItem="ERS-fv-Yhs" firstAttribute="top" secondItem="1XM-cR-Y6o" secondAttribute="bottom" constant="20" id="Z7f-bC-AAf"/>
<constraint firstItem="Ezc-du-JDZ" firstAttribute="leading" secondItem="kG5-yT-GzM" secondAttribute="leading" constant="16.000000000000004" id="Rkq-lO-goG"/>
<constraint firstItem="ERS-fv-Yhs" firstAttribute="top" secondItem="jhI-Pt-QaG" secondAttribute="bottom" constant="30" id="SfK-C8-ojg"/>
<constraint firstItem="kG5-yT-GzM" firstAttribute="trailing" relation="lessThanOrEqual" secondItem="1XM-cR-Y6o" secondAttribute="trailing" constant="200" id="Ssx-2M-iya"/>
<constraint firstItem="cwX-vi-vgG" firstAttribute="leading" secondItem="jhI-Pt-QaG" secondAttribute="trailing" constant="10" id="Urx-pk-Pkt"/>
<constraint firstItem="jhI-Pt-QaG" firstAttribute="height" secondItem="cwX-vi-vgG" secondAttribute="height" id="ZQb-0R-izb"/>
<constraint firstItem="jhI-Pt-QaG" firstAttribute="leading" secondItem="kG5-yT-GzM" secondAttribute="leading" constant="16" id="cec-Qo-hyK"/>
<constraint firstItem="XIj-Oo-qmz" firstAttribute="top" secondItem="eg3-7c-7WS" secondAttribute="bottom" constant="14.666666666666657" id="eBh-cR-lX1"/>
<constraint firstItem="kG5-yT-GzM" firstAttribute="trailing" secondItem="23l-Oa-cls" secondAttribute="trailing" constant="16" id="fDV-I9-84c"/>
<constraint firstItem="XIj-Oo-qmz" firstAttribute="leading" secondItem="Ezc-du-JDZ" secondAttribute="leading" id="gBb-uO-Qg6"/>
<constraint firstItem="jhI-Pt-QaG" firstAttribute="top" secondItem="Ezc-du-JDZ" secondAttribute="bottom" constant="58" id="q9S-Um-2Gx"/>
<constraint firstItem="kG5-yT-GzM" firstAttribute="trailing" secondItem="ERS-fv-Yhs" secondAttribute="trailing" constant="16" id="gij-Jw-J5R"/>
<constraint firstItem="1XM-cR-Y6o" firstAttribute="leading" secondItem="cwX-vi-vgG" secondAttribute="trailing" constant="10" id="kCe-dG-Nbo"/>
<constraint firstItem="cwX-vi-vgG" firstAttribute="centerY" secondItem="jhI-Pt-QaG" secondAttribute="centerY" id="lGp-co-aTI"/>
<constraint firstItem="jhI-Pt-QaG" firstAttribute="width" secondItem="cwX-vi-vgG" secondAttribute="width" id="ojo-ur-0qY"/>
<constraint firstItem="WTA-xG-Iyv" firstAttribute="top" secondItem="eg3-7c-7WS" secondAttribute="bottom" constant="8" id="qHB-PH-HAy"/>
<constraint firstItem="Ezc-du-JDZ" firstAttribute="top" secondItem="XIj-Oo-qmz" secondAttribute="bottom" constant="21.999999999999972" id="tfI-Y9-8mx"/>
<constraint firstItem="WTA-xG-Iyv" firstAttribute="leading" secondItem="XIj-Oo-qmz" secondAttribute="trailing" constant="60" id="vKc-Pj-8mO"/>
<constraint firstItem="jhI-Pt-QaG" firstAttribute="leading" secondItem="kG5-yT-GzM" secondAttribute="leading" constant="35" id="vlh-uz-5R2"/>
<constraint firstItem="jhI-Pt-QaG" firstAttribute="leading" secondItem="ERS-fv-Yhs" secondAttribute="leading" id="zAN-os-P5a"/>
<constraint firstItem="kG5-yT-GzM" firstAttribute="trailing" secondItem="WTA-xG-Iyv" secondAttribute="trailing" constant="16" id="zn9-Cg-vpP"/>
</constraints>
<viewLayoutGuide key="safeArea" id="kG5-yT-GzM"/>
Expand Down

0 comments on commit 2526888

Please sign in to comment.