LayoutInspectorV2-Pro is an Android Studio/Intellij plugin that allows Android developers to dump the view hierarchy. It is similar to the Legacy-Layout-LayoutInspector in some ways.
For convenience, LegacyLayoutInspector is abbreviated as LLI.
Preferences(Settings) > Plugins > Marketplace > Search and find "LayoutInspectorV2-Pro" > Install Plugin
Restart the IDE after installation.
You can find the plugin in the Tools menu.After the dump, LayoutInspectorV2-Pro generates a file with the
.liv2 extension, just like the
Why Use LayoutInspectorV2-Pro?
The Google Android team removed the Legacy-LayoutInspector from Android Studio Bumblebee. If you are a fan of LLI, this plugin will be useful for you. Based on LLI, LayoutInspectorV2-Pro has made some improvements, including:
- Faster dump speed
- Easier selection of the view you want
The following section explains these improvements in detail.
LLI provides two ProtocolVersions:
ProtocolVersions.V2. According to the source code, this feature was added in 2015.
LLI uses the V1 version by default to dump, but the V1 version is very slow. You may have seen a pop-up window warning of timeout.
Unfortunately, only internal Google engineers can use the V2 version. Therefore, LayoutInspectorV2-Pro uses the V2 version by default. I tested the dump speed of these two versions on my OnePlus 7 device with various numbers of views, and here are the results:
|3000 views||4000 views||5000 views|
Many Android developers who use LLI may be confused by its default selection algorithm, which prioritizes the topmost view. However, in most cases, the sizes of areas should carry more weight when selecting a view.
Consider the following scenario: there are two views, A and B, and B is on top of A. If you click the A area in the image panel, LLI may not select A because B is larger and covers A.
With LayoutInspectorV2-Pro, the sizes of areas between A and B are compared, and A is selected because it is smaller than B. This approach ensures that the most appropriate view is selected.
LayoutInspectorV2-Pro should work with most Android Studio versions. The following Android Studio versions have been tested:
|Chipmunk 2021.2.1 Patch 2||212.5712.43.2112.8815526|
|Electric Eel 2022.1.1 Patch 1||221.6008.13.2211.9514443|
|Flamingo 2022.2.1 Canary 10||222.4459.24.2221.9409768|
|Giraffe 2022.3.1 Canary 8||223.8617.56.2231.9687552|
If you encounter any issues in any version, please report them.
If you encounter any issues while using LayoutInspectorV2-Pro, please report them by creating an issue in the project's issue tracker. To create an issue, please follow these steps:
- Go to the issue tracker.
- Click on the "New Issue" button.
- Fill out the form with as much detail as possible.
- Click on the "Submit new issue" button.
If you would like to contribute to this project, please follow these steps:
- Fork the project.
- Create a new branch.
- Make your changes.
- Submit a pull request.
Show Your Support
If you find this project helpful, please consider giving it a star. Your support is greatly appreciated!
This project is licensed under the Apache License 2.0. See the
LICENSE file for more information.