Skip to content

Commit 0d397c4

Browse files
authored
Bolus progress and quick cancellation (#6)
* Bolus progress and quick cancellation * Add MKRingProgressView files directly * Update LICENCE file to include license for MKRingProgressView * Use MKRingProgressView via carthage * Use pumpmanager's bolusProgressEstimator * Updates from code review: - Delay removal of bolus progress so user sees progress finish - Reset ring progress during cell re-use - Tweak cornerRadius - Code clarity updates * PumpManager Protocol updates * Protocol naming update * Create bolus progress reporter * Fix progress animating from 1 to 0 on reuse.
1 parent cc1ae81 commit 0d397c4

File tree

8 files changed

+386
-65
lines changed

8 files changed

+386
-65
lines changed

Cartfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ github "LoopKit/dexcom-share-client-swift" "dev"
55
github "LoopKit/G4ShareSpy" "dev"
66
github "ps2/rileylink_ios" "dev"
77
github "LoopKit/Amplitude-iOS" "decreepify"
8+
github "maxkonovalov/MKRingProgressView" ~> 2.2

Cartfile.resolved

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ github "LoopKit/G4ShareSpy" "fed5a389e3e47e3a1953878dd21852aa5f44b360"
44
github "LoopKit/LoopKit" "bf4166bc77f89e22971f2030ad006967881ff082"
55
github "LoopKit/dexcom-share-client-swift" "b0419edf55c7f389b36cb47dd5c376bbd3d03d69"
66
github "i-schuetz/SwiftCharts" "0.6.2"
7+
github "maxkonovalov/MKRingProgressView" "2.2.1"
78
github "ps2/rileylink_ios" "46ed2c845e7c4b88c721994d8e8432e86be4c699"

LICENSE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ Copyright (c) 2016 Mark Wilson
5858
Copyright (c) 2015 Nathan Racklyeft
5959
Copyright (c) 2016 LoopKit Authors
6060

61+
## MKRingProgressView.framework
62+
63+
Copyright (c) 2015 Max Konovalov
64+
65+
6166
> Permission is hereby granted, free of charge, to any person obtaining a copy
6267
> of this software and associated documentation files (the "Software"), to deal
6368
> in the Software without restriction, including without limitation the rights

Loop.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@
297297
C10B28461EA9BA5E006EA1FC /* far_future_high_bg_forecast.json in Resources */ = {isa = PBXBuildFile; fileRef = C10B28451EA9BA5E006EA1FC /* far_future_high_bg_forecast.json */; };
298298
C11C87DE1E21EAAD00BB71D3 /* HKUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F526D5E1DF2459000A04910 /* HKUnit.swift */; };
299299
C12F21A71DFA79CB00748193 /* recommend_temp_basal_very_low_end_in_range.json in Resources */ = {isa = PBXBuildFile; fileRef = C12F21A61DFA79CB00748193 /* recommend_temp_basal_very_low_end_in_range.json */; };
300+
C13255D6223E7BE2008AF50C /* BolusProgressTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C1F8B1DB223862D500DD66CF /* BolusProgressTableViewCell.xib */; };
300301
C13BAD941E8009B000050CB5 /* NumberFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43BFF0B31E45C1BE00FF19A9 /* NumberFormatter.swift */; };
301302
C15713821DAC6983005BC4D2 /* MealBolusNightscoutTreatment.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15713811DAC6983005BC4D2 /* MealBolusNightscoutTreatment.swift */; };
302303
C168C40621B0D53E00ADE90E /* MinimedKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C168C40521B0D53E00ADE90E /* MinimedKit.framework */; };
@@ -310,6 +311,8 @@
310311
C18C8C511D5A351900E043FB /* NightscoutDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C18C8C501D5A351900E043FB /* NightscoutDataManager.swift */; };
311312
C1C6591C1E1B1FDA0025CC58 /* recommend_temp_basal_dropping_then_rising.json in Resources */ = {isa = PBXBuildFile; fileRef = C1C6591B1E1B1FDA0025CC58 /* recommend_temp_basal_dropping_then_rising.json */; };
312313
C1C73F0D1DE3D0270022FC89 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C1C73F0F1DE3D0270022FC89 /* InfoPlist.strings */; };
314+
C1E2774822433D7A00354103 /* MKRingProgressView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C1E2774722433D7A00354103 /* MKRingProgressView.framework */; };
315+
C1F8B243223E73FD00DD66CF /* BolusProgressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1F8B1D122375E4200DD66CF /* BolusProgressTableViewCell.swift */; };
313316
C1FB428C217806A400FAB378 /* StateColorPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1FB428B217806A300FAB378 /* StateColorPalette.swift */; };
314317
C1FB428D21791D2500FAB378 /* PumpManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C3B6F620BBCAA30026CAFA /* PumpManager.swift */; };
315318
C1FB428F217921D600FAB378 /* PumpManagerUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1FB428E217921D600FAB378 /* PumpManagerUI.swift */; };
@@ -851,6 +854,9 @@
851854
C18C8C501D5A351900E043FB /* NightscoutDataManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NightscoutDataManager.swift; sourceTree = "<group>"; };
852855
C1C108C22152F46D00EA5165 /* CGMBLEKitUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CGMBLEKitUI.framework; sourceTree = BUILT_PRODUCTS_DIR; };
853856
C1C6591B1E1B1FDA0025CC58 /* recommend_temp_basal_dropping_then_rising.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = recommend_temp_basal_dropping_then_rising.json; sourceTree = "<group>"; };
857+
C1E2774722433D7A00354103 /* MKRingProgressView.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MKRingProgressView.framework; path = Carthage/Build/iOS/MKRingProgressView.framework; sourceTree = "<group>"; };
858+
C1F8B1D122375E4200DD66CF /* BolusProgressTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BolusProgressTableViewCell.swift; sourceTree = "<group>"; };
859+
C1F8B1DB223862D500DD66CF /* BolusProgressTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BolusProgressTableViewCell.xib; sourceTree = "<group>"; };
854860
C1FB428B217806A300FAB378 /* StateColorPalette.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StateColorPalette.swift; sourceTree = "<group>"; };
855861
C1FB428E217921D600FAB378 /* PumpManagerUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PumpManagerUI.swift; sourceTree = "<group>"; };
856862
/* End PBXFileReference section */
@@ -867,6 +873,7 @@
867873
isa = PBXFrameworksBuildPhase;
868874
buildActionMask = 2147483647;
869875
files = (
876+
C1E2774822433D7A00354103 /* MKRingProgressView.framework in Frameworks */,
870877
892A5D5B222F0D7C008961AB /* LoopTestingKit.framework in Frameworks */,
871878
892A5D2A222EF60A008961AB /* MockKit.framework in Frameworks */,
872879
892A5D2C222EF60A008961AB /* MockKitUI.framework in Frameworks */,
@@ -1201,6 +1208,8 @@
12011208
4374B5F3209D89A900D17AA8 /* TextFieldTableViewCell.swift */,
12021209
43F64DD81D9C92C900D24DC6 /* TitleSubtitleTableViewCell.swift */,
12031210
4311FB9A1F37FE1B00D4C0A7 /* TitleSubtitleTextFieldTableViewCell.swift */,
1211+
C1F8B1D122375E4200DD66CF /* BolusProgressTableViewCell.swift */,
1212+
C1F8B1DB223862D500DD66CF /* BolusProgressTableViewCell.xib */,
12041213
);
12051214
path = Views;
12061215
sourceTree = "<group>";
@@ -1409,6 +1418,7 @@
14091418
968DCD53F724DE56FFE51920 /* Frameworks */ = {
14101419
isa = PBXGroup;
14111420
children = (
1421+
C1E2774722433D7A00354103 /* MKRingProgressView.framework */,
14121422
892A5D5A222F0D7C008961AB /* LoopTestingKit.framework */,
14131423
892A5D29222EF60A008961AB /* MockKit.framework */,
14141424
892A5D2B222EF60A008961AB /* MockKitUI.framework */,
@@ -1721,6 +1731,7 @@
17211731
isa = PBXResourcesBuildPhase;
17221732
buildActionMask = 2147483647;
17231733
files = (
1734+
C13255D6223E7BE2008AF50C /* BolusProgressTableViewCell.xib in Resources */,
17241735
43FCBBC21E51710B00343C1B /* LaunchScreen.storyboard in Resources */,
17251736
7D70764F1FE06EE1004AC8EA /* InfoPlist.strings in Resources */,
17261737
43776F991B8022E90074EA36 /* Assets.xcassets in Resources */,
@@ -1857,6 +1868,10 @@
18571868
"$(SRCROOT)/Carthage/Build/iOS/MinimedKitUI.framework",
18581869
"$(SRCROOT)/Carthage/Build/iOS/CGMBLEKitUI.framework",
18591870
"$(SRCROOT)/Carthage/Build/iOS/ShareClientUI.framework",
1871+
"$(SRCROOT)/Carthage/Build/iOS/MockKit.framework",
1872+
"$(SRCROOT)/Carthage/Build/iOS/MockKitUI.framework",
1873+
"$(SRCROOT)/Carthage/Build/iOS/LoopTestingKit.framework",
1874+
"$(SRCROOT)/Carthage/Build/iOS/MKRingProgressView.framework",
18601875
);
18611876
name = "Copy Frameworks with Carthage";
18621877
outputPaths = (
@@ -1910,6 +1925,7 @@
19101925
430B29932041F5B300BA9F93 /* UserDefaults+Loop.swift in Sources */,
19111926
4341F4EB1EDB92AC001C936B /* LogglyService.swift in Sources */,
19121927
43CE7CDE1CA8B63E003CC1B0 /* Data.swift in Sources */,
1928+
C1F8B243223E73FD00DD66CF /* BolusProgressTableViewCell.swift in Sources */,
19131929
439A7942211F631C0041B75F /* RootNavigationController.swift in Sources */,
19141930
4F11D3C020DCBEEC006E072C /* GlucoseBackfillRequestUserInfo.swift in Sources */,
19151931
43F5C2DB1B92A5E1003EB13D /* SettingsTableViewController.swift in Sources */,

Loop/Managers/DeviceDataManager.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,15 @@ final class DeviceDataManager {
168168
}
169169
}
170170

171-
171+
// MARK: - RemoteDataManagerDelegate
172172
extension DeviceDataManager: RemoteDataManagerDelegate {
173173
func remoteDataManagerDidUpdateServices(_ dataManager: RemoteDataManager) {
174174
loopManager.carbStore.syncDelegate = dataManager.nightscoutService.uploader
175175
}
176176
}
177177

178178

179+
// MARK: - CGMManagerDelegate
179180
extension DeviceDataManager: CGMManagerDelegate {
180181
func cgmManagerWantsDeletion(_ manager: CGMManager) {
181182
self.cgmManager = nil
@@ -223,6 +224,7 @@ extension DeviceDataManager: CGMManagerDelegate {
223224
}
224225

225226

227+
// MARK: - PumpManagerDelegate
226228
extension DeviceDataManager: PumpManagerDelegate {
227229

228230
func pumpManager(_ pumpManager: PumpManager, didAdjustPumpClockBy adjustment: TimeInterval) {
@@ -257,6 +259,7 @@ extension DeviceDataManager: PumpManagerDelegate {
257259
}
258260

259261
func pumpManager(_ pumpManager: PumpManager, didUpdate status: PumpManagerStatus) {
262+
log.default("PumpManager:\(type(of: pumpManager)) did update status: \(status)")
260263
self.pumpManagerStatus = status
261264
}
262265

@@ -344,7 +347,7 @@ extension DeviceDataManager: PumpManagerDelegate {
344347

345348
}
346349

347-
350+
// MARK: - DoseStoreDelegate
348351
extension DeviceDataManager: DoseStoreDelegate {
349352
func doseStore(_ doseStore: DoseStore,
350353
hasEventsNeedingUpload pumpEvents: [PersistedPumpEvent],
@@ -430,6 +433,7 @@ extension DeviceDataManager {
430433
}
431434
}
432435

436+
// MARK: - LoopDataManagerDelegate
433437
extension DeviceDataManager: LoopDataManagerDelegate {
434438
func loopDataManager(_ manager: LoopDataManager, roundBasalRate unitsPerHour: Double) -> Double {
435439
guard let pumpManager = pumpManager else {
@@ -477,6 +481,7 @@ extension DeviceDataManager: LoopDataManagerDelegate {
477481
}
478482

479483

484+
// MARK: - CustomDebugStringConvertible
480485
extension DeviceDataManager: CustomDebugStringConvertible {
481486
var debugDescription: String {
482487
return [

0 commit comments

Comments
 (0)