Skip to content

Commit 10f96c0

Browse files
authored
Merge pull request #582 from tidepool-org/noah/LOOP-4681-new-meals-main-ui
[LOOP-4681] favorite foods main screen UI, feature secret unlock with modified tab bar
2 parents ab9d9b9 + 1256b0e commit 10f96c0

File tree

17 files changed

+588
-65
lines changed

17 files changed

+588
-65
lines changed

Loop.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
1419606428D9550400BA86E0 /* LoopKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 437AFEE6203688CF008C4892 /* LoopKitUI.framework */; };
1111
1419606928D9554E00BA86E0 /* LoopKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 437AFEE6203688CF008C4892 /* LoopKitUI.framework */; };
1212
1419606A28D955BC00BA86E0 /* MockKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C101947127DD473C004E7EB8 /* MockKitUI.framework */; };
13+
142CB7592A60BF2E0075748A /* EditMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 142CB7582A60BF2E0075748A /* EditMode.swift */; };
14+
142CB75B2A60BFC30075748A /* FavoriteFoodsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 142CB75A2A60BFC30075748A /* FavoriteFoodsView.swift */; };
1315
1481F9BB28DA26F4004C5AEB /* LoopUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F75288B1DFE1DC600C322D6 /* LoopUI.framework */; };
1416
14B1735E28AED9EC006CCD7C /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 14B1735D28AED9EC006CCD7C /* WidgetKit.framework */; };
1517
14B1736028AED9EC006CCD7C /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 14B1735F28AED9EC006CCD7C /* SwiftUI.framework */; };
@@ -785,6 +787,8 @@
785787
/* End PBXCopyFilesBuildPhase section */
786788

787789
/* Begin PBXFileReference section */
790+
142CB7582A60BF2E0075748A /* EditMode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditMode.swift; sourceTree = "<group>"; };
791+
142CB75A2A60BFC30075748A /* FavoriteFoodsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FavoriteFoodsView.swift; sourceTree = "<group>"; };
788792
14B1735C28AED9EC006CCD7C /* SmallStatusWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SmallStatusWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
789793
14B1735D28AED9EC006CCD7C /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; };
790794
14B1735F28AED9EC006CCD7C /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
@@ -2332,6 +2336,7 @@
23322336
A9CBE457248AB564008E7BA2 /* DoseStore+SimulatedCoreData.swift */,
23332337
A9B996F127238705002DC09C /* DosingDecisionStore.swift */,
23342338
A9CBE459248ACBE1008E7BA2 /* DosingDecisionStore+SimulatedCoreData.swift */,
2339+
142CB7582A60BF2E0075748A /* EditMode.swift */,
23352340
A9F703742489C9A000C98AD8 /* GlucoseStore+SimulatedCoreData.swift */,
23362341
A9DCF2D525B0F3C500C89088 /* LoopUIColorPalette+Default.swift */,
23372342
89E267FE229267DF00A3F2AF /* Optional.swift */,
@@ -2384,6 +2389,7 @@
23842389
431A8C3F1EC6E8AB00823B9C /* CircleMaskView.swift */,
23852390
A9A056B224B93C62007CF06D /* CriticalEventLogExportView.swift */,
23862391
C191D2A025B3ACAA00C26C0B /* DosingStrategySelectionView.swift */,
2392+
142CB75A2A60BFC30075748A /* FavoriteFoodsView.swift */,
23872393
43D381611EBD9759007F8C8F /* HeaderValuesTableViewCell.swift */,
23882394
B43CF07D29434EC4008A520B /* HowMuteAlertWorkView.swift */,
23892395
430D85881F44037000AF2D4F /* HUDViewTableViewCell.swift */,
@@ -3822,6 +3828,7 @@
38223828
4311FB9B1F37FE1B00D4C0A7 /* TitleSubtitleTextFieldTableViewCell.swift in Sources */,
38233829
C1F2075C26D6F9B0007AB7EB /* ProfileExpirationAlerter.swift in Sources */,
38243830
B4FEEF7D24B8A71F00A8DF9B /* DeviceDataManager+DeviceStatus.swift in Sources */,
3831+
142CB7592A60BF2E0075748A /* EditMode.swift in Sources */,
38253832
E95D380324EADF36005E2F50 /* CarbStoreProtocol.swift in Sources */,
38263833
E98A55ED24EDD6380008715D /* LatestStoredSettingsProvider.swift in Sources */,
38273834
C1FB428F217921D600FAB378 /* PumpManagerUI.swift in Sources */,
@@ -3849,6 +3856,7 @@
38493856
43A567691C94880B00334FAC /* LoopDataManager.swift in Sources */,
38503857
1DA649A9244126DA00F61E75 /* InAppModalAlertScheduler.swift in Sources */,
38513858
43B260491ED248FB008CAA77 /* CarbEntryTableViewCell.swift in Sources */,
3859+
142CB75B2A60BFC30075748A /* FavoriteFoodsView.swift in Sources */,
38523860
A9D5C5B625DC6C6A00534873 /* LoopAppManager.swift in Sources */,
38533861
4302F4E11D4E9C8900F0FCAF /* TextFieldTableViewController.swift in Sources */,
38543862
C1742332259BEADC00399C9D /* ManualEntryDoseView.swift in Sources */,
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "meals.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true,
14+
"template-rendering-intent" : "template"
15+
}
16+
}
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "presets-selected.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true,
14+
"template-rendering-intent" : "template"
15+
}
16+
}
Binary file not shown.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0.902",
9+
"green" : "0.745",
10+
"red" : "0.365"
11+
}
12+
},
13+
"idiom" : "universal"
14+
},
15+
{
16+
"appearances" : [
17+
{
18+
"appearance" : "luminosity",
19+
"value" : "dark"
20+
}
21+
],
22+
"color" : {
23+
"color-space" : "srgb",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0.902",
27+
"green" : "0.745",
28+
"red" : "0.365"
29+
}
30+
},
31+
"idiom" : "universal"
32+
}
33+
],
34+
"info" : {
35+
"author" : "xcode",
36+
"version" : 1
37+
}
38+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "presets.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true,
14+
"template-rendering-intent" : "template"
15+
}
16+
}
Binary file not shown.

