Skip to content

Commit 7984adb

Browse files
authored
nate/design-fix/LOOP-1310/icon-placement (#147)
* corrected placement of status bar icons. Also pump status highlight and progress display on restart * shrink the basal waveform to give more padding
1 parent ad76237 commit 7984adb

File tree

3 files changed

+20
-42
lines changed

3 files changed

+20
-42
lines changed

Loop/View Controllers/StatusTableViewController.swift

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -219,26 +219,6 @@ final class StatusTableViewController: ChartsTableViewController {
219219
}
220220
}
221221

222-
var pumpStatusHighlight: PumpManagerStatus.PumpStatusHighlight? {
223-
didSet {
224-
if oldValue != pumpStatusHighlight {
225-
log.debug("New pumpStatusHighlight: %@", String(describing: pumpStatusHighlight))
226-
refreshContext.update(with: .status)
227-
self.reloadData(animated: true)
228-
}
229-
}
230-
}
231-
232-
var pumpLifecycleProgress: PumpManagerStatus.PumpLifecycleProgress? {
233-
didSet {
234-
if oldValue != pumpLifecycleProgress {
235-
log.debug("New pumpLifecycleProgress: %@", String(describing: pumpLifecycleProgress))
236-
refreshContext.update(with: .status)
237-
self.reloadData(animated: true)
238-
}
239-
}
240-
}
241-
242222
var bluetoothState: BluetoothStateManager.BluetoothState = .other {
243223
didSet {
244224
if bluetoothState != oldValue {
@@ -544,10 +524,10 @@ final class StatusTableViewController: ChartsTableViewController {
544524
} else if self.deviceManager.pumpManager == nil {
545525
hudView.pumpStatusHUD.presentAddPumpHighlight()
546526
} else {
547-
hudView.pumpStatusHUD.presentStatusHighlight(self.pumpStatusHighlight)
527+
hudView.pumpStatusHUD.presentStatusHighlight(self.deviceManager.pumpManagerStatus?.pumpStatusHighlight)
548528
}
549529

550-
hudView.pumpStatusHUD.lifecycleProgress = self.pumpLifecycleProgress
530+
hudView.pumpStatusHUD.lifecycleProgress = self.deviceManager.pumpManagerStatus?.pumpLifecycleProgress
551531
}
552532

553533
// Show/hide the table view rows
@@ -1582,8 +1562,6 @@ extension StatusTableViewController: PumpManagerStatusObserver {
15821562

15831563
self.basalDeliveryState = status.basalDeliveryState
15841564
self.bolusState = status.bolusState
1585-
self.pumpStatusHighlight = status.pumpStatusHighlight
1586-
self.pumpLifecycleProgress = status.pumpLifecycleProgress
15871565
}
15881566
}
15891567

LoopUI/StatusBarHUDView.xib

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
2828
</view>
2929
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="u3Q-Vj-Efw">
30-
<rect key="frame" x="16" y="10" width="126" height="44"/>
30+
<rect key="frame" x="18" y="10" width="126" height="44"/>
3131
<subviews>
3232
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4ED-GN-I8z" customClass="GlucoseValueHUDView" customModule="LoopUI" customModuleProvider="target">
3333
<rect key="frame" x="0.0" y="0.0" width="92" height="44"/>
@@ -108,12 +108,12 @@
108108
<constraint firstItem="u3Q-Vj-Efw" firstAttribute="top" secondItem="76s-1c-uyr" secondAttribute="top" constant="10" id="7eK-H8-1dG"/>
109109
<constraint firstItem="QwU-5e-NnT" firstAttribute="top" secondItem="76s-1c-uyr" secondAttribute="top" constant="10" id="FJE-uP-HIa"/>
110110
<constraint firstAttribute="bottom" secondItem="QwU-5e-NnT" secondAttribute="bottom" constant="20" id="HX0-Mo-7hM"/>
111-
<constraint firstAttribute="trailing" secondItem="u3Q-Vj-Efw" secondAttribute="trailing" constant="8" id="SQf-2L-eun"/>
111+
<constraint firstAttribute="trailing" secondItem="u3Q-Vj-Efw" secondAttribute="trailing" constant="6" id="SQf-2L-eun"/>
112112
<constraint firstAttribute="bottom" secondItem="vmJ-km-UjN" secondAttribute="bottom" constant="8" id="Ski-fr-qQY"/>
113113
<constraint firstAttribute="bottom" secondItem="u3Q-Vj-Efw" secondAttribute="bottom" constant="20" id="cK2-Am-j0i"/>
114114
<constraint firstAttribute="trailing" secondItem="vmJ-km-UjN" secondAttribute="trailing" constant="18" id="dKx-hl-4cd"/>
115115
<constraint firstItem="QwU-5e-NnT" firstAttribute="leading" secondItem="76s-1c-uyr" secondAttribute="leading" constant="8" id="gSX-7g-ZXB"/>
116-
<constraint firstItem="u3Q-Vj-Efw" firstAttribute="leading" secondItem="QwU-5e-NnT" secondAttribute="leading" constant="8" id="o0e-1l-DTi"/>
116+
<constraint firstItem="u3Q-Vj-Efw" firstAttribute="leading" secondItem="QwU-5e-NnT" secondAttribute="leading" constant="10" id="o0e-1l-DTi"/>
117117
<constraint firstAttribute="trailing" secondItem="QwU-5e-NnT" secondAttribute="trailing" id="tlj-zT-JTO"/>
118118
</constraints>
119119
<connections>
@@ -163,20 +163,20 @@
163163
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
164164
</view>
165165
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="xRi-qE-U6T">
166-
<rect key="frame" x="8" y="10" width="126" height="44"/>
166+
<rect key="frame" x="6" y="10" width="126" height="44"/>
167167
<subviews>
168168
<view contentMode="scaleToFill" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="fsr-gH-zny" customClass="BasalRateHUDView" customModule="LoopUI">
169-
<rect key="frame" x="0.0" y="0.0" width="66" height="44"/>
169+
<rect key="frame" x="0.0" y="0.0" width="70" height="44"/>
170170
<subviews>
171171
<view contentMode="scaleToFill" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="geI-yt-4dZ" customClass="BasalStateView" customModule="LoopUI">
172-
<rect key="frame" x="11" y="2" width="44" height="24"/>
172+
<rect key="frame" x="13" y="4" width="44" height="22"/>
173173
<constraints>
174174
<constraint firstAttribute="width" constant="44" id="MH2-vl-X1f"/>
175-
<constraint firstAttribute="height" constant="24" id="RH0-65-hn8"/>
175+
<constraint firstAttribute="height" constant="22" id="RH0-65-hn8"/>
176176
</constraints>
177177
</view>
178178
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="-0.85 U" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="x36-Sl-eth">
179-
<rect key="frame" x="0.0" y="27" width="66" height="13.5"/>
179+
<rect key="frame" x="0.0" y="27" width="70" height="13.5"/>
180180
<fontDescription key="fontDescription" style="UICTFontTextStyleCaption2"/>
181181
<color key="textColor" systemColor="secondaryLabelColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
182182
<nil key="highlightedColor"/>
@@ -189,7 +189,7 @@
189189
<constraint firstItem="x36-Sl-eth" firstAttribute="leading" secondItem="fsr-gH-zny" secondAttribute="leading" id="HLa-kN-zKm"/>
190190
<constraint firstItem="x36-Sl-eth" firstAttribute="top" secondItem="geI-yt-4dZ" secondAttribute="bottom" constant="1" id="IhN-WP-cis"/>
191191
<constraint firstAttribute="bottom" secondItem="x36-Sl-eth" secondAttribute="bottom" constant="3.5" id="PnU-P2-jqu"/>
192-
<constraint firstItem="geI-yt-4dZ" firstAttribute="top" secondItem="fsr-gH-zny" secondAttribute="top" constant="2" id="dMd-u4-EV0"/>
192+
<constraint firstItem="geI-yt-4dZ" firstAttribute="top" secondItem="fsr-gH-zny" secondAttribute="top" constant="4" id="dMd-u4-EV0"/>
193193
<constraint firstItem="x36-Sl-eth" firstAttribute="trailing" secondItem="fsr-gH-zny" secondAttribute="trailing" id="epR-pj-I12"/>
194194
<constraint firstItem="geI-yt-4dZ" firstAttribute="centerX" secondItem="fsr-gH-zny" secondAttribute="centerX" id="h0T-1M-q42"/>
195195
</constraints>
@@ -199,10 +199,10 @@
199199
</connections>
200200
</view>
201201
<view contentMode="scaleToFill" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="zyz-JH-sNX" customClass="LevelHUDView" customModule="LoopKitUI">
202-
<rect key="frame" x="74" y="0.0" width="52" height="44"/>
202+
<rect key="frame" x="78" y="0.0" width="48" height="44"/>
203203
<subviews>
204204
<view clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="jfu-In-s2Y">
205-
<rect key="frame" x="8" y="5" width="36" height="34"/>
205+
<rect key="frame" x="6" y="5" width="36" height="34"/>
206206
<subviews>
207207
<view contentMode="scaleAspectFit" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="Q7F-Ri-GZd" customClass="LevelMaskView" customModule="LoopKitUI">
208208
<rect key="frame" x="7" y="5" width="22" height="29"/>
@@ -233,7 +233,7 @@
233233
</constraints>
234234
</view>
235235
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="44U" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="K9w-1i-FGo">
236-
<rect key="frame" x="16" y="14.5" width="20.5" height="11"/>
236+
<rect key="frame" x="14" y="14.5" width="20.5" height="11"/>
237237
<fontDescription key="fontDescription" type="system" weight="heavy" pointSize="9"/>
238238
<color key="textColor" systemColor="systemBlueColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
239239
<nil key="highlightedColor"/>
@@ -243,13 +243,13 @@
243243
<bool key="isElement" value="YES"/>
244244
</accessibility>
245245
<constraints>
246-
<constraint firstAttribute="width" constant="52" id="5PW-rw-7mW"/>
246+
<constraint firstAttribute="width" constant="48" id="5PW-rw-7mW"/>
247247
<constraint firstItem="K9w-1i-FGo" firstAttribute="centerY" secondItem="jfu-In-s2Y" secondAttribute="centerY" constant="-2" id="BWD-ZK-UZ5"/>
248248
<constraint firstAttribute="bottom" secondItem="jfu-In-s2Y" secondAttribute="bottom" constant="5" id="JC7-IZ-sXa"/>
249249
<constraint firstItem="K9w-1i-FGo" firstAttribute="centerX" secondItem="jfu-In-s2Y" secondAttribute="centerX" id="Mah-jP-K8a"/>
250250
<constraint firstItem="jfu-In-s2Y" firstAttribute="top" secondItem="zyz-JH-sNX" secondAttribute="top" constant="5" id="gsV-RE-Izc"/>
251-
<constraint firstAttribute="trailing" secondItem="jfu-In-s2Y" secondAttribute="trailing" constant="8" id="kTg-za-OGJ"/>
252-
<constraint firstItem="jfu-In-s2Y" firstAttribute="leading" secondItem="zyz-JH-sNX" secondAttribute="leading" constant="8" id="ufk-q1-kY4"/>
251+
<constraint firstAttribute="trailing" secondItem="jfu-In-s2Y" secondAttribute="trailing" constant="6" id="kTg-za-OGJ"/>
252+
<constraint firstItem="jfu-In-s2Y" firstAttribute="leading" secondItem="zyz-JH-sNX" secondAttribute="leading" constant="6" id="ufk-q1-kY4"/>
253253
</constraints>
254254
<connections>
255255
<outlet property="levelMaskView" destination="Q7F-Ri-GZd" id="HeI-MW-sXE"/>
@@ -273,8 +273,8 @@
273273
</accessibility>
274274
<constraints>
275275
<constraint firstAttribute="trailing" secondItem="cSv-zq-wo3" secondAttribute="trailing" constant="8" id="44c-GO-CFS"/>
276-
<constraint firstItem="xRi-qE-U6T" firstAttribute="leading" secondItem="F6P-l9-6hk" secondAttribute="leading" constant="8" id="4KS-fe-oLr"/>
277-
<constraint firstItem="xRi-qE-U6T" firstAttribute="trailing" secondItem="cSv-zq-wo3" secondAttribute="trailing" constant="-8" id="5vy-0l-cWN"/>
276+
<constraint firstItem="xRi-qE-U6T" firstAttribute="leading" secondItem="F6P-l9-6hk" secondAttribute="leading" constant="6" id="4KS-fe-oLr"/>
277+
<constraint firstItem="xRi-qE-U6T" firstAttribute="trailing" secondItem="cSv-zq-wo3" secondAttribute="trailing" constant="-10" id="5vy-0l-cWN"/>
278278
<constraint firstAttribute="bottom" secondItem="cSv-zq-wo3" secondAttribute="bottom" constant="20" id="My7-an-f3Q"/>
279279
<constraint firstItem="cSv-zq-wo3" firstAttribute="leading" secondItem="F6P-l9-6hk" secondAttribute="leading" id="UVW-4k-vOK"/>
280280
<constraint firstAttribute="bottom" secondItem="xRi-qE-U6T" secondAttribute="bottom" constant="20" id="Ylj-JL-X3Y"/>

LoopUI/StatusHighlightHUDView.xib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<outlet property="messageLabel" destination="csC-XY-a5C" id="b4Q-ZX-Y9A"/>
1414
</connections>
1515
</placeholder>
16+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
1617
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" spacing="5" id="vCH-Wo-Q6s">
1718
<rect key="frame" x="0.0" y="0.0" width="126" height="50"/>
1819
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>
@@ -39,7 +40,6 @@
3940
<viewLayoutGuide key="safeArea" id="5r5-dV-daA"/>
4041
<point key="canvasLocation" x="-819" y="-140"/>
4142
</stackView>
42-
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
4343
</objects>
4444
<resources>
4545
<image name="exclamationmark.circle.fill" catalog="system" width="128" height="121"/>

0 commit comments

Comments
 (0)