Skip to content

Commit ab9f89f

Browse files
authored
[LOOP-4721] UI Updates for Loop Alert Management
2 parents 1c88b00 + 29471dc commit ab9f89f

File tree

7 files changed

+349
-109
lines changed

7 files changed

+349
-109
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Group 3403.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Group 3405.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.

Loop/Views/AlertManagementView.swift

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,75 @@ struct AlertManagementView: View {
7272
}
7373
.navigationTitle(NSLocalizedString("Alert Management", comment: "Title of alert management screen"))
7474
}
75+
76+
private var footerView: some View {
77+
VStack(alignment: .leading, spacing: 24) {
78+
HStack(alignment: .top, spacing: 8) {
79+
Image("phone")
80+
.resizable()
81+
.aspectRatio(contentMode: .fit)
82+
.frame(maxWidth: 64, maxHeight: 64)
83+
84+
VStack(alignment: .leading, spacing: 4) {
85+
Text(
86+
String(
87+
format: NSLocalizedString(
88+
"%1$@ APP SOUNDS",
89+
comment: "App sounds title text (1: app name)"
90+
),
91+
appName.uppercased()
92+
)
93+
)
94+
95+
Text(
96+
String(
97+
format: NSLocalizedString(
98+
"While mute alerts is on, all alerts from your %1$@ app including Critical and Time Sensitive alerts will temporarily display without sounds and will vibrate only.",
99+
comment: "App sounds descriptive text (1: app name)"
100+
),
101+
appName
102+
)
103+
)
104+
}
105+
}
106+
107+
HStack(alignment: .top, spacing: 8) {
108+
Image("hardware")
109+
.resizable()
110+
.aspectRatio(contentMode: .fit)
111+
.frame(maxWidth: 64, maxHeight: 64)
112+
113+
VStack(alignment: .leading, spacing: 4) {
114+
Text("HARDWARE SOUNDS")
115+
116+
Text("While mute alerts is on, your insulin pump and CGM hardware may still sound.")
117+
}
118+
}
119+
120+
HStack(alignment: .top, spacing: 8) {
121+
Image(systemName: "moon.fill")
122+
.resizable()
123+
.aspectRatio(contentMode: .fit)
124+
.frame(maxWidth: 64, maxHeight: 48)
125+
.foregroundColor(.accentColor)
126+
127+
VStack(alignment: .leading, spacing: 4) {
128+
Text("IOS FOCUS MODES")
129+
130+
Text(
131+
String(
132+
format: NSLocalizedString(
133+
"If iOS Focus Mode is ON and Mute Alerts is OFF, Critical Alerts will still be delivered and non-Critical Alerts will be silenced until %1$@ is added to each Focus mode as an Allowed App.",
134+
comment: "Focus modes descriptive text (1: app name)"
135+
),
136+
appName
137+
)
138+
)
139+
}
140+
}
141+
}
142+
.padding(.top)
143+
}
75144

