Reposting a promo for Tiles Previews in Android St...
# compose-wear
y
Reposting a promo for Tiles Previews in Android Studio - I realise not compose related 🙂 https://x.com/androidstudio/status/1806741878034890834
🙌 2
🎉 1
t
Thanks 30 minutes lost on Saturday 😛
y
Nice, on Monday, feel free to pass on any feedback or issues.
t
Unlike screenshot it worked instantly, just missing the doc part about resources but easy to find. The only "missing" part would be direct reusing of the API from Horologist
SuspendingTileService
but probably not easy and will already have forgotten Mondy 🙂 Enjoy the Weekend.
y
I think that's hard. Running real services in layoutlib is optimistic.
Splitting out your layout code to stateless functions is still a good enough for tiles.
t
I meant the functions you expose to generate the layout and the resources from the state. That is probably reusable to avoid recreating preview functions that will do the exact same thing.
👍 1
Copy code
@Preview(device = WearDevices.LARGE_ROUND)
@Preview(device = WearDevices.SMALL_ROUND)
fun SampleTilePreview(context: Context): TilePreviewData = tileRendererPreviewData(
    renderer = SampleTileRenderer(context),
    tileState = Unit,
    resourceState = Unit,
)
t
Thanks missed that one, the other file have all deprecated saying use the official API.