Renderer.SharedAssets


Note: As of July 10, 2024, watch faces must use the Watch Face Format in order to be installed on new watches that launch with Wear OS 5 pre-installed. Learn more about the user-facing changes in this Help Center article.

Additionally, starting in early 2025 (specific date to be announced during Q4 2024), all new watch faces published on Google Play must use the Watch Face Format.

interface Renderer.SharedAssets


Multiple WatchFaceService instances and hence Renderers can exist concurrently (e.g. a headless instance and an interactive instance) and using SharedAssets allows memory to be saved by sharing immutable data (e.g. Bitmaps and shaders) between them.

Note SharedAssets will be constructed on a background thread, but (typically) used and released on the ui thread.

Summary

Public functions

Unit

Notification that any resources owned by SharedAssets should be released, called when no renderer instances are left.

Public functions

onDestroy

Added in 1.1.0
@UiThread
fun onDestroy(): Unit

Notification that any resources owned by SharedAssets should be released, called when no renderer instances are left.