[AltWidget] Adds “icon” style lock screen widget

This commit is contained in:
Riley Testut
2022-09-14 19:04:36 -07:00
parent ddcc7eee61
commit 6eeb0ca19f
4 changed files with 102 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,33 @@ 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 AltStore expires.")
}
else
{
return EmptyWidgetConfiguration()
}
}
}
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 AltStore expires.")
}
else
@@ -217,6 +240,7 @@ struct AltWidgets: WidgetBundle
{
var body: some Widget {
HomeScreenWidget()
LockScreenWidget()
IconLockScreenWidget()
TextLockScreenWidget()
}
}