Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
24 changes: 12 additions & 12 deletions Loop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
437CEEE41CDE5C0A003C8C80 /* UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437CEEE31CDE5C0A003C8C80 /* UIImage.swift */; };
437D9BA31D7BC977007245E8 /* PredictionTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437D9BA21D7BC977007245E8 /* PredictionTableViewController.swift */; };
43846AD51D8FA67800799272 /* Base.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 43846AD41D8FA67800799272 /* Base.lproj */; };
43846AD91D8FA84B00799272 /* gallery.ckcomplication in Resources */ = {isa = PBXBuildFile; fileRef = 43846AD81D8FA84B00799272 /* gallery.ckcomplication */; };
43846ADB1D91057000799272 /* ContextUpdatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43846ADA1D91057000799272 /* ContextUpdatable.swift */; };
43880F951D9CD54A009061A8 /* ChartPointsScatterDownTrianglesLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43880F941D9CD54A009061A8 /* ChartPointsScatterDownTrianglesLayer.swift */; };
438849EA1D297CB6003B3F23 /* NightscoutService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 438849E91D297CB6003B3F23 /* NightscoutService.swift */; };
Expand Down Expand Up @@ -188,6 +187,7 @@
C1C73F021DE3D0250022FC89 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C1C73F041DE3D0250022FC89 /* Localizable.strings */; };
C1C73F081DE3D0260022FC89 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C1C73F0A1DE3D0260022FC89 /* InfoPlist.strings */; };
C1C73F0D1DE3D0270022FC89 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C1C73F0F1DE3D0270022FC89 /* InfoPlist.strings */; };
C9B960891E55827700687B62 /* gallery.ckcomplication in Resources */ = {isa = PBXBuildFile; fileRef = C9B960881E55827600687B62 /* gallery.ckcomplication */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -368,7 +368,6 @@
437D9BA11D7B5203007245E8 /* Loop.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Loop.xcconfig; sourceTree = "<group>"; };
437D9BA21D7BC977007245E8 /* PredictionTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PredictionTableViewController.swift; sourceTree = "<group>"; };
43846AD41D8FA67800799272 /* Base.lproj */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Base.lproj; sourceTree = "<group>"; };
43846AD81D8FA84B00799272 /* gallery.ckcomplication */ = {isa = PBXFileReference; lastKnownFileType = folder; path = gallery.ckcomplication; sourceTree = "<group>"; };
43846ADA1D91057000799272 /* ContextUpdatable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContextUpdatable.swift; sourceTree = "<group>"; };
43880F941D9CD54A009061A8 /* ChartPointsScatterDownTrianglesLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChartPointsScatterDownTrianglesLayer.swift; sourceTree = "<group>"; };
438849E91D297CB6003B3F23 /* NightscoutService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NightscoutService.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -479,6 +478,7 @@
C1C73F031DE3D0250022FC89 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = "<group>"; };
C1C73F091DE3D0260022FC89 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InfoPlist.strings; sourceTree = "<group>"; };
C1C73F0E1DE3D0270022FC89 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InfoPlist.strings; sourceTree = "<group>"; };
C9B960881E55827600687B62 /* gallery.ckcomplication */ = {isa = PBXFileReference; lastKnownFileType = folder; path = gallery.ckcomplication; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -633,7 +633,7 @@
43776F8E1B8022E90074EA36 /* Loop */ = {
isa = PBXGroup;
children = (
43846AD81D8FA84B00799272 /* gallery.ckcomplication */,
C9B960881E55827600687B62 /* gallery.ckcomplication */,
43EDEE6B1CF2E12A00393BE3 /* Loop.entitlements */,
43F5C2D41B92A4A6003EB13D /* Info.plist */,
43776F8F1B8022E90074EA36 /* AppDelegate.swift */,
Expand Down Expand Up @@ -1192,7 +1192,7 @@
434F54591D28805E002A9274 /* ButtonTableViewCell.xib in Resources */,
C1C73F021DE3D0250022FC89 /* Localizable.strings in Resources */,
43776F971B8022E90074EA36 /* Main.storyboard in Resources */,
43846AD91D8FA84B00799272 /* gallery.ckcomplication in Resources */,
C9B960891E55827700687B62 /* gallery.ckcomplication in Resources */,
434F545B1D2880D4002A9274 /* AuthenticationTableViewCell.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1667,7 +1667,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Loop/Loop.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = HG99VQQ8VF;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need to be reverted.

FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
Expand All @@ -1688,7 +1688,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Loop/Loop.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = HG99VQQ8VF;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
Expand All @@ -1706,7 +1706,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = HG99VQQ8VF;
INFOPLIST_FILE = "WatchApp Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "$(MAIN_APP_BUNDLE_IDENTIFIER).watchkitapp.watchkitextension";
Expand All @@ -1723,7 +1723,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = HG99VQQ8VF;
INFOPLIST_FILE = "WatchApp Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "$(MAIN_APP_BUNDLE_IDENTIFIER).watchkitapp.watchkitextension";
Expand All @@ -1742,7 +1742,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = HG99VQQ8VF;
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -1762,7 +1762,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = HG99VQQ8VF;
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down Expand Up @@ -1848,7 +1848,7 @@
CODE_SIGN_ENTITLEMENTS = "Loop Status Extension/Loop Status Extension.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = HG99VQQ8VF;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
Expand All @@ -1872,7 +1872,7 @@
CODE_SIGN_ENTITLEMENTS = "Loop Status Extension/Loop Status Extension.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = HG99VQQ8VF;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
Expand Down
16 changes: 0 additions & 16 deletions Loop/gallery.ckcomplication/Base.lproj/ckcomplication.strings

This file was deleted.

13 changes: 7 additions & 6 deletions Loop/gallery.ckcomplication/complicationManifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"supported complication families" : {
"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"
"3" : "F70B3898-9EF6-4BA6-AD7D-61EA7783B2B5.json",
"1" : "FC51C664-9919-4173-A297-0D6338B87700.json",
"6" : "60480B57-87A4-4073-814A-6D2DBB98F7FF.json",
"4" : "470CF733-7F65-4BEA-853B-68D49378EA44.json",
"0" : "645E4A29-EC77-49F2-BC35-42F2CDC6DD2D.json",
"7" : "21849667-AD99-4107-BDAE-64914E038CA6.json"
},
"client ID" : "com.loudnate.Loop.watchkitapp.watchkitextension"
"client ID" : "com.walker0.Loop.watchkitapp.watchkitextension"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this as well

}
7 changes: 6 additions & 1 deletion WatchApp Extension/ComplicationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,19 @@ final class ComplicationController: NSObject, CLKComplicationDataSource {
let template: CLKComplicationTemplate?

let glucoseText = CLKSimpleTextProvider.localizableTextProvider(withStringsFileTextKey: "120↘︎", shortTextKey: "120")
let timeText = CLKTimeTextProvider(date: Date())
let timeText = CLKRelativeDateTextProvider(date: Date(), style: .natural, units: .minute)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this fit on the smaller complications?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it does. It is reactive to available space so it should fit. I haven't ever been able to get the utilitarian large complication to work to test that one, nor have I looked into why. This change definitely works for modular small as well as the large version though.


switch complication.family {
case .modularSmall:
let modularSmall = CLKComplicationTemplateModularSmallStackText()
modularSmall.line1TextProvider = glucoseText
modularSmall.line2TextProvider = timeText
template = modularSmall
case .modularLarge:
let modularSmall = CLKComplicationTemplateModularLargeTallBody()
modularSmall.bodyTextProvider = glucoseText
modularSmall.headerTextProvider = timeText
template = modularSmall
case .circularSmall:
let circularSmall = CLKComplicationTemplateCircularSmallSimpleText()
circularSmall.textProvider = glucoseText
Expand Down
25 changes: 15 additions & 10 deletions WatchApp Extension/Controllers/StatusInterfaceController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,33 @@ final class StatusInterfaceController: WKInterfaceController, ContextUpdatable {
loopTimer.setHidden(true)
loopHUDImage.setLoopImage(.Unknown)
}

guard let glucose = context?.glucose,
let unit = context?.preferredGlucoseUnit
else {
glucoseLabel.setHidden(true)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation off

eventualGlucoseLabel.setHidden(true)
return
}

let numberFormatter = NumberFormatter()
let formatter = NumberFormatter.glucoseFormatter(for: unit)

if let glucose = context?.glucose, let unit = context?.preferredGlucoseUnit {
let glucoseValue = glucose.doubleValue(for: unit)
if let glucoseValue = formatter.string(from: NSNumber(value: glucose.doubleValue(for: unit))){
let trend = context?.glucoseTrend?.symbol ?? ""

self.glucoseLabel.setText((numberFormatter.string(from: NSNumber(value: glucoseValue)) ?? "") + trend)
self.glucoseLabel.setText(glucoseValue + trend)
self.glucoseLabel.setHidden(false)
} else {
glucoseLabel.setHidden(true)
}

if let eventualGlucose = context?.eventualGlucose, let unit = context?.preferredGlucoseUnit {
let glucoseValue = eventualGlucose.doubleValue(for: unit)

self.eventualGlucoseLabel.setText(numberFormatter.string(from: NSNumber(value: glucoseValue)))
if let eventualGlucose = context?.eventualGlucose {
let glucoseValue = formatter.string(from: NSNumber(value: eventualGlucose.doubleValue(for: unit)))
self.eventualGlucoseLabel.setText(glucoseValue)
self.eventualGlucoseLabel.setHidden(false)
} else {
eventualGlucoseLabel.setHidden(true)
}

// TODO: Other elements
statusLabel.setHidden(true)
graphImage.setHidden(true)
Expand Down
7 changes: 6 additions & 1 deletion WatchApp Extension/Extensions/CLKComplicationTemplate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,19 @@ extension CLKComplicationTemplate {
}

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

switch family {
case .modularSmall:
let template = CLKComplicationTemplateModularSmallStackText()
template.line1TextProvider = glucoseText
template.line2TextProvider = timeText
return template
case .modularLarge:
let template = CLKComplicationTemplateModularLargeTallBody()
template.bodyTextProvider = glucoseText
template.headerTextProvider = timeText
return template
case .circularSmall:
let template = CLKComplicationTemplateCircularSmallSimpleText()
template.textProvider = glucoseText
Expand Down
1 change: 1 addition & 0 deletions WatchApp Extension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<string>CLKComplicationFamilyExtraLarge</string>
<string>CLKComplicationFamilyUtilitarianSmallFlat</string>
<string>CLKComplicationFamilyUtilitarianLarge</string>
<string>CLKComplicationFamilyModularLarge</string>
</array>
<key>NSExtension</key>
<dict>
Expand Down