Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a background image to WatchFaceKotlin sample #210

Open
behrooz55 opened this issue Feb 8, 2022 · 0 comments
Open

Adding a background image to WatchFaceKotlin sample #210

behrooz55 opened this issue Feb 8, 2022 · 0 comments

Comments

@behrooz55
Copy link

Hi, since the render() function inside AnalogWatchCanvasRenderer gets called every second, where and how are we supposed to load and scale an image resource in advance, to use it here (for example, as a background)? in the older version of watch face mechanics (the CanvasWatchFaceService) we do this by overriding the onCreate() inside Engine(). However, I checked the source code of this new implementation (the WatchFaceService), the onCreateEngine() function is already final and the onCreate() is already overridden. So, I couldn't figure out how we are supposed to do this. Also, it seems we have same dilemma with onSurfaceChanged() and other useful functions in older mechanics. I checked all of currently available documents on Android website including following links and didn't find a clue. Did I overlook something?

https://android-developers.googleblog.com/2021/12/develop-watch-faces-with-stable-jetpack.html
https://developer.android.com/reference/kotlin/androidx/wear/watchface/WatchFaceService
https://developer.android.com/training/wearables/watch-faces/service
https://developer.android.com/reference/androidx/wear/watchface/package-summary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants