Files
honeyDueKMP/iosApp/Casera/CaseraLiveActivity.swift
Trey t c6eef720ed Rebrand from MyCrib to Casera
- Rename Kotlin package from com.example.mycrib to com.example.casera
- Update Android app name, namespace, and application ID
- Update iOS bundle identifiers and project settings
- Rename iOS directories (MyCribTests -> CaseraTests, etc.)
- Update deep link schemes from mycrib:// to casera://
- Update app group identifiers
- Update subscription product IDs
- Update all UI strings and branding

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:10:38 -06:00

81 lines
2.3 KiB
Swift

//
// CaseraLiveActivity.swift
// Casera
//
// Created by Trey Tartt on 11/5/25.
//
import ActivityKit
import WidgetKit
import SwiftUI
struct CaseraAttributes: 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 CaseraLiveActivity: Widget {
var body: some WidgetConfiguration {
ActivityConfiguration(for: CaseraAttributes.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 CaseraAttributes {
fileprivate static var preview: CaseraAttributes {
CaseraAttributes(name: "World")
}
}
extension CaseraAttributes.ContentState {
fileprivate static var smiley: CaseraAttributes.ContentState {
CaseraAttributes.ContentState(emoji: "😀")
}
fileprivate static var starEyes: CaseraAttributes.ContentState {
CaseraAttributes.ContentState(emoji: "🤩")
}
}
#Preview("Notification", as: .content, using: CaseraAttributes.preview) {
CaseraLiveActivity()
} contentStates: {
CaseraAttributes.ContentState.smiley
CaseraAttributes.ContentState.starEyes
}