On the highest level, the Kotlin compiler’s compilation can be divided into two stages. Instead, Live Edit leverages Android Studio’s tight integration with the Kotlin compiler. Doing a typical incremental build or invoking an external compiler in a traditional sense would not achieve our performance requirement. Our goal was to create a system where there is less than 250ms latency between the last keystroke and the moment the recomposition happens on the device. Compilationįundamentally, Live Edit still relies on the Kotlin compiler to generate code for each incremental change. Listeners allow LE to detect the moment a developer makes a change in the Android Studio editor. This step is handled via the Intellij IDEA Program Structure Interface (PSI) tree. Edits the app classpath to ensure changes persist even if the app is restarted.Adds a hook in each class method bytecode to redirect calls to the new bytecode.Update code and resources in a non-Compose app without having to redeploy it to an emulator or physical device.Īt a high level, Live Edit does the following: Preview individual Compose elements in one or many different configurations and states, such as dark theme, locales, and font scale.ĭeploy code and resource updates to a running app without restarting it-and, in some cases, without restarting the current activity. Visualize Compose elements in the Design tab within Android Studio and see them automatically refresh as you make code changes. Quickly see the effect of updates to UX elements (such as modifier updates and animations) on the overall app experience while the application is running. Make changes to your Compose app’s UI and immediately see their effect on the running application on an emulator or physical device.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |