Since the AS upgrade to 4.x, does your LayoutInspector often look like me

It’s connected to a device, but you can’t detect the corresponding process?

Review speed is very slow, until the timeout no screen?

After checking Live Update, the screen is delayed to PPT, and finally give up Live Update?

Finally, I gave up the LayoutInspector and used the lighter Uinspector to help complete some basic UI checks.

What is Uinsepctor?

Uinspector is a UI review tool integrated into Android applications.

After you open the Uinspector, select the target you want to inspect by clicking on an element on the screen. You can View the layout and properties of the target View in the panel that pops up.

View the View’s size/margins/base properties Find the Activity/Fragment where the target is located and quickly locate the code where it is located

What’s the advantage over LayoutInspector?

1. Light and fast

Open the Inspector on your phone and click on the screen to see the target properties! Click close from the notification bar to stop the review, run out of walk.

2. Track the animation

Instead of slideshow level “Live Update”, Uinspector runs directly into your application and allows you to listen for views to change in real time, track layout/property changes, and even animations.

3. Support to add your custom View and custom attributes

Uinspector can integrate with other third-party libraries to view their unique properties:

View Glide’s picture source View Fresco’s image source View Lottie’s animation properties

When the picture resource loading is abnormal, you can click the picture address with the browser to open, quickly confirm the client loading problem or the picture resource itself!

Most of the custom View properties are too rich to be viewed directly using the LayoutInspector.

Using Uinspector and your own integration library, you can easily support these properties. Third-party integration library documentation.

Even if the style and content of the pop-up panel doesn’t meet your needs, you can add your own.

How do I use Uinsepctor?

Just add a sentence to your project’s build.gradle file:

dependencies {
    debugImplementation 'com. Huya. Mobile: Uinspector: 1.0.5'
}
Copy the code

That’s it! You don’t need to add any code if you don’t need custom development.

Optionally, some third-party integration libraries can be added as needed:

dependencies {
    debugImplementation 'com. Huya. Mobile: Uinspector - optional - glide: 1.0.5'
    debugImplementation 'com. Huya. Mobile: Uinspector - optional - fresco ": 1.0.5'
    debugImplementation 'com. Huya. Mobile: Uinspector - optional - Lottie: 1.0.5'
}
Copy the code

Note that:

Once you open the Uinspector, you can still perform gestures on the app, such as swiping or using the Back button to return to the screen. However, the click event is consumed as the action of the selected review target! In this mode, the onClickListener action can be triggered by a double click instead of a click.

Source code address: github.com/YvesCheung/…