Hey guys
I am using Android Studio Giraffe (Canary 11) and while working on some composables, I have observed that the compose preview generates/reloads on almost every keystroke that I feel can be a bit too much as it sort of leads to worse preview performance as it is trying to generate a new preview on every micro change.
What I want is to first write the code, and when I’m done making the changes, then I can press some keyboard shortcut like
Cmd + S
or something similar to refresh the preview. That way, it will only have to reload once that might be quicker as well.
Is there a way to achieve this?
s
Stylianos Gakis
04/09/2023, 4:49 PM
Yes there is exactly such a setting in your IDE. Search for live preview or something like that and it should pop up.
Stylianos Gakis
04/09/2023, 5:04 PM
Found it
s
Shubham Singh
04/10/2023, 2:01 AM
Thank you for the help Stylianos ⭐
But seems like
Live Edit
only works for Emulators or Physical Devices
What I am looking for, is to disable
Live Updates
i.e. to not update the Composable Previews that are shown in the split screen while coding.
c
Chris Sinco [G]
04/10/2023, 8:59 PM
There’s a setting exposed through the Preview status indicator that enables and disables refreshing the preview as you type
Chris Sinco [G]
04/10/2023, 9:00 PM
We’re working though on exposing a setting in Settings to more easily control, outside of the tooltip. Refreshing on Save can also be considered but at the moment, you can customize the keyboard shortcut for Build & Refresh if you’d like.