Skip to content

Commit 447cce7

Browse files
committed
Merge remote-tracking branch 'origin/dev' into ps2/CPA-89/reduce-healthkit-coupling
2 parents 7a47eba + 7f9abb8 commit 447cce7

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

Loop/Managers/DeviceDataManager.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ final class DeviceDataManager {
135135

136136
rawPumpManager = pumpManager?.rawValue
137137
UserDefaults.appGroup?.clearLegacyPumpManagerRawValue()
138-
139138
}
140139
}
141140

@@ -486,13 +485,20 @@ final class DeviceDataManager {
486485
}
487486

488487
let result = pumpManagerUIType.setupViewController(initialSettings: settings, bluetoothProvider: bluetoothProvider, colorPalette: .default, allowDebugFeatures: FeatureFlags.allowDebugFeatures, prefersToSkipUserInteraction: prefersToSkipUserInteraction, allowedInsulinTypes: allowedInsulinTypes)
488+
489489
if case .createdAndOnboarded(let pumpManagerUI) = result {
490490
pumpManagerOnboarding(didCreatePumpManager: pumpManagerUI)
491491
pumpManagerOnboarding(didOnboardPumpManager: pumpManagerUI)
492492
}
493493

494494
return .success(result)
495495
}
496+
497+
public func saveUpdatedBasalRateSchedule(_ basalRateSchedule: BasalRateSchedule) {
498+
var therapySettings = self.loopManager.therapySettings
499+
therapySettings.basalRateSchedule = basalRateSchedule
500+
self.saveCompletion(therapySettings: therapySettings)
501+
}
496502

497503
public func pumpManagerTypeByIdentifier(_ identifier: String) -> PumpManagerUI.Type? {
498504
return pluginManager.getPumpManagerTypeByIdentifier(identifier) ?? staticPumpManagersByIdentifier[identifier]
@@ -958,6 +964,11 @@ extension DeviceDataManager: PumpManagerDelegate {
958964

959965
rawPumpManager = pumpManager.rawValue
960966
}
967+
968+
func pumpManager(_ pumpManager: PumpManager, didRequestBasalRateScheduleChange basalRateSchedule: BasalRateSchedule, completion: @escaping (Error?) -> Void) {
969+
saveUpdatedBasalRateSchedule(basalRateSchedule)
970+
completion(nil)
971+
}
961972

962973
func pumpManagerBLEHeartbeatDidFire(_ pumpManager: PumpManager) {
963974
dispatchPrecondition(condition: .onQueue(queue))

Loop/Managers/LoopAppManager.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ class LoopAppManager: NSObject {
288288
statusTableViewController.deviceManager = deviceDataManager
289289
statusTableViewController.onboardingManager = onboardingManager
290290
statusTableViewController.supportManager = supportManager
291+
statusTableViewController.testingScenariosManager = testingScenariosManager
291292
bluetoothStateManager.addBluetoothObserver(statusTableViewController)
292293

293294
var rootNavigationController = rootViewController as? RootNavigationController

Loop/View Controllers/StatusTableViewController.swift

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -910,28 +910,36 @@ final class StatusTableViewController: LoopChartsTableViewController {
910910
private class MuteAlertsWarningCell: UITableViewCell {
911911
var formattedAlertMuteEndTime: String = NSLocalizedString("Unknown", comment: "label for when the alert mute end time is unknown")
912912

913+
fileprivate class GradientView: UIView {
914+
override static var layerClass: AnyClass { CAGradientLayer.self }
915+
}
916+
913917
override func updateConfiguration(using state: UICellConfigurationState) {
914918
super.updateConfiguration(using: state)
915919

916920
let adjustViewForNarrowDisplay = bounds.width < 350
917921

918922
var contentConfig = defaultContentConfiguration().updated(for: state)
919923
let title = NSMutableAttributedString(string: NSLocalizedString("All Alerts Muted", comment: "Warning text for when alerts are muted"))
920-
contentConfig.image = UIImage(systemName: "speaker.slash.fill")
924+
let image = UIImage(systemName: "speaker.slash.fill", withConfiguration: UIImage.SymbolConfiguration(pointSize: 25, weight: .thin, scale: .large))
925+
contentConfig.image = image
921926
contentConfig.imageProperties.tintColor = .white
922927
contentConfig.attributedText = title
923928
contentConfig.textProperties.color = .white
924-
contentConfig.textProperties.font = .systemFont(ofSize: adjustViewForNarrowDisplay ? 16 : 18, weight: .bold)
929+
contentConfig.textProperties.font = .systemFont(ofSize: adjustViewForNarrowDisplay ? 16 : 18, weight: .semibold)
925930
contentConfig.textProperties.adjustsFontSizeToFitWidth = true
926931
contentConfig.secondaryText = String(format: NSLocalizedString("Until %1$@", comment: "indication of when alerts will be unmuted (1: time when alerts unmute)"), formattedAlertMuteEndTime)
927932
contentConfig.secondaryTextProperties.color = .white
928933
contentConfig.secondaryTextProperties.font = .systemFont(ofSize: adjustViewForNarrowDisplay ? 13 : 15)
929934
contentConfiguration = contentConfig
930935

936+
let backgroundGradient = GradientView()
937+
(backgroundGradient.layer as? CAGradientLayer)?.colors = [UIColor.warning.cgColor, UIColor.warning.withAlphaComponent(0.9).cgColor]
938+
931939
var backgroundConfig = backgroundConfiguration?.updated(for: state)
932-
backgroundConfig?.backgroundColor = .warning.withAlphaComponent(0.8)
940+
backgroundConfig?.customView = backgroundGradient
933941
backgroundConfiguration = backgroundConfig
934-
backgroundConfiguration?.backgroundInsets = NSDirectionalEdgeInsets(top: 0, leading: 10, bottom: 5, trailing: 10)
942+
backgroundConfiguration?.backgroundInsets = NSDirectionalEdgeInsets(top: 0, leading: 5, bottom: 5, trailing: 5)
935943
backgroundConfiguration?.cornerRadius = 10
936944

937945
let unmuteIndicator = UIImage(systemName: "stop.circle")?.withTintColor(.white)
@@ -953,6 +961,7 @@ final class StatusTableViewController: LoopChartsTableViewController {
953961
} else {
954962
let cell = tableView.dequeueReusableCell(withIdentifier: MuteAlertsWarningCell.className, for: indexPath) as! MuteAlertsWarningCell
955963
cell.formattedAlertMuteEndTime = alertMuter.formattedEndTime
964+
cell.selectionStyle = .none
956965
return cell
957966
}
958967
case .hud:

0 commit comments

Comments
 (0)