An icon appears using the Complications API, but when it comes to drawing an icon, I'm not sure how to do it.
When I draw the actual face for the clock, there seems to be no drawIcon method. For instance. something like canvas.drawIcon (icon). I can only see how to draw a bitmap.
In my drawComplications method, I have the following:
} else if (complicationData.getType() == ComplicationData.TYPE_ICON) {
Icon icon = complicationData.getIcon();
How can I then draw an icon on the canvas?
The code lab here does not tell us how to draw icons: https://codelabs.developers.google.com/codelabs/complications/index.html?index=..%2F..%2Findex#3
Instead, I could just copy all the drawings into a local wearable module and bypass the type of icon by passing a line, and from there just draw the corresponding bitmap. But there must be a way to extract from the icon otherwise, why is it?
I also could not learn from Googling how to convert the icon to a bitmap, but it also seems dumb, because I had to convert the bitmap to an icon, primarily because the API wants the icon.
Any help was appreciated.
Thank.
source
share