You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LeCountdown/LaunchWidget/DefaultView.swift

45 lines
1.1 KiB

//
// DefaultView.swift
// LeCountdown
//
// Created by Laurent Morvillier on 17/02/2023.
//
import SwiftUI
import WidgetKit
struct DefaultView: View {
@Environment(\.widgetFamily) var family: WidgetFamily
var body: some View {
Group {
switch family {
case .accessoryCorner, .accessoryCircular, .accessoryRectangular, .accessoryInline:
VStack {
Text("Configure me!").monospaced()
}
default:
VStack {
Text("Configure me!\n")
Text("Tea".uppercased()).monospaced()
Text("4:00").monospaced()
}
// .frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(.black.opacity(0.5))
.foregroundColor(.white)
// .background(Color.white.opacity(0.5))
}
}
struct DefaultView_Previews: PreviewProvider {
static var previews: some View {
DefaultView().previewContext(WidgetPreviewContext(family: .systemSmall))
}
}