Skip to content

Commit

Permalink
Add X-Large watch complication (#1901)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredDRobbins committed Jan 22, 2023
1 parent 5d5339f commit 237fee8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion WatchApp Extension/ComplicationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,15 @@ final class ComplicationController: NSObject, CLKComplicationDataSource {
return nil
}
case .graphicExtraLarge:
return nil
if #available(watchOSApplicationExtension 5.0, *) {
return CLKComplicationTemplateGraphicExtraLargeCircularOpenGaugeSimpleText(
gaugeProvider: CLKSimpleGaugeProvider(style: .fill, gaugeColor: .tintColor, fillFraction: 1),
bottomTextProvider: glucoseText,
centerTextProvider: CLKSimpleTextProvider(text: "↘︎")
)
} else {
return nil
}
@unknown default:
return nil
}
Expand Down
10 changes: 9 additions & 1 deletion WatchApp Extension/Extensions/CLKComplicationTemplate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,15 @@ extension CLKComplicationTemplate {
return nil
}
case .graphicExtraLarge:
return nil
if #available(watchOSApplicationExtension 5.0, *) {
return CLKComplicationTemplateGraphicExtraLargeCircularOpenGaugeSimpleText(
gaugeProvider: CLKSimpleGaugeProvider(style: .fill, gaugeColor: tintColor, fillFraction: 1),
bottomTextProvider: CLKSimpleTextProvider(text: trendString),
centerTextProvider: CLKSimpleTextProvider(text: glucoseString)
)
} else {
return nil
}
@unknown default:
return nil
}
Expand Down
1 change: 1 addition & 0 deletions WatchApp Extension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<string>CLKComplicationFamilyGraphicBezel</string>
<string>CLKComplicationFamilyGraphicCircular</string>
<string>CLKComplicationFamilyGraphicCorner</string>
<string>CLKComplicationFamilyGraphicExtraLarge</string>
<string>CLKComplicationFamilyGraphicRectangular</string>
<string>CLKComplicationFamilyModularLarge</string>
<string>CLKComplicationFamilyModularSmall</string>
Expand Down

0 comments on commit 237fee8

Please sign in to comment.