com.android.tools.lint.detector.api.ResourceXmlDetector Java Examples

The following examples show how to use com.android.tools.lint.detector.api.ResourceXmlDetector. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LintDriver.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
private void checkResFolder(
        @NonNull Project project,
        @Nullable Project main,
        @NonNull File res,
        @NonNull List<ResourceXmlDetector> xmlChecks,
        @Nullable List<Detector> dirChecks,
        @Nullable List<Detector> binaryChecks) {
    File[] resourceDirs = res.listFiles();
    if (resourceDirs == null) {
        return;
    }

    // Sort alphabetically such that we can process related folder types at the
    // same time, and to have a defined behavior such that detectors can rely on
    // predictable ordering, e.g. layouts are seen before menus are seen before
    // values, etc (l < m < v).

    Arrays.sort(resourceDirs);
    for (File dir : resourceDirs) {
        ResourceFolderType type = ResourceFolderType.getFolderType(dir.getName());
        if (type != null) {
            checkResourceFolder(project, main, dir, type, xmlChecks, dirChecks, binaryChecks);
        }

        if (mCanceled) {
            return;
        }
    }
}