diff --git a/WatchApp Extension/Controllers/ChartHUDController.swift b/WatchApp Extension/Controllers/ChartHUDController.swift index 172aefc71b..3e828086d2 100644 --- a/WatchApp Extension/Controllers/ChartHUDController.swift +++ b/WatchApp Extension/Controllers/ChartHUDController.swift @@ -84,7 +84,7 @@ final class ChartHUDController: HUDInterfaceController, WKCrownDelegate { } if !hasInitialActivation && UserDefaults.standard.startOnChartPage { - log.default("Switching to startOnChartPage") + log.default("Switching to start on Chart page") becomeCurrentPage() } @@ -117,7 +117,6 @@ final class ChartHUDController: HUDInterfaceController, WKCrownDelegate { return numberFormatter }() - iobLabel.setHidden(true) if let activeInsulin = activeContext.iob, let valueStr = insulinFormatter.string(from: activeInsulin) { iobLabel.setText(String(format: NSLocalizedString( "IOB %1$@ U", @@ -125,10 +124,8 @@ final class ChartHUDController: HUDInterfaceController, WKCrownDelegate { ), valueStr )) - iobLabel.setHidden(false) } - cobLabel.setHidden(true) if let carbsOnBoard = activeContext.cob { let carbFormatter = NumberFormatter() carbFormatter.numberStyle = .decimal @@ -141,10 +138,8 @@ final class ChartHUDController: HUDInterfaceController, WKCrownDelegate { ), valueStr! )) - cobLabel.setHidden(false) } - basalLabel.setHidden(true) if let tempBasal = activeContext.lastNetTempBasalDose { let basalFormatter = NumberFormatter() basalFormatter.numberStyle = .decimal @@ -158,7 +153,6 @@ final class ChartHUDController: HUDInterfaceController, WKCrownDelegate { comment: "The subtitle format describing the current temp basal rate. (1: localized basal rate description)"), valueStr!) basalLabel.setText(basalLabelText) - basalLabel.setHidden(false) } if glucoseScene.isPaused { diff --git a/WatchApp Extension/Controllers/HUDInterfaceController.swift b/WatchApp Extension/Controllers/HUDInterfaceController.swift index efb35dc50c..ab1b62a381 100644 --- a/WatchApp Extension/Controllers/HUDInterfaceController.swift +++ b/WatchApp Extension/Controllers/HUDInterfaceController.swift @@ -12,7 +12,6 @@ class HUDInterfaceController: WKInterfaceController { private var activeContextObserver: NSObjectProtocol? @IBOutlet weak var loopHUDImage: WKInterfaceImage! - @IBOutlet weak var loopTimer: WKInterfaceTimer! @IBOutlet weak var glucoseLabel: WKInterfaceLabel! @IBOutlet weak var eventualGlucoseLabel: WKInterfaceLabel! @@ -46,14 +45,9 @@ class HUDInterfaceController: WKInterfaceController { let date = activeContext.loopLastRunDate else { loopHUDImage.setLoopImage(.unknown) - loopTimer.setHidden(true) return } - loopTimer.setDate(date) - loopTimer.setHidden(false) - loopTimer.start() - glucoseLabel.setHidden(true) eventualGlucoseLabel.setHidden(true) if let glucose = activeContext.glucose, let unit = activeContext.preferredGlucoseUnit { diff --git a/WatchApp Extension/Extensions/NSUserDefaults+WatchApp.swift b/WatchApp Extension/Extensions/NSUserDefaults+WatchApp.swift index 012d29b1f2..2b86ea6c6e 100644 --- a/WatchApp Extension/Extensions/NSUserDefaults+WatchApp.swift +++ b/WatchApp Extension/Extensions/NSUserDefaults+WatchApp.swift @@ -12,6 +12,7 @@ import Foundation extension UserDefaults { private enum Key: String { case StartOnChartPage = "com.loudnate.Naterade.StartOnChartPage" + case VisibleDuration = "com.loudnate.Naterade.VisibleDuration" } var startOnChartPage: Bool { @@ -22,4 +23,16 @@ extension UserDefaults { set(newValue, forKey: Key.StartOnChartPage.rawValue) } } + + var visibleDuration: TimeInterval { + get { + if let rawValue = object(forKey: Key.VisibleDuration.rawValue) as? TimeInterval, let visibleDuration = TimeInterval(rawValue: rawValue) { + return visibleDuration + } + return TimeInterval (hours: 6) + } + set { + set(newValue.rawValue, forKey: Key.VisibleDuration.rawValue) + } + } } diff --git a/WatchApp Extension/Scenes/GlucoseChartScene.swift b/WatchApp Extension/Scenes/GlucoseChartScene.swift index b5a11687ee..432e0b17fe 100644 --- a/WatchApp Extension/Scenes/GlucoseChartScene.swift +++ b/WatchApp Extension/Scenes/GlucoseChartScene.swift @@ -182,9 +182,10 @@ class GlucoseChartScene: SKScene { return lowerBound.. 180: // 44mm - height = 106 + switch screen.width { + case 136: // 38mm 136x170 px + height = 110 + case 162: // 40mm 162x197 px + height = 127 + case 156: // 42mm 156x195 px + height = 126 + case 184: // 44mm 184x224 px + height = 144 default: height = 86 } diff --git a/WatchApp/Base.lproj/Interface.storyboard b/WatchApp/Base.lproj/Interface.storyboard index 23d08d8cf7..b3d5d45057 100644 --- a/WatchApp/Base.lproj/Interface.storyboard +++ b/WatchApp/Base.lproj/Interface.storyboard @@ -1,6 +1,6 @@ - + @@ -137,10 +137,6 @@ - @@ -157,9 +153,6 @@ - @@ -263,7 +256,6 @@ - @@ -359,10 +351,6 @@ - @@ -379,9 +367,6 @@ - @@ -392,20 +377,62 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + - - - + + @@ -428,18 +455,17 @@ - - + + - + - - +