From 58f52c79571468e049d9d6178affa4f5454c0254 Mon Sep 17 00:00:00 2001 From: Paul Plant Date: Sun, 31 Dec 2023 12:21:38 +0100 Subject: [PATCH] new attributes model --- xDripWidget/Constants/ConstantsWidget.swift | 13 ++ xDripWidget/Extensions/Double.swift | 140 ++++++++++++++++ .../Models/XDripWidgetAttributes.swift | 150 ++++++------------ .../Texts/{Common.swift => TextsWidget.swift} | 16 +- xDripWidget/Texts/ar.lproj/Common.strings | 7 - .../Texts/ar.lproj/TextsWidget.strings | 7 + xDripWidget/Texts/da.lproj/Common.strings | 7 - .../Texts/da.lproj/TextsWidget.strings | 7 + .../{Common.strings => TextsWidget.strings} | 12 +- xDripWidget/Texts/el.lproj/Common.strings | 7 - .../Texts/el.lproj/TextsWidget.strings | 7 + xDripWidget/Texts/en.lproj/Common.strings | 7 - .../Texts/en.lproj/TextsWidget.strings | 7 + xDripWidget/Texts/es.lproj/Common.strings | 7 - .../Texts/es.lproj/TextsWidget.strings | 7 + xDripWidget/Texts/fi.lproj/Common.strings | 7 - .../Texts/fi.lproj/TextsWidget.strings | 7 + xDripWidget/Texts/fr.lproj/Common.strings | 8 - .../Texts/fr.lproj/TextsWidget.strings | 8 + .../{Common.strings => TextsWidget.strings} | 12 +- xDripWidget/Texts/nl.lproj/Common.strings | 7 - .../Texts/nl.lproj/TextsWidget.strings | 7 + .../{Common.strings => TextsWidget.strings} | 12 +- xDripWidget/Texts/pt.lproj/Common.strings | 7 - .../Texts/pt.lproj/TextsWidget.strings | 7 + xDripWidget/Texts/ru.lproj/Common.strings | 7 - .../Texts/ru.lproj/TextsWidget.strings | 7 + .../{Common.strings => TextsWidget.strings} | 12 +- xDripWidget/Texts/sv.lproj/Common.strings | 7 - .../Texts/sv.lproj/TextsWidget.strings | 7 + xDripWidget/Texts/uk.lproj/Common.strings | 7 - .../Texts/uk.lproj/TextsWidget.strings | 7 + xDripWidget/Texts/zh.lproj/Common.strings | 7 - .../Texts/zh.lproj/TextsWidget.strings | 7 + xDripWidget/XDripWidgetLiveActivity.swift | 52 +++--- xdrip.xcodeproj/project.pbxproj | 68 +++++--- 36 files changed, 389 insertions(+), 282 deletions(-) create mode 100644 xDripWidget/Constants/ConstantsWidget.swift create mode 100644 xDripWidget/Extensions/Double.swift rename xDripWidget/Texts/{Common.swift => TextsWidget.swift} (67%) delete mode 100644 xDripWidget/Texts/ar.lproj/Common.strings create mode 100644 xDripWidget/Texts/ar.lproj/TextsWidget.strings delete mode 100644 xDripWidget/Texts/da.lproj/Common.strings create mode 100644 xDripWidget/Texts/da.lproj/TextsWidget.strings rename xDripWidget/Texts/de.lproj/{Common.strings => TextsWidget.strings} (61%) delete mode 100644 xDripWidget/Texts/el.lproj/Common.strings create mode 100644 xDripWidget/Texts/el.lproj/TextsWidget.strings delete mode 100644 xDripWidget/Texts/en.lproj/Common.strings create mode 100644 xDripWidget/Texts/en.lproj/TextsWidget.strings delete mode 100644 xDripWidget/Texts/es.lproj/Common.strings create mode 100644 xDripWidget/Texts/es.lproj/TextsWidget.strings delete mode 100644 xDripWidget/Texts/fi.lproj/Common.strings create mode 100644 xDripWidget/Texts/fi.lproj/TextsWidget.strings delete mode 100644 xDripWidget/Texts/fr.lproj/Common.strings create mode 100644 xDripWidget/Texts/fr.lproj/TextsWidget.strings rename xDripWidget/Texts/it.lproj/{Common.strings => TextsWidget.strings} (78%) delete mode 100644 xDripWidget/Texts/nl.lproj/Common.strings create mode 100644 xDripWidget/Texts/nl.lproj/TextsWidget.strings rename xDripWidget/Texts/pl-PL.lproj/{Common.strings => TextsWidget.strings} (78%) delete mode 100644 xDripWidget/Texts/pt.lproj/Common.strings create mode 100644 xDripWidget/Texts/pt.lproj/TextsWidget.strings delete mode 100644 xDripWidget/Texts/ru.lproj/Common.strings create mode 100644 xDripWidget/Texts/ru.lproj/TextsWidget.strings rename xDripWidget/Texts/sl.lproj/{Common.strings => TextsWidget.strings} (78%) delete mode 100644 xDripWidget/Texts/sv.lproj/Common.strings create mode 100644 xDripWidget/Texts/sv.lproj/TextsWidget.strings delete mode 100644 xDripWidget/Texts/uk.lproj/Common.strings create mode 100644 xDripWidget/Texts/uk.lproj/TextsWidget.strings delete mode 100644 xDripWidget/Texts/zh.lproj/Common.strings create mode 100644 xDripWidget/Texts/zh.lproj/TextsWidget.strings diff --git a/xDripWidget/Constants/ConstantsWidget.swift b/xDripWidget/Constants/ConstantsWidget.swift new file mode 100644 index 00000000..23a03143 --- /dev/null +++ b/xDripWidget/Constants/ConstantsWidget.swift @@ -0,0 +1,13 @@ +// +// ConstantsWidget.swift +// xDripWidgetExtension +// +// Created by Paul Plant on 31/12/23. +// Copyright © 2023 Johan Degraeve. All rights reserved. +// + +enum ConstantsWidget { + static let mmollToMgdl = 18.01801801801802 + static let mgDlToMmoll = 0.0555 + +} diff --git a/xDripWidget/Extensions/Double.swift b/xDripWidget/Extensions/Double.swift new file mode 100644 index 00000000..9b4767c4 --- /dev/null +++ b/xDripWidget/Extensions/Double.swift @@ -0,0 +1,140 @@ +// +// Double.swift +// xDripWidgetExtension +// +// Created by Paul Plant on 31/12/23. +// Copyright © 2023 Johan Degraeve. All rights reserved. +// + +import Foundation + +extension Double { + + // MARK: - copied to xDripWidgetExtension from main xDrip target + + /// Converts to a string and removes trailing .0 + public var stringWithoutTrailingZeroes: String { + var description = String(self.description) + // Checks if ends with .0 and removes if so + if description.suffix(2) == ".0" { + description = String(description.dropLast(2)) + } + return description + } + + /// converts mgdl to mmol + func mgdlToMmol() -> Double { + return self * ConstantsWidget.mgDlToMmoll + } + + /// converts mgdl to mmol if parameter mgdl = false. If mgdl = true then just returns self + func mgdlToMmol(mgdl:Bool) -> Double { + if mgdl { + return self + } else { + return self * ConstantsWidget.mgDlToMmoll + } + } + + /// converts mmol to mgdl if parameter mgdl = false. If mgdl = true then just returns self + func mmolToMgdl(mgdl:Bool) -> Double { + if mgdl { + return self + } else { + return self.mmolToMgdl() + } + } + + /// converts mmol to mgdl + func mmolToMgdl() -> Double { + return self * ConstantsWidget.mmollToMgdl + } + + /// returns the value rounded to fractionDigits + func round(toDecimalPlaces: Int) -> Double { + let multiplier = pow(10, Double(toDecimalPlaces)) + return Darwin.round(self * multiplier) / multiplier + } + + /// takes self as Double as bloodglucose value, converts value to string, round. Number of digits after decimal seperator depends on the unit. For mg/dl 0 digits after decimal seperator, for mmol, 1 digit after decimal seperator + func bgValuetoString(mgdl:Bool) -> String { + if mgdl { + return String(format:"%.0f", self) + } else { + return String(format:"%.1f", self) + } + } + + /// if mgdl, then returns self, unchanged. If not mgdl, return self rounded to 1 decimal place + func bgValueRounded(mgdl: Bool) -> Double { + + if mgdl { + + return self.round(toDecimalPlaces: 0) + + } else { + + return self.round(toDecimalPlaces: 1) + + } + + } + + /// converts mmol to mgdl if parametermgdl = false and, converts value to string, round. Number of digits after decimal seperator depends on the unit. For mg/dl 0 digits after decimal seperator, for mmol, 1 digit after decimal seperator + /// + /// this function is actually a combination of mmolToMgdl if mgdl = true and bgValuetoString + func mgdlToMmolAndToString(mgdl:Bool) -> String { + if mgdl { + return String(format:"%.0f", self) + } else { + return String(format:"%.1f", self.mgdlToMmol()) + } + } + + /// treats the double as timestamp in milliseconds, since 1970 and prints as date string + func asTimeStampInMilliSecondsToString() -> String { + let asDate = Date(timeIntervalSince1970: self/1000) + return asDate.description(with: .current) + } + + /// returns the Nightscout style string showing the days and hours for the number of minutes + /// Example: 9300.minutesToDaysAndHours() would return -> "6d11h" + /// Example: 78.minutesToDaysAndHours() would return -> "1h18m" + /// Example: 12.minutesToDaysAndHours() would return -> "12m" + func minutesToDaysAndHours() -> String { + + // set a default value assuming that we're unable to calculate the hours + days + var daysAndHoursString: String = "n/a" + + let days = floor(self / (24 * 60)) + let hoursInMinutes = self.truncatingRemainder(dividingBy: 24 * 60) + let hours = hoursInMinutes / 60 + let minutes = self.truncatingRemainder(dividingBy: 24 * 60 * 60) + + + if days == 0 && hours < 1 { + + // show just minutes for less than one hour + daysAndHoursString = abs(minutes).description + "m" + + } else if days == 0 && hours < 12 { + + // show just hours and minutes for less than twelve hours + daysAndHoursString = abs(hours).description + "h" + abs(minutes).description + "m" + + } else { + + // default show days and hours + daysAndHoursString = Int(days).description + "d" + Int(hours).description + "h" + + } + + + return daysAndHoursString + + } + +} + + + diff --git a/xDripWidget/Models/XDripWidgetAttributes.swift b/xDripWidget/Models/XDripWidgetAttributes.swift index 84b88393..3b5f4f29 100644 --- a/xDripWidget/Models/XDripWidgetAttributes.swift +++ b/xDripWidget/Models/XDripWidgetAttributes.swift @@ -11,124 +11,64 @@ import WidgetKit import SwiftUI struct XDripWidgetAttributes: ActivityAttributes { + public struct ContentState: Codable, Hashable { - enum EventType: Float, Codable, Hashable { - case urgentLowDropping - case urgentLow - case urgentLowRising - case lowDropping - case low - case lowRising - case inRangeDropping - case inRange - case inRangeRising - case highDropping - case high - case highRising - case urgentHighDropping - case urgentHigh - case urgentHighRising - - var title: String { - switch self { - case .high, .highDropping, .highRising: - return "HIGH" - case .inRange, .inRangeDropping, .inRangeRising: - return "IN RANGE" - case .low, .lowDropping, .lowRising: - return "LOW" - case .urgentHigh, .urgentHighDropping, .urgentHighRising: - return "VERY HIGH" - case .urgentLow, .urgentLowDropping, .urgentLowRising: - return "VERY LOW" - } - } - - var explanation: String { - switch self { - case .high: - return "You're not rising anymore" - case .highDropping: - return "You're starting to drop down to range" - case .highRising: - return "⚠️ You're still rising" - case .inRange: - return "Everything's looking good" - case .inRangeDropping: - return "All good, but dropping" - case .inRangeRising: - return "All good, but rising" - case .low: - return "You're not dropping anymore" - case .lowDropping: - return "⚠️ You're still dropping" - case .lowRising: - return "You're starting to rise back up" - case .urgentHigh: - return "You're not rising anymore but still very high" - case .urgentHighDropping: - return "You're starting to drop down to range" - case .urgentHighRising: - return "‼️ You're still rising" - case .urgentLow: - return "‼️ You are still too low" - case .urgentLowDropping: - return "‼️ You're low and still dropping" - case .urgentLowRising: - return "You're starting to come up to range" - } - } - - var bgColorInt: Int { - switch self { - case .inRange, .inRangeDropping, .inRangeRising: - return 1 - case .urgentHigh, .urgentHighDropping, .urgentHighRising, .urgentLow, .urgentLowDropping, .urgentLowRising: - return 2 - case .high, .highDropping, .highRising, .low, .lowDropping, .lowRising: - return 3 - } - } - } - - // Dynamic stateful properties about your activity go here! - var eventType: EventType + var bgValueInMgDl: Double + var isMgDl: Bool var trendArrow: String - var bgValueString: String - var bgValueColorInt: Int + var deltaChangeInMgDl: Double + var urgentLowLimitInMgDl: Double + var lowLimitInMgDl: Double + var highLimitInMgDl: Double + var urgentHighLimitInMgDl: Double - init(eventType: EventType , trendArrow: String, bgValueString: String, bgValueColorInt: Int) { - self.eventType = eventType + var bgValueStringInUserChosenUnit: String + var bgUnitString: String + + init(bgValueInMgDl: Double, isMgDl: Bool, trendArrow: String, deltaChangeInMgDl: Double, urgentLowLimitInMgDl: Double, lowLimitInMgDl: Double, highLimitInMgDl: Double, urgentHighLimitInMgDl: Double) { + + // these are the "passed in" stateful values used to initialize + self.bgValueInMgDl = bgValueInMgDl + self.isMgDl = isMgDl self.trendArrow = trendArrow - self.bgValueString = bgValueString - self.bgValueColorInt = bgValueColorInt + self.deltaChangeInMgDl = deltaChangeInMgDl + self.urgentLowLimitInMgDl = urgentLowLimitInMgDl + self.lowLimitInMgDl = lowLimitInMgDl + self.highLimitInMgDl = highLimitInMgDl + self.urgentHighLimitInMgDl = urgentHighLimitInMgDl + + // these are dynamically initialized based on the above + //self.bgValueInUserChosenUnit = bgValueInMgDl.mgdlToMmol(mgdl: isMgDl) + self.bgUnitString = isMgDl ? Texts_Widget.mgdl : Texts_Widget.mmol + self.bgValueStringInUserChosenUnit = bgValueInMgDl.mgdlToMmolAndToString(mgdl: isMgDl) - self.bgValueColorInt = getBgValueColor(bgValueString: bgValueString) } - func getBgValueColor(bgValueString: String) -> Int { - - let bgValue: Float = Float(bgValueString) ?? 1 - - switch bgValue { - case 0..<70: - return 1 - case 71..<80: - return 3 - case 81..<140: - return 2 - case 141...: - return 3 - default: - return 2 + func getBgColor() -> Color { + if bgValueInMgDl >= urgentHighLimitInMgDl || bgValueInMgDl <= urgentLowLimitInMgDl { + return .red + } else if bgValueInMgDl >= highLimitInMgDl || bgValueInMgDl <= lowLimitInMgDl { + return .yellow + } else { + return .green } - } + + func getBgTitle() -> String { + + if bgValueInMgDl >= highLimitInMgDl { + return Texts_Widget.HIGH + } else if bgValueInMgDl <= lowLimitInMgDl { + return Texts_Widget.LOW + } else { + return "" + } + } + } // Fixed non-changing properties about your activity go here! - var bgValueUnitString: String var eventStartDate: Date } diff --git a/xDripWidget/Texts/Common.swift b/xDripWidget/Texts/TextsWidget.swift similarity index 67% rename from xDripWidget/Texts/Common.swift rename to xDripWidget/Texts/TextsWidget.swift index 7f82c6da..1f0bf1f1 100644 --- a/xDripWidget/Texts/Common.swift +++ b/xDripWidget/Texts/TextsWidget.swift @@ -1,31 +1,31 @@ import Foundation // all common texts -class Texts { - static private let filename = "Common" +class Texts_Widget { + static private let filename = "TextsWidget" static let minutes = { - return NSLocalizedString("common_minutes", tableName: filename, bundle: Bundle.main, value: "mins", comment: "literal translation needed") + return NSLocalizedString("widget_minutes", tableName: filename, bundle: Bundle.main, value: "mins", comment: "literal translation needed") }() static let minute = { - return NSLocalizedString("common_minute", tableName: filename, bundle: Bundle.main, value: "min", comment: "literal translation needed") + return NSLocalizedString("widget_minute", tableName: filename, bundle: Bundle.main, value: "min", comment: "literal translation needed") }() static let HIGH = { - return NSLocalizedString("common_high", tableName: filename, bundle: Bundle.main, value: "HIGH", comment: "the word HIGH, in capitals") + return NSLocalizedString("widget_high", tableName: filename, bundle: Bundle.main, value: "HIGH", comment: "the word HIGH, in capitals") }() static let LOW = { - return NSLocalizedString("common_low", tableName: filename, bundle: Bundle.main, value: "LOW", comment: "the word LOW, in capitals") + return NSLocalizedString("widget_low", tableName: filename, bundle: Bundle.main, value: "LOW", comment: "the word LOW, in capitals") }() static let mgdl: String = { - return NSLocalizedString("common_mgdl", tableName: filename, bundle: Bundle.main, value: "mg/dL", comment: "mg/dL") + return NSLocalizedString("widget_mgdl", tableName: filename, bundle: Bundle.main, value: "mg/dL", comment: "mg/dL") }() static let mmol: String = { - return NSLocalizedString("common_mmol", tableName: filename, bundle: Bundle.main, value: "mmol/L", comment: "mmol/L") + return NSLocalizedString("widget_mmol", tableName: filename, bundle: Bundle.main, value: "mmol/L", comment: "mmol/L") }() static let ago:String = { diff --git a/xDripWidget/Texts/ar.lproj/Common.strings b/xDripWidget/Texts/ar.lproj/Common.strings deleted file mode 100644 index 20787281..00000000 --- a/xDripWidget/Texts/ar.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "مرتفع"; -"common_low" = "منخفض"; -"common_minutes" = "دقائق"; -"common_minute" = "دقيقة"; -"ago" = "مضت"; diff --git a/xDripWidget/Texts/ar.lproj/TextsWidget.strings b/xDripWidget/Texts/ar.lproj/TextsWidget.strings new file mode 100644 index 00000000..e54e50f9 --- /dev/null +++ b/xDripWidget/Texts/ar.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "مرتفع"; +"widget_low" = "منخفض"; +"widget_minutes" = "دقائق"; +"widget_minute" = "دقيقة"; +"ago" = "مضت"; diff --git a/xDripWidget/Texts/da.lproj/Common.strings b/xDripWidget/Texts/da.lproj/Common.strings deleted file mode 100644 index 6dc05e6b..00000000 --- a/xDripWidget/Texts/da.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "HIGH"; -"common_low" = "LOW"; -"common_minutes" = "mins"; -"common_minute" = "min"; -"ago" = "ago"; diff --git a/xDripWidget/Texts/da.lproj/TextsWidget.strings b/xDripWidget/Texts/da.lproj/TextsWidget.strings new file mode 100644 index 00000000..75d81de5 --- /dev/null +++ b/xDripWidget/Texts/da.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "HIGH"; +"widget_low" = "LOW"; +"widget_minutes" = "mins"; +"widget_minute" = "min"; +"ago" = "ago"; diff --git a/xDripWidget/Texts/de.lproj/Common.strings b/xDripWidget/Texts/de.lproj/TextsWidget.strings similarity index 61% rename from xDripWidget/Texts/de.lproj/Common.strings rename to xDripWidget/Texts/de.lproj/TextsWidget.strings index bbe1485f..9519b7c9 100644 --- a/xDripWidget/Texts/de.lproj/Common.strings +++ b/xDripWidget/Texts/de.lproj/TextsWidget.strings @@ -1,20 +1,20 @@ /// literal translation needed -"common_minute" = "min"; +"widget_minute" = "min"; /// the word HIGH, in capitals -"common_high" = "HOCH"; +"widget_high" = "HOCH"; /// the word LOW, in capitals -"common_low" = "NIEDRIG"; +"widget_low" = "NIEDRIG"; /// literal translation needed -"common_minutes" = "Minuten"; +"widget_minutes" = "Minuten"; /// mmol/l -"common_mmol" = "mmol/L"; +"widget_mmol" = "mmol/L"; /// mg/dl -"common_mgdl" = "mg/dL"; +"widget_mgdl" = "mg/dL"; /// where it say how old the reading is, 'x minutes ago', literaly translation of 'ago' "ago" = "her"; diff --git a/xDripWidget/Texts/el.lproj/Common.strings b/xDripWidget/Texts/el.lproj/Common.strings deleted file mode 100644 index 15c1242b..00000000 --- a/xDripWidget/Texts/el.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "ΥΨΗΛΗ"; -"common_low" = "ΧΑΜΗΛΗ"; -"common_minutes" = "mins"; -"common_minute" = "min"; -"ago" = "πριν"; diff --git a/xDripWidget/Texts/el.lproj/TextsWidget.strings b/xDripWidget/Texts/el.lproj/TextsWidget.strings new file mode 100644 index 00000000..67a91580 --- /dev/null +++ b/xDripWidget/Texts/el.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "ΥΨΗΛΗ"; +"widget_low" = "ΧΑΜΗΛΗ"; +"widget_minutes" = "mins"; +"widget_minute" = "min"; +"ago" = "πριν"; diff --git a/xDripWidget/Texts/en.lproj/Common.strings b/xDripWidget/Texts/en.lproj/Common.strings deleted file mode 100644 index 6dc05e6b..00000000 --- a/xDripWidget/Texts/en.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "HIGH"; -"common_low" = "LOW"; -"common_minutes" = "mins"; -"common_minute" = "min"; -"ago" = "ago"; diff --git a/xDripWidget/Texts/en.lproj/TextsWidget.strings b/xDripWidget/Texts/en.lproj/TextsWidget.strings new file mode 100644 index 00000000..75d81de5 --- /dev/null +++ b/xDripWidget/Texts/en.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "HIGH"; +"widget_low" = "LOW"; +"widget_minutes" = "mins"; +"widget_minute" = "min"; +"ago" = "ago"; diff --git a/xDripWidget/Texts/es.lproj/Common.strings b/xDripWidget/Texts/es.lproj/Common.strings deleted file mode 100644 index 6dc05e6b..00000000 --- a/xDripWidget/Texts/es.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "HIGH"; -"common_low" = "LOW"; -"common_minutes" = "mins"; -"common_minute" = "min"; -"ago" = "ago"; diff --git a/xDripWidget/Texts/es.lproj/TextsWidget.strings b/xDripWidget/Texts/es.lproj/TextsWidget.strings new file mode 100644 index 00000000..75d81de5 --- /dev/null +++ b/xDripWidget/Texts/es.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "HIGH"; +"widget_low" = "LOW"; +"widget_minutes" = "mins"; +"widget_minute" = "min"; +"ago" = "ago"; diff --git a/xDripWidget/Texts/fi.lproj/Common.strings b/xDripWidget/Texts/fi.lproj/Common.strings deleted file mode 100644 index 23243221..00000000 --- a/xDripWidget/Texts/fi.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "KORKEA"; -"common_low" = "MATALA"; -"common_minutes" = "minuuttia"; -"common_minute" = "min"; -"ago" = "sitten"; diff --git a/xDripWidget/Texts/fi.lproj/TextsWidget.strings b/xDripWidget/Texts/fi.lproj/TextsWidget.strings new file mode 100644 index 00000000..ead5cdaa --- /dev/null +++ b/xDripWidget/Texts/fi.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "KORKEA"; +"widget_low" = "MATALA"; +"widget_minutes" = "minuuttia"; +"widget_minute" = "min"; +"ago" = "sitten"; diff --git a/xDripWidget/Texts/fr.lproj/Common.strings b/xDripWidget/Texts/fr.lproj/Common.strings deleted file mode 100644 index d174c0a0..00000000 --- a/xDripWidget/Texts/fr.lproj/Common.strings +++ /dev/null @@ -1,8 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "HAUT"; -"common_low" = "BAS"; -"common_minutes" = "mins"; -"common_minute" = "min"; -"ago" = "depuis"; - diff --git a/xDripWidget/Texts/fr.lproj/TextsWidget.strings b/xDripWidget/Texts/fr.lproj/TextsWidget.strings new file mode 100644 index 00000000..59f34fd5 --- /dev/null +++ b/xDripWidget/Texts/fr.lproj/TextsWidget.strings @@ -0,0 +1,8 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "HAUT"; +"widget_low" = "BAS"; +"widget_minutes" = "mins"; +"widget_minute" = "min"; +"ago" = "depuis"; + diff --git a/xDripWidget/Texts/it.lproj/Common.strings b/xDripWidget/Texts/it.lproj/TextsWidget.strings similarity index 78% rename from xDripWidget/Texts/it.lproj/Common.strings rename to xDripWidget/Texts/it.lproj/TextsWidget.strings index 7d04c8ec..c84f2abb 100644 --- a/xDripWidget/Texts/it.lproj/Common.strings +++ b/xDripWidget/Texts/it.lproj/TextsWidget.strings @@ -4,22 +4,22 @@ ///////////////////////////////////////////////////////////////////////////////////////////// /// literal translation needed -"common_minute" = "min"; +"widget_minute" = "min"; /// the word HIGH, in capitals -"common_high" = "HIGH"; +"widget_high" = "HIGH"; /// the word LOW, in capitals -"common_low" = "LOW"; +"widget_low" = "LOW"; /// literal translation needed -"common_minutes" = "mins"; +"widget_minutes" = "mins"; /// mmol/l -"common_mmol" = "mmol/L"; +"widget_mmol" = "mmol/L"; /// mg/dl -"common_mgdl" = "mg/dL"; +"widget_mgdl" = "mg/dL"; /// where it say how old the reading is, 'x minutes ago', literaly translation of 'ago' "ago" = "ago"; diff --git a/xDripWidget/Texts/nl.lproj/Common.strings b/xDripWidget/Texts/nl.lproj/Common.strings deleted file mode 100644 index 239bff2f..00000000 --- a/xDripWidget/Texts/nl.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_high" = "HOOG"; -"common_low" = "LAAG"; -"common_minute" = "min"; -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_minutes" = "min"; -"ago" = "geleden"; diff --git a/xDripWidget/Texts/nl.lproj/TextsWidget.strings b/xDripWidget/Texts/nl.lproj/TextsWidget.strings new file mode 100644 index 00000000..27b1027f --- /dev/null +++ b/xDripWidget/Texts/nl.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_high" = "HOOG"; +"widget_low" = "LAAG"; +"widget_minute" = "min"; +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_minutes" = "min"; +"ago" = "geleden"; diff --git a/xDripWidget/Texts/pl-PL.lproj/Common.strings b/xDripWidget/Texts/pl-PL.lproj/TextsWidget.strings similarity index 78% rename from xDripWidget/Texts/pl-PL.lproj/Common.strings rename to xDripWidget/Texts/pl-PL.lproj/TextsWidget.strings index 7d04c8ec..c84f2abb 100644 --- a/xDripWidget/Texts/pl-PL.lproj/Common.strings +++ b/xDripWidget/Texts/pl-PL.lproj/TextsWidget.strings @@ -4,22 +4,22 @@ ///////////////////////////////////////////////////////////////////////////////////////////// /// literal translation needed -"common_minute" = "min"; +"widget_minute" = "min"; /// the word HIGH, in capitals -"common_high" = "HIGH"; +"widget_high" = "HIGH"; /// the word LOW, in capitals -"common_low" = "LOW"; +"widget_low" = "LOW"; /// literal translation needed -"common_minutes" = "mins"; +"widget_minutes" = "mins"; /// mmol/l -"common_mmol" = "mmol/L"; +"widget_mmol" = "mmol/L"; /// mg/dl -"common_mgdl" = "mg/dL"; +"widget_mgdl" = "mg/dL"; /// where it say how old the reading is, 'x minutes ago', literaly translation of 'ago' "ago" = "ago"; diff --git a/xDripWidget/Texts/pt.lproj/Common.strings b/xDripWidget/Texts/pt.lproj/Common.strings deleted file mode 100644 index 84c386d4..00000000 --- a/xDripWidget/Texts/pt.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "ALTA"; -"common_low" = "BAIXA"; -"common_minutes" = "mins"; -"common_minute" = "min"; -"ago" = "ago"; diff --git a/xDripWidget/Texts/pt.lproj/TextsWidget.strings b/xDripWidget/Texts/pt.lproj/TextsWidget.strings new file mode 100644 index 00000000..25ba7d18 --- /dev/null +++ b/xDripWidget/Texts/pt.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "ALTA"; +"widget_low" = "BAIXA"; +"widget_minutes" = "mins"; +"widget_minute" = "min"; +"ago" = "ago"; diff --git a/xDripWidget/Texts/ru.lproj/Common.strings b/xDripWidget/Texts/ru.lproj/Common.strings deleted file mode 100644 index d53ec235..00000000 --- a/xDripWidget/Texts/ru.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "ВЫСОКИЙ"; -"common_low" = "НИЗКИЙ"; -"common_minutes" = "мин"; -"common_minute" = "мин"; -"ago" = "назад"; diff --git a/xDripWidget/Texts/ru.lproj/TextsWidget.strings b/xDripWidget/Texts/ru.lproj/TextsWidget.strings new file mode 100644 index 00000000..0c61edcd --- /dev/null +++ b/xDripWidget/Texts/ru.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "ВЫСОКИЙ"; +"widget_low" = "НИЗКИЙ"; +"widget_minutes" = "мин"; +"widget_minute" = "мин"; +"ago" = "назад"; diff --git a/xDripWidget/Texts/sl.lproj/Common.strings b/xDripWidget/Texts/sl.lproj/TextsWidget.strings similarity index 78% rename from xDripWidget/Texts/sl.lproj/Common.strings rename to xDripWidget/Texts/sl.lproj/TextsWidget.strings index 7d04c8ec..c84f2abb 100644 --- a/xDripWidget/Texts/sl.lproj/Common.strings +++ b/xDripWidget/Texts/sl.lproj/TextsWidget.strings @@ -4,22 +4,22 @@ ///////////////////////////////////////////////////////////////////////////////////////////// /// literal translation needed -"common_minute" = "min"; +"widget_minute" = "min"; /// the word HIGH, in capitals -"common_high" = "HIGH"; +"widget_high" = "HIGH"; /// the word LOW, in capitals -"common_low" = "LOW"; +"widget_low" = "LOW"; /// literal translation needed -"common_minutes" = "mins"; +"widget_minutes" = "mins"; /// mmol/l -"common_mmol" = "mmol/L"; +"widget_mmol" = "mmol/L"; /// mg/dl -"common_mgdl" = "mg/dL"; +"widget_mgdl" = "mg/dL"; /// where it say how old the reading is, 'x minutes ago', literaly translation of 'ago' "ago" = "ago"; diff --git a/xDripWidget/Texts/sv.lproj/Common.strings b/xDripWidget/Texts/sv.lproj/Common.strings deleted file mode 100644 index 54ca6e4a..00000000 --- a/xDripWidget/Texts/sv.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "HÖGT"; -"common_low" = "LÅGT"; -"common_minutes" = "min"; -"common_minute" = "min"; -"ago" = "sedan"; diff --git a/xDripWidget/Texts/sv.lproj/TextsWidget.strings b/xDripWidget/Texts/sv.lproj/TextsWidget.strings new file mode 100644 index 00000000..167621f9 --- /dev/null +++ b/xDripWidget/Texts/sv.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "HÖGT"; +"widget_low" = "LÅGT"; +"widget_minutes" = "min"; +"widget_minute" = "min"; +"ago" = "sedan"; diff --git a/xDripWidget/Texts/uk.lproj/Common.strings b/xDripWidget/Texts/uk.lproj/Common.strings deleted file mode 100644 index 6dc05e6b..00000000 --- a/xDripWidget/Texts/uk.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "HIGH"; -"common_low" = "LOW"; -"common_minutes" = "mins"; -"common_minute" = "min"; -"ago" = "ago"; diff --git a/xDripWidget/Texts/uk.lproj/TextsWidget.strings b/xDripWidget/Texts/uk.lproj/TextsWidget.strings new file mode 100644 index 00000000..75d81de5 --- /dev/null +++ b/xDripWidget/Texts/uk.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "HIGH"; +"widget_low" = "LOW"; +"widget_minutes" = "mins"; +"widget_minute" = "min"; +"ago" = "ago"; diff --git a/xDripWidget/Texts/zh.lproj/Common.strings b/xDripWidget/Texts/zh.lproj/Common.strings deleted file mode 100644 index d8de330e..00000000 --- a/xDripWidget/Texts/zh.lproj/Common.strings +++ /dev/null @@ -1,7 +0,0 @@ -"common_mgdl" = "mg/dL"; -"common_mmol" = "mmol/L"; -"common_high" = "高"; -"common_low" = "低"; -"common_minutes" = "分钟"; -"common_minute" = "分钟"; -"ago" = "之前"; diff --git a/xDripWidget/Texts/zh.lproj/TextsWidget.strings b/xDripWidget/Texts/zh.lproj/TextsWidget.strings new file mode 100644 index 00000000..225a524a --- /dev/null +++ b/xDripWidget/Texts/zh.lproj/TextsWidget.strings @@ -0,0 +1,7 @@ +"widget_mgdl" = "mg/dL"; +"widget_mmol" = "mmol/L"; +"widget_high" = "高"; +"widget_low" = "低"; +"widget_minutes" = "分钟"; +"widget_minute" = "分钟"; +"ago" = "之前"; diff --git a/xDripWidget/XDripWidgetLiveActivity.swift b/xDripWidget/XDripWidgetLiveActivity.swift index 075659d6..4588b0fc 100644 --- a/xDripWidget/XDripWidgetLiveActivity.swift +++ b/xDripWidget/XDripWidgetLiveActivity.swift @@ -16,21 +16,21 @@ struct XDripWidgetLiveActivity: Widget { // Lock screen/banner UI goes here VStack { HStack { - Text(context.state.eventType.title).foregroundStyle(getBgColor(bgColorInt: context.state.bgValueColorInt, isTitle: true)) + Text(context.state.getBgTitle()).foregroundStyle(context.state.getBgColor()) Spacer() - Text("\(context.state.bgValueString) \(context.state.trendArrow)").foregroundStyle(getBgColor(bgColorInt: context.state.bgValueColorInt, isTitle: false)) - }.font(.largeTitle).bold().foregroundStyle(getBgColor(bgColorInt: context.state.bgValueColorInt, isTitle: false)) + Text("\(context.state.bgValueStringInUserChosenUnit) \(context.state.trendArrow)").foregroundStyle(context.state.getBgColor()) + }.font(.largeTitle).bold().foregroundStyle(context.state.getBgColor()) HStack { Text("Started \(context.attributes.eventStartDate.formatted(date: .omitted, time: .shortened))") Spacer() - Text(context.attributes.bgValueUnitString) + Text(context.state.bgUnitString) .foregroundStyle(.gray) } .font(.headline) Spacer() HStack { - Text(context.state.eventType.explanation) + Text("Message") } .font(.body) Spacer() @@ -41,18 +41,20 @@ struct XDripWidgetLiveActivity: Widget { //.background(.ultraThinMaterial) //.activityBackgroundTint(Color.red) //.activitySystemActionForegroundColor(Color.black) - + + + } dynamicIsland: { context in DynamicIsland { // Expanded UI goes here. Compose the expanded UI through // various regions, like leading/trailing/center/bottom DynamicIslandExpandedRegion(.leading) { - Text(context.state.eventType.title) - .font(.largeTitle).bold().foregroundStyle(getBgColor(bgColorInt: context.state.eventType.bgColorInt, isTitle: true)) + Text(context.state.getBgTitle()) + .font(.largeTitle).bold().foregroundStyle(context.state.getBgColor()) } DynamicIslandExpandedRegion(.trailing) { - Text("\(context.state.bgValueString) \(context.state.trendArrow) ") - .font(.largeTitle).bold().foregroundStyle(getBgColor(bgColorInt: context.state.eventType.bgColorInt, isTitle: false)) + Text("\(context.state.bgValueStringInUserChosenUnit) \(context.state.trendArrow)") + .font(.largeTitle).bold().foregroundStyle(context.state.getBgColor()) } DynamicIslandExpandedRegion(.center) { EmptyView() @@ -62,49 +64,37 @@ struct XDripWidgetLiveActivity: Widget { HStack { Text("Started \(context.attributes.eventStartDate.formatted(date: .omitted, time: .shortened))") Spacer() - Text(context.attributes.bgValueUnitString) + Text(context.state.bgUnitString) .foregroundStyle(.gray) } .font(.headline) Spacer() HStack { - Text(context.state.eventType.explanation) + Text("Message") } .font(.body) Spacer() } } } compactLeading: { - Text(context.state.eventType.title) + Text(context.state.getBgTitle()).foregroundStyle(context.state.getBgColor()) } compactTrailing: { - Text("\(context.state.bgValueString) \(context.state.trendArrow)") + Text("\(context.state.bgValueStringInUserChosenUnit) \(context.state.trendArrow)").foregroundStyle(context.state.getBgColor()) } minimal: { - Text(context.state.bgValueString) - .foregroundStyle(getBgColor(bgColorInt: context.state.eventType.bgColorInt, isTitle: false)) + Text("\(context.state.bgValueStringInUserChosenUnit)") + .foregroundStyle(context.state.getBgColor()) } .widgetURL(URL(string: "xdripswift")) } + } - - func getBgColor(bgColorInt: Int, isTitle: Bool) -> Color { - switch bgColorInt { - case 1: - return .red - case 2: - return isTitle ? .primary : .green - case 3: - return .yellow - default: - return .green - } - } } @available(iOS 16.2, *) struct XDripWidgetLiveActivity_Previews: PreviewProvider { - static let attributes = XDripWidgetAttributes(bgValueUnitString: "mg/dL", eventStartDate: Date().addingTimeInterval(-1000)) - static let contentState = XDripWidgetAttributes.ContentState(eventType: .inRangeDropping, trendArrow: "↘", bgValueString: "134") + static let attributes = XDripWidgetAttributes(eventStartDate: Date().addingTimeInterval(-1000)) + static let contentState = XDripWidgetAttributes.ContentState(bgValueInMgDl: 75, isMgDl: true, trendArrow: "↘", deltaChangeInMgDl: -2, urgentLowLimitInMgDl: 70, lowLimitInMgDl: 80, highLimitInMgDl: 140, urgentHighLimitInMgDl: 180) static var previews: some View { attributes diff --git a/xdrip.xcodeproj/project.pbxproj b/xdrip.xcodeproj/project.pbxproj index fb6c1011..84fcc08f 100644 --- a/xdrip.xcodeproj/project.pbxproj +++ b/xdrip.xcodeproj/project.pbxproj @@ -29,6 +29,12 @@ 4716A4FE2B406C3F00419052 /* xDripWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 4716A4ED2B406C3D00419052 /* xDripWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 4716A5052B40709E00419052 /* XDripWidgetAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4716A5042B40709E00419052 /* XDripWidgetAttributes.swift */; }; 4716A5072B4082ED00419052 /* XDripWidgetAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4716A5042B40709E00419052 /* XDripWidgetAttributes.swift */; }; + 4716A50A2B416E6500419052 /* Double.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4716A5092B416E6500419052 /* Double.swift */; }; + 4716A50D2B416EE100419052 /* ConstantsWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4716A50C2B416EE100419052 /* ConstantsWidget.swift */; }; + 4716A50E2B41707D00419052 /* TextsWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E53FE8251F7B8800052CE5 /* TextsWidget.swift */; }; + 4716A50F2B41708000419052 /* TextsWidget.strings in Resources */ = {isa = PBXBuildFile; fileRef = F8E53FD0251D35FB00052CE5 /* TextsWidget.strings */; }; + 4716A5102B41823600419052 /* TextsWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E53FE8251F7B8800052CE5 /* TextsWidget.swift */; }; + 4716A5112B41823A00419052 /* TextsWidget.strings in Resources */ = {isa = PBXBuildFile; fileRef = F8E53FD0251D35FB00052CE5 /* TextsWidget.strings */; }; 47228B152996BDD2008725DB /* BgReadingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47228B142996BDD2008725DB /* BgReadingsView.swift */; }; 4733B93E2AD17C99001D609D /* FollowerBgReading.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4733B93D2AD17C99001D609D /* FollowerBgReading.swift */; }; 4733B9402AD17D15001D609D /* FollowerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4733B93F2AD17D15001D609D /* FollowerDelegate.swift */; }; @@ -618,7 +624,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 198D44C3260A3A3300A2B4A2 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Common.strings; sourceTree = ""; }; + 198D44C3260A3A3300A2B4A2 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/TextsWidget.strings; sourceTree = ""; }; 198D44C4260A3A3300A2B4A2 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Alerts.strings; sourceTree = ""; }; 198D44C5260A3A3300A2B4A2 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/AlertTypesSettingsView.strings; sourceTree = ""; }; 198D44C6260A3A3300A2B4A2 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/BluetoothPeripheralsView.strings; sourceTree = ""; }; @@ -642,7 +648,7 @@ 198D44E7260A822000A2B4A2 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Main.strings; sourceTree = ""; }; 2867F5C825BC209400AA1E98 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/LaunchScreen.strings; sourceTree = ""; }; 2867F5C925BC209500AA1E98 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Main.strings; sourceTree = ""; }; - 2867F5CA25BC209500AA1E98 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Common.strings; sourceTree = ""; }; + 2867F5CA25BC209500AA1E98 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/TextsWidget.strings; sourceTree = ""; }; 2867F5CB25BC209500AA1E98 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Alerts.strings; sourceTree = ""; }; 2867F5CC25BC209500AA1E98 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/AlertTypesSettingsView.strings; sourceTree = ""; }; 2867F5CD25BC209500AA1E98 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/BluetoothPeripheralsView.strings; sourceTree = ""; }; @@ -663,7 +669,7 @@ 4166BFB628C3501400199980 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Interface.strings; sourceTree = ""; }; 4166BFB728C3501500199980 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/LaunchScreen.strings; sourceTree = ""; }; 4166BFB828C3501500199980 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Main.strings; sourceTree = ""; }; - 4166BFB928C3501500199980 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Common.strings; sourceTree = ""; }; + 4166BFB928C3501500199980 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/TextsWidget.strings; sourceTree = ""; }; 4166BFBA28C3501500199980 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Treatments.strings; sourceTree = ""; }; 4166BFBB28C3501500199980 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Alerts.strings; sourceTree = ""; }; 4166BFBC28C3501500199980 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/AlertTypesSettingsView.strings; sourceTree = ""; }; @@ -706,6 +712,8 @@ 4716A4F92B406C3F00419052 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 4716A4FB2B406C3F00419052 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 4716A5042B40709E00419052 /* XDripWidgetAttributes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XDripWidgetAttributes.swift; sourceTree = ""; }; + 4716A5092B416E6500419052 /* Double.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Double.swift; sourceTree = ""; }; + 4716A50C2B416EE100419052 /* ConstantsWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConstantsWidget.swift; sourceTree = ""; }; 47228B142996BDD2008725DB /* BgReadingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BgReadingsView.swift; sourceTree = ""; }; 4733B93D2AD17C99001D609D /* FollowerBgReading.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FollowerBgReading.swift; sourceTree = ""; }; 4733B93F2AD17D15001D609D /* FollowerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FollowerDelegate.swift; sourceTree = ""; }; @@ -776,7 +784,7 @@ CE1B2FDD25D0264B00F642F5 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/M5StackView.strings; sourceTree = ""; }; CE1B2FDE25D0264B00F642F5 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Snooze.strings; sourceTree = ""; }; CE1B2FDF25D0264B00F642F5 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/BluetoothPeripheralView.strings; sourceTree = ""; }; - CE1B2FE425D026B400F642F5 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Common.strings; sourceTree = ""; }; + CE1B2FE425D026B400F642F5 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/TextsWidget.strings; sourceTree = ""; }; D400F8022778BD8000B57648 /* TextsTreatmentsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextsTreatmentsView.swift; sourceTree = ""; }; D4028CBF2774A50600341476 /* TreatmentsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreatmentsViewController.swift; sourceTree = ""; }; D40C3DA3277542C400111B73 /* TreatmentEntry+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TreatmentEntry+CoreDataClass.swift"; sourceTree = ""; }; @@ -924,7 +932,7 @@ F81F39EB25C616C900520946 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/LibreNFC.strings; sourceTree = ""; }; F81F3A6025C9E5A800520946 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/LaunchScreen.strings; sourceTree = ""; }; F81F3A6125C9E5A800520946 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Main.strings; sourceTree = ""; }; - F81F3A6225C9E5A800520946 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Common.strings; sourceTree = ""; }; + F81F3A6225C9E5A800520946 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/TextsWidget.strings; sourceTree = ""; }; F81F3A6325C9E5A800520946 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Alerts.strings; sourceTree = ""; }; F81F3A6425C9E5A800520946 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/AlertTypesSettingsView.strings; sourceTree = ""; }; F81F3A6525C9E5A800520946 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/BluetoothPeripheralsView.strings; sourceTree = ""; }; @@ -1222,11 +1230,11 @@ F88EC12325F6CFB200DF0EAF /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/SettingsViews.strings; sourceTree = ""; }; F88EC12425F6CFC200DF0EAF /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/WatlaaView.strings; sourceTree = ""; }; F88EC12525F6CFC500DF0EAF /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/WatlaaView.strings; sourceTree = ""; }; - F88EC17325FABAAE00DF0EAF /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Common.strings; sourceTree = ""; }; - F88EC17425FABAB000DF0EAF /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Common.strings; sourceTree = ""; }; - F88EC17525FABAB300DF0EAF /* pl-PL */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pl-PL"; path = "pl-PL.lproj/Common.strings"; sourceTree = ""; }; - F88EC17625FABAB700DF0EAF /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Common.strings; sourceTree = ""; }; - F88EC17725FABAB800DF0EAF /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/Common.strings; sourceTree = ""; }; + F88EC17325FABAAE00DF0EAF /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/TextsWidget.strings; sourceTree = ""; }; + F88EC17425FABAB000DF0EAF /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/TextsWidget.strings; sourceTree = ""; }; + F88EC17525FABAB300DF0EAF /* pl-PL */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pl-PL"; path = "pl-PL.lproj/TextsWidget.strings"; sourceTree = ""; }; + F88EC17625FABAB700DF0EAF /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/TextsWidget.strings; sourceTree = ""; }; + F88EC17725FABAB800DF0EAF /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/TextsWidget.strings; sourceTree = ""; }; F88EC279260120C000DF0EAF /* ConstantsAlerts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConstantsAlerts.swift; sourceTree = ""; }; F890E079247687AE008FB2EC /* URL.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URL.swift; sourceTree = ""; }; F897AAF82200F2D200CDDD10 /* CBPeripheralState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CBPeripheralState.swift; sourceTree = ""; }; @@ -1430,7 +1438,7 @@ F8CB59CD27444D6300BA199E /* DexcomSessionStopResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DexcomSessionStopResponse.swift; sourceTree = ""; }; F8CB59D2274D94AE00BA199E /* DexcomSessionStartTxMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DexcomSessionStartTxMessage.swift; sourceTree = ""; }; F8D0587B24BCB570008C8734 /* SettingsViewHomeScreenSettingsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsViewHomeScreenSettingsViewModel.swift; sourceTree = ""; }; - F8D094EB2846BDD50087FFEA /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Common.strings; sourceTree = ""; }; + F8D094EB2846BDD50087FFEA /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/TextsWidget.strings; sourceTree = ""; }; F8D094EC2846BDD50087FFEA /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Treatments.strings; sourceTree = ""; }; F8D094ED2846BDD50087FFEA /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Alerts.strings; sourceTree = ""; }; F8D094EE2846BDD50087FFEA /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/AlertTypesSettingsView.strings; sourceTree = ""; }; @@ -1466,7 +1474,7 @@ F8E4DCD92805F7FA007CF822 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Interface.strings; sourceTree = ""; }; F8E4DCDA2805F7FA007CF822 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/LaunchScreen.strings; sourceTree = ""; }; F8E4DCDB2805F7FA007CF822 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Main.strings; sourceTree = ""; }; - F8E4DCDC2805F7FA007CF822 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Common.strings; sourceTree = ""; }; + F8E4DCDC2805F7FA007CF822 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/TextsWidget.strings; sourceTree = ""; }; F8E4DCDD2805F7FB007CF822 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Treatments.strings; sourceTree = ""; }; F8E4DCDE2805F7FB007CF822 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Alerts.strings; sourceTree = ""; }; F8E4DCDF2805F7FB007CF822 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/AlertTypesSettingsView.strings; sourceTree = ""; }; @@ -1495,12 +1503,12 @@ F8E51D66244BAE0E001C9E5A /* WatlaaBluetoothTransmitterMaster+CGMTransmitter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "WatlaaBluetoothTransmitterMaster+CGMTransmitter.swift"; sourceTree = ""; }; F8E51D6824549E2C001C9E5A /* SettingsViewTraceSettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewTraceSettingsViewModel.swift; sourceTree = ""; }; F8E53FBC2517F96800052CE5 /* Date.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Date.swift; sourceTree = ""; }; - F8E53FCF251D35FB00052CE5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Common.strings; sourceTree = ""; }; - F8E53FD1251D360200052CE5 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Common.strings; sourceTree = ""; }; - F8E53FD2251D360300052CE5 /* zh */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh; path = zh.lproj/Common.strings; sourceTree = ""; }; - F8E53FD3251D361600052CE5 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Common.strings; sourceTree = ""; }; - F8E53FD7251D363B00052CE5 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/Common.strings; sourceTree = ""; }; - F8E53FE8251F7B8800052CE5 /* Common.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Common.swift; sourceTree = ""; }; + F8E53FCF251D35FB00052CE5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/TextsWidget.strings; sourceTree = ""; }; + F8E53FD1251D360200052CE5 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/TextsWidget.strings; sourceTree = ""; }; + F8E53FD2251D360300052CE5 /* zh */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh; path = zh.lproj/TextsWidget.strings; sourceTree = ""; }; + F8E53FD3251D361600052CE5 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/TextsWidget.strings; sourceTree = ""; }; + F8E53FD7251D363B00052CE5 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/TextsWidget.strings; sourceTree = ""; }; + F8E53FE8251F7B8800052CE5 /* TextsWidget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextsWidget.swift; sourceTree = ""; }; F8E5404B2522624800052CE5 /* ConstantsHousekeeping.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConstantsHousekeeping.swift; sourceTree = ""; }; F8E6C78B24CDDB83007C1199 /* SnoozeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnoozeViewController.swift; sourceTree = ""; }; F8E6C78F24CEC22A007C1199 /* TextsSnooze.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextsSnooze.swift; sourceTree = ""; }; @@ -1645,6 +1653,7 @@ 4716A4F32B406C3D00419052 /* XDripWidgetBundle.swift */, 4716A4F52B406C3D00419052 /* XDripWidgetLiveActivity.swift */, 4716A4F92B406C3F00419052 /* Assets.xcassets */, + 4716A50B2B416ECF00419052 /* Constants */, F870D3EF25149EA0008967B0 /* Extensions */, 4716A5032B40704000419052 /* Models */, 4716A5022B40702D00419052 /* Texts */, @@ -1655,8 +1664,8 @@ 4716A5022B40702D00419052 /* Texts */ = { isa = PBXGroup; children = ( - F8E53FE8251F7B8800052CE5 /* Common.swift */, - F8E53FD0251D35FB00052CE5 /* Common.strings */, + F8E53FE8251F7B8800052CE5 /* TextsWidget.swift */, + F8E53FD0251D35FB00052CE5 /* TextsWidget.strings */, ); path = Texts; sourceTree = ""; @@ -1670,6 +1679,14 @@ path = Models; sourceTree = ""; }; + 4716A50B2B416ECF00419052 /* Constants */ = { + isa = PBXGroup; + children = ( + 4716A50C2B416EE100419052 /* ConstantsWidget.swift */, + ); + path = Constants; + sourceTree = ""; + }; 47DB06CC2A7013EF00267BE3 /* Followers */ = { isa = PBXGroup; children = ( @@ -2219,6 +2236,7 @@ isa = PBXGroup; children = ( F8E53FBC2517F96800052CE5 /* Date.swift */, + 4716A5092B416E6500419052 /* Double.swift */, ); path = Extensions; sourceTree = ""; @@ -3359,6 +3377,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 4716A50F2B41708000419052 /* TextsWidget.strings in Resources */, 4716A4FA2B406C3F00419052 /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -3417,6 +3436,7 @@ F824379524CB7A9900BED341 /* Pager_Beeps.caf in Resources */, F8B3A7CD226CC0B7004BA588 /* shorthigh3.caf in Resources */, F824376A24CB7A9800BED341 /* Martian_Gun.caf in Resources */, + 4716A5112B41823A00419052 /* TextsWidget.strings in Resources */, F824378824CB7A9900BED341 /* Insistently.caf in Resources */, F82437B924CB7A9900BED341 /* Siri_Alert_Transmitter_Battery_Low.caf in Resources */, F8B3A7D0226CC0B7004BA588 /* modernalarm.caf in Resources */, @@ -3543,7 +3563,10 @@ 4716A5052B40709E00419052 /* XDripWidgetAttributes.swift in Sources */, 4716A4F62B406C3D00419052 /* XDripWidgetLiveActivity.swift in Sources */, 4716A4F42B406C3D00419052 /* XDripWidgetBundle.swift in Sources */, + 4716A50A2B416E6500419052 /* Double.swift in Sources */, 4716A4F82B406C3D00419052 /* XDripWidget.swift in Sources */, + 4716A50D2B416EE100419052 /* ConstantsWidget.swift in Sources */, + 4716A50E2B41707D00419052 /* TextsWidget.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3862,6 +3885,7 @@ F8A2BC2D25DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMG5TransmitterDelegate.swift in Sources */, 47DB06E72A715EC500267BE3 /* ConstantsLibreLinkUp.swift in Sources */, F8FDFEA9260DE1A70047597D /* DTCustomColoredAccessory.m in Sources */, + 4716A5102B41823600419052 /* TextsWidget.swift in Sources */, F8B3A7DF226E48C1004BA588 /* SoundPlayer.swift in Sources */, D48E8F78278E49B300CCEE08 /* TreatmentNSResponse.swift in Sources */, F816E12C2439DFBA009EE65B /* DexcomG4+CoreDataProperties.swift in Sources */, @@ -4485,7 +4509,7 @@ name = SettingsViews.strings; sourceTree = ""; }; - F8E53FD0251D35FB00052CE5 /* Common.strings */ = { + F8E53FD0251D35FB00052CE5 /* TextsWidget.strings */ = { isa = PBXVariantGroup; children = ( F8E53FCF251D35FB00052CE5 /* en */, @@ -4506,7 +4530,7 @@ F8D094EB2846BDD50087FFEA /* uk */, 4166BFB928C3501500199980 /* el */, ); - name = Common.strings; + name = TextsWidget.strings; sourceTree = ""; }; F8E6C79324CEC2E3007C1199 /* Snooze.strings */ = {