[AltWidget] Adds “icon” style lock screen widget

This commit is contained in:
Riley Testut
2022-09-14 19:04:36 -07:00
committed by Joseph Mattello
parent d7d0a83550
commit 699eda5d1b
4 changed files with 125 additions and 16 deletions

View File

@@ -189,9 +189,9 @@ struct HomeScreenWidget: Widget
}
}
struct LockScreenWidget: Widget
struct TextLockScreenWidget: Widget
{
private let kind: String = "LockAppDetail"
private let kind: String = "TextLockAppDetail"
public var body: some WidgetConfiguration {
if #available(iOSApplicationExtension 16, *)
@@ -199,10 +199,10 @@ struct LockScreenWidget: Widget
return IntentConfiguration(kind: kind,
intent: ViewAppIntent.self,
provider: Provider()) { (entry) in
ComplicationView(entry: entry)
ComplicationView(entry: entry, style: .text)
}
.supportedFamilies([.accessoryCircular])
.configurationDisplayName("AltWidget")
.configurationDisplayName("AltWidget (Text)")
.description("View remaining days until SideStore expires.")
}
else
@@ -212,11 +212,58 @@ struct LockScreenWidget: Widget
}
}
struct IconLockScreenWidget: Widget
{
private let kind: String = "IconLockAppDetail"
public var body: some WidgetConfiguration {
if #available(iOSApplicationExtension 16, *)
{
return IntentConfiguration(kind: kind,
intent: ViewAppIntent.self,
provider: Provider()) { (entry) in
ComplicationView(entry: entry, style: .icon)
}
.supportedFamilies([.accessoryCircular])
.configurationDisplayName("AltWidget (Icon)")
.description("View remaining days until SideStore expires.")
}
else
{
return EmptyWidgetConfiguration()
}
}
}
//
//struct LockScreenWidget: Widget
//{
// private let kind: String = "LockAppDetail"
//
// public var body: some WidgetConfiguration {
// if #available(iOSApplicationExtension 16, *)
// {
// return IntentConfiguration(kind: kind,
// intent: ViewAppIntent.self,
// provider: Provider()) { (entry) in
// ComplicationView(entry: entry, style: .icon)
// }
// .supportedFamilies([.accessoryCircular])
// .configurationDisplayName("AltWidget")
// .description("View remaining days until SideStore expires.")
// }
// else
// {
// return EmptyWidgetConfiguration()
// }
// }
//}
@main
struct AltWidgets: WidgetBundle
{
var body: some Widget {
HomeScreenWidget()
LockScreenWidget()
IconLockScreenWidget()
TextLockScreenWidget()
}
}