Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
93111d5
Open the app when the user taps on the widget
Dec 23, 2016
bdb02ab
Use MAIN_APP_BUNDLE_IDENTIFIER instead of hardcoding "Loop" as the UR…
Dec 23, 2016
82dc3da
Improve string concatenation style
Dec 23, 2016
67f0c3d
Merge pull request #334 from bharat/tap-opens-app
ps2 Dec 25, 2016
21ace16
Fix widget battery level for x22 pumps
wkcwells Dec 27, 2016
378b525
Fix broken build.
Dec 29, 2016
51b09c1
Merge pull request #346 from bharat/fix-build
ps2 Dec 30, 2016
2058195
Merge pull request #342 from wkcwells/fix-battery-in-widget
ps2 Dec 30, 2016
0b7afad
Merge pull request #340 from LoopKit/update-rl-frameworks
ps2 Dec 30, 2016
a3558d4
Refactor HUD views into LoopUI framework (#284) (#330)
Jan 1, 2017
d540cce
Monitor changes and update the widget in real time. (#335)
Jan 2, 2017
311ba44
Use a clear fill color for the circle. (#355)
Jan 2, 2017
9566eac
Refactor files with membership in multiple targets into a Common hier…
Jan 2, 2017
9d3cfad
Disable animation on first render, since we'd be animating from a (#354)
Jan 2, 2017
9d9890b
Enforce a fixed number of fractional digits per unit type. (#356)
Jan 5, 2017
7e221ee
Add an info.plist entry to widget info.plist to make tapping on widge…
wkcwells Jan 5, 2017
aac86be
Only allow one active glucose data source (#364)
Feb 11, 2017
f1e4342
Upgrade project to 0820 (#376)
Feb 13, 2017
c262b64
Merge complications changes back into dev (they were accidentally mer…
ps2 Feb 16, 2017
a0b425b
Merge branch 'master' into dev
ps2 Feb 16, 2017
bb7cb32
Merge branch 'master' into dev
ps2 Feb 16, 2017
1775f42
Tmecklem x22 enlite cgm (#378)
ps2 Feb 19, 2017
3ba50da
remove +ve momentum from bolus calculation (#372)
thebookins Feb 19, 2017
08591de
Minimum bg guard (#365)
ps2 Feb 20, 2017
841a366
Update LoopKit and Rileylink frameworks
ps2 Feb 20, 2017
3ae1077
Merge pull request #380 from LoopKit/update-frameworks
ps2 Feb 20, 2017
93da3d4
Bump version
ps2 Feb 20, 2017
59ce749
Merge pull request #381 from LoopKit/bump-version
ps2 Feb 20, 2017
27017e6
Show bg values in warning messages in bolus ui
ps2 Feb 24, 2017
cb394ca
Do not show last loop errors in bolus view; only recommendation alerts
ps2 Feb 24, 2017
2b6e739
Show last loop error on clicking loop status
ps2 Feb 24, 2017
32764bc
Use tap gesture recognizer instead of delegate
ps2 Feb 25, 2017
6ccc578
remove extraneous line
ps2 Feb 25, 2017
ef9f943
Add recovery text for configuration alerts, and single out minimum bg…
ps2 Feb 25, 2017
1a47658
Merge pull request #384 from LoopKit/last-loop-error
ps2 Feb 25, 2017
c92e780
Merge pull request #382 from LoopKit/bolus-ui-updates
ps2 Feb 25, 2017
d3e2a6f
update to new rl framework
ps2 Mar 2, 2017
e8b207e
Add mmol watchapp units support. Add modularLarge complication. Chang…
walker0 Mar 2, 2017
630bb96
Complications update (#389)
ps2 Mar 2, 2017
5ea6f8d
Last loop completed and battery level restored from userDefaults on a…
ps2 Mar 6, 2017
6a993c6
Merge pull request #391 from LoopKit/status-extension-refactor
ps2 Mar 6, 2017
f82acbe
Fixing truncated utilitarian small complication
ps2 Mar 6, 2017
514ce93
Merge pull request #392 from LoopKit/complications
ps2 Mar 6, 2017
5bd4f11
Refactoring charting code to remove unnecessary work and unnecessary …
ps2 Mar 6, 2017
05560b0
Update to rileylink frameworks v1.0
ps2 Mar 9, 2017
8bde18c
Remove development team ids
ps2 Mar 9, 2017
884819a
Merge pull request #393 from LoopKit/charts-refactor
ps2 Mar 10, 2017
49bbd40
Merge pull request #394 from LoopKit/rl-update
ps2 Mar 10, 2017
2297c54
MySentry off should report as non valid sensor info
ps2 Mar 12, 2017
3873fdc
Merge pull request #401 from LoopKit/sensorinfo
ps2 Mar 12, 2017
8988d22
prep version for release
ps2 Mar 13, 2017
e3efa6d
Merge pull request #402 from LoopKit/version-bump
ps2 Mar 13, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge complications changes back into dev (they were accidentally mer…
…ged to master)
  • Loading branch information
ps2 committed Feb 16, 2017
commit c262b64cdf21d425badc1ab9f291b66d6ee7923b
49 changes: 22 additions & 27 deletions Loop.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Loop/Managers/StatusExtensionDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ extension StatusExtensionDataManager: CustomDebugStringConvertible {
var debugDescription: String {
return [
"## StatusExtensionDataManager",
"appGroupName: \(Bundle.main.appGroupSuiteName)",
"statusExtensionContext: \(String(reflecting: defaults?.statusExtensionContext))"
].joined(separator: "\n")
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@
*/

/* The complication template example unit string */
"mg/dL" = "mg/dL"
"120↘︎" = "120↘︎";

/* Utilitarian small flat format string (1: Glucose & Trend symbol) (2: Time) */
"UtilitarianSmallFlat" = "%1@ %2@";

/* Utilitarian small flat format string (1: Glucose & Trend symbol) (2: Eventual Glucose) (3: Time) */
"UtilitarianLargeFlat" = "%1@%2@ %3@";
6 changes: 5 additions & 1 deletion Loop/gallery.ckcomplication/complicationManifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"supported complication families" : {
"0" : "A307227B-6EFF-4242-A538-2C9AC617E041.json"
"3" : "CFB33AC2-7CD0-43A0-804F-F9A0EEC37480.json",
"6" : "E87B02EB-57B2-4E9D-B371-E0BA2DD55C19.json",
"4" : "B922BD0B-9601-45C9-B84D-ECB9C8235322.json",
"0" : "69B78E1F-415D-4E9E-8E56-E486517658FC.json",
"7" : "AB5AF86D-FF8F-493B-A738-4BB590C8A45E.json"
},
"client ID" : "com.loudnate.Loop.watchkitapp.watchkitextension"
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ Bluetooth LE communication with Minimed pumps is enabled by the [RileyLink](http

[Sign up for the Loop Users announcement list](https://groups.google.com/forum/#!forum/loop-ios-users) to stay informed of critical issues that may arise.

[Please visit the Wiki for a "Guide to Loop" setup, installation, FAQs, and use.](https://github.com/LoopKit/Loop/wiki)
Please use the [Guide to Loop](https://github.com/LoopKit/Loop/wiki/Guide) for building, installation, and configuration instructions.

For FAQs and other tips, refer to the [Wiki](https://github.com/LoopKit/Loop/wiki)

(Note: there is also a tab for the Wiki at the top of this page)

Expand Down
8 changes: 7 additions & 1 deletion WatchApp Extension/Base.lproj/ckcomplication.strings
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@
*/

/* The complication template example unit string */
"mg/dL" = "mg/dL"
"120↘︎" = "120↘︎";

/* Utilitarian small flat format string (1: Glucose & Trend symbol) (2: Time) */
"UtilitarianSmallFlat" = "%1@ %2@";

/* Utilitarian small flat format string (1: Glucose & Trend symbol) (2: Eventual Glucose) (3: Time) */
"UtilitarianLargeFlat" = "%1@%2@ %3@";
73 changes: 45 additions & 28 deletions WatchApp Extension/ComplicationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,14 @@ final class ComplicationController: NSObject, CLKComplicationDataSource {
private lazy var formatter = NumberFormatter()

func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: (@escaping (CLKComplicationTimelineEntry?) -> Void)) {

switch complication.family {
case .modularSmall:
if let context = ExtensionDelegate.shared().lastContext,
let glucose = context.glucose,
let unit = context.preferredGlucoseUnit,
let glucoseString = formatter.string(from: NSNumber(value: glucose.doubleValue(for: unit))),
let date = context.glucoseDate, date.timeIntervalSinceNow.minutes >= -15,
let template = CLKComplicationTemplateModularSmallStackText(line1: glucoseString, date: date)
{
handler(CLKComplicationTimelineEntry(date: date, complicationTemplate: template))
} else {
handler(nil)
}
default:
if let context = ExtensionDelegate.shared().lastContext,
let glucoseDate = context.glucoseDate,
glucoseDate.timeIntervalSinceNow.minutes >= -15,
let template = CLKComplicationTemplate.templateForFamily(complication.family, from: context)
{
template.tintColor = UIColor.tintColor
handler(CLKComplicationTimelineEntry(date: glucoseDate, complicationTemplate: template))
} else {
handler(nil)
}
}
Expand All @@ -69,13 +62,12 @@ final class ComplicationController: NSObject, CLKComplicationDataSource {

func getTimelineEntries(for complication: CLKComplication, after date: Date, limit: Int, withHandler handler: (@escaping ([CLKComplicationTimelineEntry]?) -> Void)) {
// Call the handler with the timeline entries after to the given date
if let context = ExtensionDelegate.shared().lastContext,
let glucose = context.glucose,
let unit = context.preferredGlucoseUnit,
let glucoseString = formatter.string(from: NSNumber(value: glucose.doubleValue(for: unit))),
let glucoseDate = context.glucoseDate, glucoseDate.timeIntervalSince(date) > 0,
let template = CLKComplicationTemplateModularSmallStackText(line1: glucoseString, date: glucoseDate)
if let context = ExtensionDelegate.shared().lastContext,
let glucoseDate = context.glucoseDate,
glucoseDate.timeIntervalSince(date) > 0,
let template = CLKComplicationTemplate.templateForFamily(complication.family, from: context)
{
template.tintColor = UIColor.tintColor
handler([CLKComplicationTimelineEntry(date: glucoseDate, complicationTemplate: template)])
} else {
handler(nil)
Expand All @@ -85,16 +77,41 @@ final class ComplicationController: NSObject, CLKComplicationDataSource {
// MARK: - Placeholder Templates

func getLocalizableSampleTemplate(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTemplate?) -> Void) {
switch complication.family {
case .modularSmall:
let template = CLKComplicationTemplateModularSmallStackText()

template.line1TextProvider = CLKSimpleTextProvider(text: "--", shortText: "--", accessibilityLabel: "No glucose value available")
template.line2TextProvider = CLKSimpleTextProvider.localizableTextProvider(withStringsFileTextKey: "mg/dL")
let template: CLKComplicationTemplate?

let glucoseText = CLKSimpleTextProvider.localizableTextProvider(withStringsFileTextKey: "120↘︎", shortTextKey: "120")
let timeText = CLKTimeTextProvider(date: Date())

handler(template)
switch complication.family {
case .modularSmall:
let modularSmall = CLKComplicationTemplateModularSmallStackText()
modularSmall.line1TextProvider = glucoseText
modularSmall.line2TextProvider = timeText
template = modularSmall
case .circularSmall:
let circularSmall = CLKComplicationTemplateCircularSmallSimpleText()
circularSmall.textProvider = glucoseText
template = circularSmall
case .extraLarge:
let extraLarge = CLKComplicationTemplateExtraLargeStackText()
extraLarge.line1TextProvider = glucoseText
extraLarge.line2TextProvider = timeText
template = extraLarge
case .utilitarianSmallFlat:
let utilitarianSmallFlat = CLKComplicationTemplateUtilitarianSmallFlat()
utilitarianSmallFlat.textProvider = CLKSimpleTextProvider.localizableTextProvider(withStringsFileFormatKey: "UtilitarianSmallFlat", textProviders: [glucoseText, timeText])
template = utilitarianSmallFlat
case .utilitarianLarge:
let utilitarianLarge = CLKComplicationTemplateUtilitarianLargeFlat()
let eventualGlucoseText = CLKSimpleTextProvider.localizableTextProvider(withStringsFileTextKey: "75")
utilitarianLarge.textProvider = CLKSimpleTextProvider.localizableTextProvider(withStringsFileFormatKey: "UtilitarianLargeFlat", textProviders: [glucoseText, eventualGlucoseText, timeText])
template = utilitarianLarge
default:
handler(nil)
template = nil
}

template?.tintColor = UIColor.tintColor
handler(template)
}
}
66 changes: 59 additions & 7 deletions WatchApp Extension/Extensions/CLKComplicationTemplate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,69 @@ import ClockKit
import Foundation


extension CLKComplicationTemplateModularSmallStackText {
extension CLKComplicationTemplate {

convenience init?(line1: String?, date: Date?) {
guard let line1 = line1, let date = date else {
static func templateForFamily(_ family: CLKComplicationFamily, from context: WatchContext) -> CLKComplicationTemplate? {

guard let glucose = context.glucose,
let unit = context.preferredGlucoseUnit
else {
return nil
}

self.init()
let formatter = NumberFormatter.glucoseFormatter(for: unit)

line1TextProvider = CLKSimpleTextProvider(text: line1)
line2TextProvider = CLKTimeTextProvider(date: date)
}
guard let glucoseString = formatter.string(from: NSNumber(value: glucose.doubleValue(for: unit))),
let date = context.glucoseDate else
{
return nil
}

var glucoseStrings = [glucoseString]
var accessibilityStrings = [glucoseString]
var eventualGlucoseText: CLKSimpleTextProvider?

if let trend = context.glucoseTrend {
glucoseStrings.append(trend.symbol)
accessibilityStrings.append(trend.localizedDescription)
}

if let eventualGlucose = context.eventualGlucose,
let eventualGlucoseString = formatter.string(from: NSNumber(value: eventualGlucose.doubleValue(for: unit)))
{
eventualGlucoseText = CLKSimpleTextProvider(text: eventualGlucoseString)
}

let glucoseText = CLKSimpleTextProvider(text: glucoseStrings.joined(), shortText: glucoseString, accessibilityLabel: accessibilityStrings.joined(separator: ", "))
let timeText = CLKTimeTextProvider(date: date)

switch family {
case .modularSmall:
let template = CLKComplicationTemplateModularSmallStackText()
template.line1TextProvider = glucoseText
template.line2TextProvider = timeText
return template
case .circularSmall:
let template = CLKComplicationTemplateCircularSmallSimpleText()
template.textProvider = glucoseText
return template
case .extraLarge:
let template = CLKComplicationTemplateExtraLargeStackText()
template.line1TextProvider = glucoseText
template.line2TextProvider = timeText
return template
case .utilitarianSmallFlat:
let template = CLKComplicationTemplateUtilitarianSmallFlat()
template.textProvider = CLKSimpleTextProvider.localizableTextProvider(withStringsFileFormatKey: "UtilitarianSmallFlat", textProviders: [glucoseText, timeText])
return template
case .utilitarianLarge:
let template = CLKComplicationTemplateUtilitarianLargeFlat()
let providers: [CLKTextProvider?] = [glucoseText, eventualGlucoseText, timeText]

template.textProvider = CLKSimpleTextProvider.localizableTextProvider(withStringsFileFormatKey: "UtilitarianLargeFlat", textProviders: providers.flatMap({ $0 }))
return template
default:
return nil
}
}
}
4 changes: 4 additions & 0 deletions WatchApp Extension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<key>CLKComplicationSupportedFamilies</key>
<array>
<string>CLKComplicationFamilyModularSmall</string>
<string>CLKComplicationFamilyCircularSmall</string>
<string>CLKComplicationFamilyExtraLarge</string>
<string>CLKComplicationFamilyUtilitarianSmallFlat</string>
<string>CLKComplicationFamilyUtilitarianLarge</string>
</array>
<key>NSExtension</key>
<dict>
Expand Down