Hi Vladimir, I discovered the following problem with the complication of the background of the dial.
After choosing the complication of the background of the watch face, the background image replaces the main color (gradient), this works well, BUT if you turn off the complications of the background image, then there is no automatic change to the usual gradient. This will happen only after switching the dial to another and returning back, that is, reinitializing the settings.
I see the reason that the data storage is not updating
Maybe a problem in the following piece of code in WatchFace.kt
override fun onComplicationDataUpdate(watchFaceComplicationId: Int, complicationData: ComplicationData) {
super.onComplicationDataUpdate(watchFaceComplicationId, complicationData)
val data = complicationData.sanitize(this@WatchFace, dataStorage.getComplicationProviderName(watchFaceComplicationId))
if(watchFaceComplicationId == BACKGROUND_COMPLICATION_ID) {
if(data.largeImage != null) {
layouts.backgroundComplication.isVisible = true
layouts.backgroundComplication.setComplicationData(data)
} else {
layouts.backgroundComplication.isVisible = false
}
} else {
layouts.complications.setComplicationData(watchFaceComplicationId, data)
}
invalidate()
}
if before
layouts.backgroundComplication.isVisible = false
add code
layouts.backgroundComplication.setComplicationData (null)
Then the background change will occur correctly