-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds VPN Control Center widget and Siri Commands. (#3414)
Task/Issue URL: https://app.asana.com/0/1203108348835387/1208485618883319/f DRK PR: duckduckgo/DesignResourcesKit#9 ## Description Adds a VPN control widget for the control center and lock screen. Adds Siri commands to control the VPN with voice.
- Loading branch information
1 parent
b5dac56
commit 805a41e
Showing
62 changed files
with
1,978 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
DuckDuckGo/HomeMessage.xcassets/ControlCenterWidget/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...uckGo/HomeMessage.xcassets/ControlCenterWidget/ControlCenterBottom.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Frame 624697 1.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+989 KB
.../HomeMessage.xcassets/ControlCenterWidget/ControlCenterBottom.imageset/Frame 624697 1.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
...kGo/HomeMessage.xcassets/WidgetEducation/WidgetEducationHomeScreen.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "[email protected]", | ||
"filename" : "Frame 624697.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
|
Binary file added
BIN
+1.02 MB
.../HomeMessage.xcassets/WidgetEducation/WidgetEducationHomeScreen.imageset/Frame 624697.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
...omeMessage.xcassets/WidgetEducation/WidgetEducationHomeScreeniOS17.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// | ||
// SiriBubbleView.swift | ||
// DuckDuckGo | ||
// | ||
// Copyright © 2024 DuckDuckGo. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import DesignResourcesKit | ||
import SwiftUICore | ||
|
||
private struct SiriBubble: Shape { | ||
|
||
static let tipHeight: CGFloat = 7 | ||
|
||
func path(in rect: CGRect) -> Path { | ||
var path = Path() | ||
let cornerRadius: CGFloat = 21 | ||
let tipHeight: CGFloat = 7 | ||
let tipWidth: CGFloat = 9 | ||
|
||
// Rounded rectangle portion | ||
let roundedRect = CGRect( | ||
x: rect.minX, | ||
y: rect.minY, | ||
width: rect.width, | ||
height: rect.height - Self.tipHeight | ||
) | ||
path.addRoundedRect(in: roundedRect, cornerSize: CGSize(width: cornerRadius, height: cornerRadius)) | ||
|
||
// Triangle tip drawn out of bounds | ||
let tipStartX = rect.maxX - (cornerRadius + 2 * tipWidth) | ||
let tipBaseY = rect.maxY - Self.tipHeight | ||
|
||
path.move(to: CGPoint(x: tipStartX, y: tipBaseY)) // Bottom-right corner of rounded rectangle | ||
path.addLine(to: CGPoint(x: tipStartX + tipWidth, y: tipBaseY)) // Tip top-right | ||
path.addLine(to: CGPoint(x: tipStartX, y: tipBaseY + tipHeight)) // Tip bottom-right (out of bounds) | ||
path.closeSubpath() | ||
|
||
return path | ||
} | ||
} | ||
|
||
struct SiriBubbleView: View { | ||
|
||
let text: String | ||
|
||
init(_ text: String) { | ||
self.text = text | ||
} | ||
|
||
var body: some View { | ||
HStack(alignment: .center) { | ||
Text(text) | ||
.foregroundStyle(Color(designSystemColor: .textPrimary)) | ||
.multilineTextAlignment(.center) | ||
}.padding(12) | ||
.padding(.bottom, SiriBubble.tipHeight) | ||
.frame(maxWidth: .infinity) | ||
.background(SiriBubble() | ||
.fill(Color(designSystemColor: .surface)) | ||
.shadow(color: .black.opacity(0.08), radius: 8, x: 0, y: 8) | ||
.shadow(color: .black.opacity(0.1), radius: 3, x: 0, y: 2)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
DuckDuckGo/Siri/SiriEducation.xcassets/Images/Siri-Control-128.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Siri-Control-128.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+16 KB
DuckDuckGo/Siri/SiriEducation.xcassets/Images/Siri-Control-128.imageset/Siri-Control-128.pdf
Binary file not shown.
Oops, something went wrong.