Loop/Extensions/EditMode.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// EditMode.swift
3+
// Loop
4+
//
5+
// Created by Noah Brauner on 7/13/23.
6+
// Copyright © 2023 LoopKit Authors. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
11+
extension EditMode {
12+
var title: String {
13+
self == .active ? "Done" : "Edit"
14+
}
15+
16+
mutating func toggle() {
17+
self = self == .active ? .inactive : .active
18+
}
19+
}

Loop/Extensions/UIAlertController.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,30 @@ import LoopKitUI
1212

1313

1414
extension UIAlertController {
15+
/**
16+
Initializes an ActionSheet-styled controller for selecting a preset type
17+
18+
- parameter handler: A closure to execute when the sheet is dismissed after selection. The closure has a single argument:
19+
- duration: The duration for which the workout is to be enabled
20+
*/
21+
internal convenience init(presetTypeSelectionHandler handler: @escaping (_ selection: TemporaryScheduleOverride.Context) -> Void) {
22+
self.init(
23+
title: NSLocalizedString("Choose a Preset", comment: "The title of the alert controller used to select a preset"),
24+
message: nil,
25+
preferredStyle: .actionSheet
26+
)
27+
28+
addAction(UIAlertAction(title: "Workout Preset", style: .default) { _ in
29+
handler(.legacyWorkout)
30+
})
31+
32+
addAction(UIAlertAction(title: "Pre-Meal Preset", style: .default) { _ in
33+
handler(.preMeal)
34+
})
35+
36+
addCancelAction()
37+
}
38+
1539
/**
1640
Initializes an ActionSheet-styled controller for selecting a workout duration
1741

0 commit comments

Comments
 (0)