first commit

This commit is contained in:
fototeddy
2026-09-04 21:30:51 +02:00
commit da64b1b6bd
160 changed files with 20664 additions and 0 deletions
@@ -0,0 +1,80 @@
//
// VanAligneiOSWidgetLiveActivity.swift
// VanAligneiOSWidget
//
// Created by Christopher Helberg on 02.09.26.
//
import ActivityKit
import WidgetKit
import SwiftUI
struct VanAligneiOSWidgetAttributes: ActivityAttributes {
public struct ContentState: Codable, Hashable {
// Dynamic stateful properties about your activity go here!
var emoji: String
}
// Fixed non-changing properties about your activity go here!
var name: String
}
struct VanAligneiOSWidgetLiveActivity: Widget {
var body: some WidgetConfiguration {
ActivityConfiguration(for: VanAligneiOSWidgetAttributes.self) { context in
// Lock screen/banner UI goes here
VStack {
Text("Hello \(context.state.emoji)")
}
.activityBackgroundTint(Color.cyan)
.activitySystemActionForegroundColor(Color.black)
} dynamicIsland: { context in
DynamicIsland {
// Expanded UI goes here. Compose the expanded UI through
// various regions, like leading/trailing/center/bottom
DynamicIslandExpandedRegion(.leading) {
Text("Leading")
}
DynamicIslandExpandedRegion(.trailing) {
Text("Trailing")
}
DynamicIslandExpandedRegion(.bottom) {
Text("Bottom \(context.state.emoji)")
// more content
}
} compactLeading: {
Text("L")
} compactTrailing: {
Text("T \(context.state.emoji)")
} minimal: {
Text(context.state.emoji)
}
.widgetURL(URL(string: "http://www.apple.com"))
.keylineTint(Color.red)
}
}
}
extension VanAligneiOSWidgetAttributes {
fileprivate static var preview: VanAligneiOSWidgetAttributes {
VanAligneiOSWidgetAttributes(name: "World")
}
}
extension VanAligneiOSWidgetAttributes.ContentState {
fileprivate static var smiley: VanAligneiOSWidgetAttributes.ContentState {
VanAligneiOSWidgetAttributes.ContentState(emoji: "😀")
}
fileprivate static var starEyes: VanAligneiOSWidgetAttributes.ContentState {
VanAligneiOSWidgetAttributes.ContentState(emoji: "🤩")
}
}
#Preview("Notification", as: .content, using: VanAligneiOSWidgetAttributes.preview) {
VanAligneiOSWidgetLiveActivity()
} contentStates: {
VanAligneiOSWidgetAttributes.ContentState.smiley
VanAligneiOSWidgetAttributes.ContentState.starEyes
}