Improve watch widget
This commit is contained in:
parent
ad94588b3c
commit
33d84b40db
@ -24,16 +24,31 @@ struct SimpleEntry: TimelineEntry {
|
||||
}
|
||||
|
||||
struct Sesame_WidgetEntryView : View {
|
||||
|
||||
@Environment(\.widgetRenderingMode)
|
||||
var widgetRenderingMode
|
||||
|
||||
@Environment(\.widgetFamily)
|
||||
var widgetFamily
|
||||
|
||||
var entry: Provider.Entry
|
||||
|
||||
var body: some View {
|
||||
switch widgetRenderingMode {
|
||||
default:
|
||||
image.unredacted()
|
||||
}
|
||||
}
|
||||
|
||||
private var image: some View {
|
||||
Image(systemSymbol: .lock)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.padding()
|
||||
.fontWeight(.thin)
|
||||
.widgetURL(URL(string: "sesame:///open")!)
|
||||
.containerBackground(.green, for: .widget)
|
||||
.widgetAccentable()
|
||||
}
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -58,6 +58,15 @@
|
||||
launchAutomaticallySubstyle = "2">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "E268E0802A85302000185913"
|
||||
BuildableName = "Sesame-WidgetExtension.appex"
|
||||
BlueprintName = "Sesame-WidgetExtension"
|
||||
ReferencedContainer = "container:Sesame.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "88E197AB29EDC9BC00BF1D19"
|
||||
@ -65,7 +74,7 @@
|
||||
BlueprintName = "Sesame-Watch Watch App"
|
||||
ReferencedContainer = "container:Sesame.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</MacroExpansion>
|
||||
<EnvironmentVariables>
|
||||
<EnvironmentVariable
|
||||
key = "_XCWidgetKind"
|
||||
|
Loading…
Reference in New Issue
Block a user