I'm sure I'm missing something obvious, but when I add a preview, the preview looks like it's a phon...
g
I'm sure I'm missing something obvious, but when I add a preview, the preview looks like it's a phone... how do you change to a watch screen shape and size?
1
s
Hi - support for different Wear device shapes was recently released in the Chipmunk canary, but you won't have seen it if you're still on Arctic Fox or Bumblebee versions - see https://developer.android.com/studio/preview. Alternatively, you can set properties on the @Preview annotation to customize (e.g. to set width and height) - a good example of that is in https://developer.android.com/codelabs/compose-for-wear-os#1, see the previews for ReusableComponents.
👍🏼 1
👍 4
g
Thanks Steve!
c
It seems we are still missing Wear devices for the Preview annotation in Chipmunk and likely are not going to have it until the next Studio release 😞
In the meantime, I’ve created a small utility which you may find useful in the interim: https://gist.github.com/c5inco/2210c3d00c49d100dc7348b06ad58ca1
Useful together with Interactive Preview, though be sure not to deploy the scaffold to the device 😅
👏🏽 1
❤️ 3
👏🏼 1
👏 3