ResourceInspector

简介:A debug tool to inspect the used layout files of current Activity.
更多:作者   提 Bug   
标签:

Apache 2.0 License Release

A debug tool to inspect used layout files of current Activity. This tool is helpful when you want to find out layout xml files used in current Activity from a large amount of resource files.

This tool depenends on the Stetho library. After you integrate this library to your project, you can open the Chrome's DevTools window (navigate to chrome://inspect for opening it) to inspect your current Activity.

Screenshot

You can click the Icon icon in the DevTools window to switch your Application to the search model. And then you can click on the widget you want to search in your Activity to quickly locate the corresponding element in the DevTools window.

(PS: To quickly expand all elements, just hold Opt and click on the arrow icon of root element.)

Getting started

In your build.gradle:

repositories {
    maven { url "https://jitpack.io" }
}
dependencies {
    debugCompile "com.github.nekocode.ResourceInspector:resinspector:${lastest-version}"
    releaseCompile "com.github.nekocode.ResourceInspector:resinspector-no-op:${lastest-version}"
    testCompile "com.github.nekocode.ResourceInspector:resinspector-no-op:${lastest-version}"

    compile "com.facebook.stetho:stetho:${stetho-lastest-version}"
}

In your Application class:

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ResourceInspector.initialize(this);
    }
}

In your (Base) Activity class:

public class BaseActivity extends Activity {
    @Override
    protected void attachBaseContext(Context newBase) {
        super.attachBaseContext(ResourceInspector.wrap(newBase));
    }
}
Android 开发经验分享
C 轮融资近 30 亿元理财推荐
Android 开发经验分享
C 轮融资近 30 亿元理财推荐