76145
private var alertPermissionsSection: some View {
77146
Section(footer: DescriptiveText(label: String(format: NSLocalizedString("Notifications give you important %1$@ app information without requiring you to open the app.", comment: "Alert Permissions descriptive text (1: app name)"), appName))) {
@@ -93,7 +162,7 @@ struct AlertManagementView: View {
93162

94163
@ViewBuilder
95164
private var muteAlertsSection: some View {
96-
Section(footer: DescriptiveText(label: String(format: NSLocalizedString("When muted, %1$@ alerts will temporarily display without sounds and will vibrate only. Once the mute period ends, your alerts will resume as normal.", comment: "Description of temporary mute alerts (1: app name)"), appName))) {
165+
Section(footer: footerView) {
97166
if !alertMuter.configuration.shouldMute {
98167
howMuteAlertsWork
99168
Button(action: { showMuteAlertOptions = true }) {
@@ -142,7 +211,7 @@ struct AlertManagementView: View {
142211
private var howMuteAlertsWork: some View {
143212
Button(action: { showHowMuteAlertWork = true }) {
144213
HStack {
145-
Text(NSLocalizedString("Take a closer look at how mute alerts works", comment: "Label for link to learn how mute alerts work"))
214+
Text(NSLocalizedString("Frequently asked questions about alerts", comment: "Label for link to see frequently asked questions"))
146215
.font(.footnote)
147216
.foregroundColor(.secondary)
148217
Spacer()

Loop/Views/HowMuteAlertWorkView.swift

Lines changed: 106 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,52 +17,109 @@ struct HowMuteAlertWorkView: View {
1717
var body: some View {
1818
NavigationView {
1919
List {
20-
VStack(alignment: .leading) {
21-
Text(NSLocalizedString("""
22-
Mute Alerts allows you to temporarily silence your alerts and alarms.
23-
24-
When using Mute Alerts, also consider the impact of using iOS Focus Modes.
25-
""", comment: "Description of how mute alerts work"))
26-
.fixedSize(horizontal: false, vertical: true)
20+
VStack(alignment: .leading, spacing: 24) {
21+
VStack(alignment: .leading, spacing: 8) {
22+
Text("What are examples of Critical and Time Sensitive alerts?")
23+
.bold()
24+
25+
Text("iOS Critical Alerts and Time Sensitive Alerts are types of Apple notifications. They are used for high-priority events. Some examples include:")
26+
}
2727

28-
VStack(alignment: .leading, spacing: 10) {
29-
HStack(spacing: 10) {
30-
Image(systemName: "speaker.slash.fill")
31-
.foregroundColor(.white)
32-
.padding(5)
33-
.background(guidanceColors.warning)
34-
.clipShape(RoundedRectangle(cornerRadius: 5, style: .continuous))
28+
HStack {
29+
VStack(alignment: .leading, spacing: 16) {
30+
VStack(alignment: .leading, spacing: 4) {
31+
Text("Critical Alerts")
32+
.bold()
33+
34+
Text("Urgent Low")
35+
.bulleted()
36+
Text("Sensor Failed")
37+
.bulleted()
38+
Text("Reservoir Empty")
39+
.bulleted()
40+
Text("Pump Expired")
41+
.bulleted()
42+
}
3543

36-
Text(String(format: NSLocalizedString("%1$@ Mute Alerts", comment: "Format string for Section title for description that mute alerts is temporary (1: app name)"), appName))
37-
.bold()
38-
.fixedSize(horizontal: false, vertical: true)
44+
VStack(alignment: .leading, spacing: 4) {
45+
Text("Time Sensitive Alerts")
46+
.bold()
47+
48+
Text("High Glucose")
49+
.bulleted()
50+
Text("Transmitter Low Battery")
51+
.bulleted()
52+
}
3953
}
4054

41-
Text(NSLocalizedString("""
42-
All Tidepool Loop alerts, including Critical Alerts, will be silenced for up to 4 hours.
43-
44-
After the mute period ends, your alert sounds will resume.
45-
""", comment: "Description that mute alerts is temporary"))
46-
.fixedSize(horizontal: false, vertical: true)
47-
.padding(.bottom)
48-
49-
HStack(spacing: 10) {
50-
Image(systemName: "moon.fill")
51-
.foregroundColor(.accentColor)
52-
53-
Text(NSLocalizedString("iOS Focus Mode", comment: "Section title for description of how mute alerts work with focus mode"))
54-
.bold()
55-
}
56-
Text(String(format: NSLocalizedString("If iOS Focus Mode is ON and Mute Alerts is OFF, Critical Alerts will still be delivered, but non-Critical Alerts will be silenced until %1$@ is added to each Focus mode as an Allowed App.", comment: "Format string for description of how mute alerts works with focus mode (1: app name)"), appName))
57-
.fixedSize(horizontal: false, vertical: true)
55+
Spacer()
5856
}
57+
.font(.footnote)
58+
.foregroundColor(.black.opacity(0.6))
5959
.padding()
60-
.overlay(RoundedRectangle(cornerRadius: 10, style: .continuous).stroke(Color(.systemFill), lineWidth: 1))
60+
.overlay(
61+
RoundedRectangle(cornerRadius: 10, style: .continuous)
62+
.stroke(Color(.systemFill), lineWidth: 1)
63+
)
6164
.clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous))
65+
66+
VStack(alignment: .leading, spacing: 8) {
67+
Text(
68+
String(
69+
format: NSLocalizedString(
70+
"How can I temporarily silence all %1$@ app sounds?",
71+
comment: "Title text for temporarily silencing all sounds (1: app name)"
72+
),
73+
appName
74+
)
75+
)
76+
.bold()
77+
78+
Text(
79+
String(
80+
format: NSLocalizedString(
81+
"Use the Mute Alerts feature. It allows you to temporarily silence all of your alerts and alarms via the %1$@ app, including Critical Alerts and Time Sensitive Alerts.",
82+
comment: "Description text for temporarily silencing all sounds (1: app name)"
83+
),
84+
appName
85+
)
86+
)
87+
}
88+
89+
VStack(alignment: .leading, spacing: 8) {
90+
Text("How can I silence non-Critical Alerts?")
91+
.bold()
92+
93+
Text(
94+
String(
95+
format: NSLocalizedString(
96+
"Turn off the volume on your iOS device or add %1$@ as an allowed app to each Focus Mode. Time Sensitive and Critical Alerts will still sound, but non-Critical Alerts will be silenced.",
97+
comment: "Description text for temporarily silencing non-critical alerts (1: app name)"
98+
),
99+
appName
100+
)
101+
)
102+
}
103+
104+
VStack(alignment: .leading, spacing: 8) {
105+
Text("How can I silence only Time Sensitive and Non-Critical alerts?")
106+
.bold()
107+
108+
Text(
109+
String(
110+
format: NSLocalizedString(
111+
"For safety purposes, you should allow Critical Alerts, Time Sensitive and Notification Permissions (non-critical alerts) on your device to continue using %1$@ and cannot turn off individual alarms.",
112+
comment: "Description text for silencing time sensitive and non-critical alerts (1: app name)"
113+
),
114+
appName
115+
)
116+
)
117+
}
62118
}
119+
.padding(.vertical, 8)
63120
}
64121
.insetGroupedListStyle()
65-
.navigationTitle(NSLocalizedString("Using Mute Alerts", comment: "View title for how mute alerts work"))
122+
.navigationTitle(NSLocalizedString("Managing Alerts", comment: "View title for how mute alerts work"))
66123
.navigationBarItems(trailing: closeButton)
67124
}
68125
}
@@ -74,6 +131,19 @@ After the mute period ends, your alert sounds will resume.
74131
}
75132
}
76133

134+
private extension Text {
135+
func bulleted(color: Color = .accentColor.opacity(0.5)) -> some View {
136+
HStack(spacing: 16) {
137+
Image(systemName: "circle.fill")
138+
.resizable()
139+
.frame(width: 8, height: 8)
140+
.foregroundColor(color)
141+
142+
self
143+
}
144+
}
145+
}
146+
77147
struct HowMuteAlertWorkView_Previews: PreviewProvider {
78148
static var previews: some View {
79149
HowMuteAlertWorkView()

0 commit comments

Comments
 (0)