The live layout feature in Android Studio allows you to directly preview your app's user interface without having to run your application in a device or simulator. Real-time layout is an extremely powerful tool that can help developers save a lot of time. With the help of real-time layouts, the task of viewing the application user interface becomes easy and fast.
To use the live layout, we need to double-click the corresponding XML layout file and select the "Text" tab below the workspace. Next, select the "Preview" tab on the right side of the workspace to preview the current layout. Any changes we make to the XML layout are reflected directly in the Preview window on the right. You can look at the following to get a deeper understanding of this feature.
The real-time layout feature gives us a number of notable advantages. For example, you can choose an option from the first menu in the preview panel to make adjustments to the XML layout you are currently using. For example, you can create different portrait and landscape views separately, and Android Studio will assume the task of creating the necessary folders and files.
The second menu in the preview panel allows you to change the size of the device displayed in the preview panel. The third menu function is to adjust the orientation of the device in the preview panel, so that we can more easily see the effects and themes of the same set of layouts in different display modes (portrait and Landscape).
The fourth menu in the preview panel allows us to easily access the individual fragments used by the activity or layout. The preview panel also allows you to change the language used in the live layout to easily preview the display of different languages in the layout scheme. The function of the rightmost menu is to adjust the API version.
The preview panel also contains a number of controls, such as zooming the layout, re-preview the panel, or intercepting the current screen.
Android Studio Learning---Real-time layouts (live layout)