Skip to content

Commit f66d332

Browse files
committed
improve large font display for Live Activity;
* add section headings; * modify strings
1 parent f651548 commit f66d332

File tree

5 files changed

+91
-70
lines changed

5 files changed

+91
-70
lines changed

Loop/Localizable.xcstrings

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5321,7 +5321,7 @@
53215321
}
53225322
}
53235323
},
5324-
"Add item to bottom row" : {
5324+
"Add item to Lock Screen / CarPlay display" : {
53255325
"comment" : "Title for Add item"
53265326
},
53275327
"Add Meal" : {
@@ -5449,9 +5449,6 @@
54495449
}
54505450
}
54515451
},
5452-
"Add predictive line" : {
5453-
"comment" : "Title for predictive line toggle"
5454-
},
54555452
"Add Pump" : {
54565453
"comment" : "Action sheet title selecting Pump\nThe title of the pump chooser in settings\nTitle text for button to add pump device\nTitle text for button to set up a Pump",
54575454
"localizations" : {
@@ -9837,12 +9834,6 @@
98379834
}
98389835
}
98399836
},
9840-
"Bottom row" : {
9841-
"comment" : "Live activity Bottom row configuration title"
9842-
},
9843-
"Bottom row configuration" : {
9844-
"comment" : "Title for Bottom row configuration"
9845-
},
98469837
"Cancel" : {
98479838
"comment" : "Button label for cancel\nButton text to cancel\nCancel button for reset loop alert\nCancel export button title\nThe title of the cancel action in an action sheet",
98489839
"localizations" : {
@@ -13108,6 +13099,14 @@
1310813099
}
1310913100
}
1311013101
},
13102+
"Configure Display" : {
13103+
"comment" : "The title of the view that allows users to configure the display of their live activity information on their iPhone's lock screen and CarPlay display.",
13104+
"isCommentAutoGenerated" : true
13105+
},
13106+
"Configure Lock Screen / Carplay Row" : {
13107+
"comment" : "A link in the live activity settings that takes the user to a view where they can configure the row displayed on their lock screen or carplay.",
13108+
"isCommentAutoGenerated" : true
13109+
},
1311113110
"Continue" : {
1311213111
"comment" : "Button label for continue\nDefault alert dismissal",
1311313112
"localizations" : {
@@ -16128,6 +16127,20 @@
1612816127
}
1612916128
}
1613016129
},
16130+
"Display colors for glucose" : {
16131+
"comment" : "Title for glucose coloring"
16132+
},
16133+
"Display Control Options" : {
16134+
"comment" : "A section header for controls related to the display of glucose levels in the live activity chart.",
16135+
"isCommentAutoGenerated" : true
16136+
},
16137+
"Display prediction in plot" : {
16138+
"comment" : "Title for prediction line toggle"
16139+
},
16140+
"Display up to 4 items" : {
16141+
"comment" : "A section header that instructs the user on how many items can be displayed in the Lock Screen / CarPlay row.",
16142+
"isCommentAutoGenerated" : true
16143+
},
1613116144
"Done" : {
1613216145
"localizations" : {
1613316146
"cs" : {
@@ -23559,6 +23572,10 @@
2355923572
}
2356023573
}
2356123574
},
23575+
"Lock Screen / Dynamic Island / CarPlay" : {
23576+
"comment" : "The title of a section in the live activity settings view, related to lock screen, dynamic island, and carplay.",
23577+
"isCommentAutoGenerated" : true
23578+
},
2356223579
"Log Dose" : {
2356323580
"comment" : "Button text to log a dose\nTitle for dose logging screen",
2356423581
"localizations" : {
@@ -32945,6 +32962,10 @@
3294532962
}
3294632963
}
3294732964
},
32965+
"Select Lock Screen Display Options" : {
32966+
"comment" : "A section header in the live activity settings screen, describing the options available for customizing the display on the lock screen.",
32967+
"isCommentAutoGenerated" : true
32968+
},
3294832969
"Selecting a favorite food in the carb entry screen automatically fills in the carb quantity, food type, and absorption time fields! Tap the add button below to create your first favorite food!" : {
3294932970
"localizations" : {
3295032971
"da" : {
@@ -38430,9 +38451,6 @@
3843038451
}
3843138452
}
3843238453
},
38433-
"Use BG coloring" : {
38434-
"comment" : "Title for BG coloring"
38435-
},
3843638454
"Use Pre-Meal Preset" : {
3843738455
"comment" : "The title of the alert controller used to select a duration for pre-meal targets",
3843838456
"localizations" : {
@@ -40913,5 +40931,5 @@
4091340931
}
4091440932
}
4091540933
},
40916-
"version" : "1.0"
40934+
"version" : "1.1"
4091740935
}

Loop/Views/LiveActivityBottomRowManagerView.swift

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,27 @@ struct LiveActivityBottomRowManagerView: View {
3636
}
3737
buttons.append(.cancel(Text(NSLocalizedString("Cancel", comment: "Button text to cancel"))))
3838

39-
return ActionSheet(title: Text(NSLocalizedString("Add item to bottom row", comment: "Title for Add item")), buttons: buttons)
39+
return ActionSheet(title: Text(NSLocalizedString("Add item to Lock Screen / CarPlay display", comment: "Title for Add item")), buttons: buttons)
4040
}
4141

4242
var body: some View {
4343
List {
44-
ForEach($configuration, id: \.self) { item in
45-
HStack {
46-
deleteButton
47-
.onTapGesture {
48-
onDelete(item.wrappedValue)
49-
isDirty = configuration != previousConfiguration
50-
}
51-
Text(item.wrappedValue.description())
52-
53-
Spacer()
54-
editBars
44+
Section(header: Text("Display up to 4 items")) {
45+
ForEach($configuration, id: \.self) { item in
46+
HStack {
47+
deleteButton
48+
.onTapGesture {
49+
onDelete(item.wrappedValue)
50+
isDirty = configuration != previousConfiguration
51+
}
52+
Text(item.wrappedValue.description())
53+
Spacer()
54+
editBars
55+
}
5556
}
57+
.onMove(perform: onReorder)
58+
.deleteDisabled(true)
5659
}
57-
.onMove(perform: onReorder)
58-
.deleteDisabled(true)
5960

6061
Section {
6162
Button(action: onSave) {
@@ -81,7 +82,7 @@ struct LiveActivityBottomRowManagerView: View {
8182
}
8283
.actionSheet(isPresented: $showAdd, content: { addItem })
8384
.insetGroupedListStyle()
84-
.navigationBarTitle(Text(NSLocalizedString("Bottom row", comment: "Live activity Bottom row configuration title")))
85+
.navigationBarTitle(Text(NSLocalizedString("Configure Display", comment: "")))
8586
}
8687

8788
@ViewBuilder

Loop/Views/LiveActivityManagementView.swift

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ struct LiveActivityManagementView: View {
2121
var body: some View {
2222
VStack {
2323
List {
24-
Section {
24+
Section(header: Text("Lock Screen / Dynamic Island / CarPlay")) {
2525
Toggle(NSLocalizedString("Enabled", comment: "Title for enable live activity toggle"), isOn: $viewModel.enabled)
2626
.onChange(of: viewModel.enabled) { _ in
2727
self.isDirty = previousViewModel.enabled != viewModel.enabled
2828
}
29-
29+
}
30+
31+
Section(header: Text("Select Lock Screen Display Options")){
3032
ExpandableSetting(
3133
isEditing: $viewModel.isEditingMode,
3234
leadingValueContent: {
@@ -48,50 +50,50 @@ struct LiveActivityManagementView: View {
4850
}
4951
}
5052

51-
Section {
52-
if viewModel.mode == .large {
53-
Toggle(NSLocalizedString("Add predictive line", comment: "Title for predictive line toggle"), isOn: $viewModel.addPredictiveLine)
54-
.transition(.move(edge: viewModel.mode == .large ? .top : .bottom))
55-
.onChange(of: viewModel.addPredictiveLine) { _ in
56-
self.isDirty = previousViewModel.addPredictiveLine != viewModel.addPredictiveLine
57-
}
58-
}
53+
Section(header: Text("Display Control Options")) {
54+
Toggle(NSLocalizedString("Display prediction in plot", comment: "Title for prediction line toggle"), isOn: $viewModel.addPredictiveLine)
55+
.transition(.move(edge: viewModel.mode == .large ? .top : .bottom))
56+
.onChange(of: viewModel.addPredictiveLine) { _ in
57+
self.isDirty = previousViewModel.addPredictiveLine != viewModel.addPredictiveLine
58+
}
5959

60-
Toggle(NSLocalizedString("Use BG coloring", comment: "Title for BG coloring"), isOn: $viewModel.useLimits)
60+
Toggle(NSLocalizedString("Display colors for glucose", comment: "Title for glucose coloring"), isOn: $viewModel.useLimits)
6161
.transition(.move(edge: viewModel.mode == .large ? .top : .bottom))
6262
.onChange(of: viewModel.useLimits) { _ in
6363
self.isDirty = previousViewModel.useLimits != viewModel.useLimits
6464
}
6565

66-
if self.displayGlucosePreference.unit == .millimolesPerLiter {
67-
TextInput(label: "Upper limit", value: $viewModel.upperLimitChartMmol)
68-
.transition(.move(edge: viewModel.useLimits ? .top : .bottom))
69-
.onChange(of: viewModel.upperLimitChartMmol) { _ in
70-
self.isDirty = previousViewModel.upperLimitChartMmol != viewModel.upperLimitChartMmol
71-
}
72-
TextInput(label: "Lower limit", value: $viewModel.lowerLimitChartMmol)
73-
.transition(.move(edge: viewModel.useLimits ? .top : .bottom))
74-
.onChange(of: viewModel.lowerLimitChartMmol) { _ in
75-
self.isDirty = previousViewModel.lowerLimitChartMmol != viewModel.lowerLimitChartMmol
76-
}
77-
} else {
78-
TextInput(label: "Upper limit", value: $viewModel.upperLimitChartMg)
79-
.transition(.move(edge: viewModel.useLimits ? .top : .bottom))
80-
.onChange(of: viewModel.upperLimitChartMg) { _ in
81-
self.isDirty = previousViewModel.upperLimitChartMg != viewModel.upperLimitChartMg
82-
}
83-
TextInput(label: "Lower limit", value: $viewModel.lowerLimitChartMg)
84-
.transition(.move(edge: viewModel.useLimits ? .top : .bottom))
85-
.onChange(of: viewModel.lowerLimitChartMg) { _ in
86-
self.isDirty = previousViewModel.lowerLimitChartMg != viewModel.lowerLimitChartMg
87-
}
66+
if self.viewModel.useLimits {
67+
if self.displayGlucosePreference.unit == .millimolesPerLiter {
68+
TextInput(label: "Upper limit", value: $viewModel.upperLimitChartMmol)
69+
.transition(.move(edge: viewModel.useLimits ? .top : .bottom))
70+
.onChange(of: viewModel.upperLimitChartMmol) { _ in
71+
self.isDirty = previousViewModel.upperLimitChartMmol != viewModel.upperLimitChartMmol
72+
}
73+
TextInput(label: "Lower limit", value: $viewModel.lowerLimitChartMmol)
74+
.transition(.move(edge: viewModel.useLimits ? .top : .bottom))
75+
.onChange(of: viewModel.lowerLimitChartMmol) { _ in
76+
self.isDirty = previousViewModel.lowerLimitChartMmol != viewModel.lowerLimitChartMmol
77+
}
78+
} else {
79+
TextInput(label: "Upper limit", value: $viewModel.upperLimitChartMg)
80+
.transition(.move(edge: viewModel.useLimits ? .top : .bottom))
81+
.onChange(of: viewModel.upperLimitChartMg) { _ in
82+
self.isDirty = previousViewModel.upperLimitChartMg != viewModel.upperLimitChartMg
83+
}
84+
TextInput(label: "Lower limit", value: $viewModel.lowerLimitChartMg)
85+
.transition(.move(edge: viewModel.useLimits ? .top : .bottom))
86+
.onChange(of: viewModel.lowerLimitChartMg) { _ in
87+
self.isDirty = previousViewModel.lowerLimitChartMg != viewModel.lowerLimitChartMg
88+
}
89+
}
8890
}
8991
}
9092

91-
Section {
93+
Section(header: Text("Configure Lock Screen / Carplay Row")) {
9294
NavigationLink(
9395
destination: LiveActivityBottomRowManagerView(),
94-
label: { Text(NSLocalizedString("Bottom row configuration", comment: "Title for Bottom row configuration")) }
96+
label: { Text(NSLocalizedString("Configure Display", comment: "")) }
9597
)
9698
}
9799
}

LoopCore/LiveActivitySettings.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ public enum LiveActivityMode: Codable, CustomStringConvertible {
7171
public func name() -> String {
7272
switch self {
7373
case .large:
74-
return NSLocalizedString("Large", comment: "")
74+
return NSLocalizedString("Plot and Row", comment: "")
7575
case .small:
76-
return NSLocalizedString("Small", comment: "")
76+
return NSLocalizedString("Row Only", comment: "")
7777
}
7878
}
7979
}

LoopCore/Localizable.xcstrings

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,16 +267,16 @@
267267
"comment" : "Name of a bottom row configuration option for IOB (Insulin On Board).",
268268
"isCommentAutoGenerated" : true
269269
},
270-
"Large" : {
271-
"comment" : "Name of the \"Large\" Live Activity mode.",
270+
"Plot and Row" : {
271+
"comment" : "Name of the live activity mode that shows both the plot and the row.",
272272
"isCommentAutoGenerated" : true
273273
},
274274
"Relative Basal Rate" : {
275275
"comment" : "Description of a bottom row configuration option for the basal rate.",
276276
"isCommentAutoGenerated" : true
277277
},
278-
"Small" : {
279-
"comment" : "Name of the \"Small\" Live Activity mode.",
278+
"Row Only" : {
279+
"comment" : "Name of the Live Activity Mode when it is set to .small.",
280280
"isCommentAutoGenerated" : true
281281
},
282282
"Temp Basal Only" : {

0 commit comments

Comments
 (0)