1

I had a look at the new way of creating watchfaces for Wear OS. https://github.com/android/wear-os-samples/tree/main/WatchFaceKotlin

In my case I do not know beforehand how many complications a watch face will have, in the documentation here it says that dynamic creation of complications is not possible. But you should be able to disable and enable complications with ComplicationSlotsUserStyleSetting.

There is hardly any understandable documentation about this. How would that work?

I tried by setting a userStyle, but it does not seem to influence the .enabled property of a Complication in the ComplicationSlotManager.

Any help would be appreciated!

Pujie
  • 51
  • 1
  • Sorry, not an expert on watchfaces, but I think the sample here shows using that option. https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:wear/watchface/watchface/samples/src/main/java/androidx/wear/watchface/samples/ExampleCanvasAnalogWatchFaceService.kt;l=184 – Yuri Schimke Apr 12 '22 at 06:31
  • Ah thanks, that does help. What is not clear to me though is if it is possible to enable/disable a ComplicationOverlay dynamically. In this example this parameter (.enabled) is set when the userStyleScheme is created. But I want to enable/disable complications dynamically based on the watch face which is currently used (note that my app is a watch face designer, so it is not known beforehand what it will look like). I can create my own enabled/disabled property, but that would mean that I have many (70 or so) ComplicationSlots active at the same time which might influence battery life? Thanks – Pujie Apr 13 '22 at 08:30

0 Answers0