当前位置: 首页>>代码示例>>Java>>正文


Java Context.getPhase方法代码示例

本文整理汇总了Java中com.android.tools.lint.detector.api.Context.getPhase方法的典型用法代码示例。如果您正苦于以下问题:Java Context.getPhase方法的具体用法?Java Context.getPhase怎么用?Java Context.getPhase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.tools.lint.detector.api.Context的用法示例。


在下文中一共展示了Context.getPhase方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: afterCheckFile

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void afterCheckFile(@NonNull Context context) {
    if (context.getPhase() == 1) {
        // Store this layout's set of ids for full project analysis in afterCheckProject
        if (context.getProject().getReportIssues() && mNames != null && !mNames.isEmpty()) {
            mFileToNames.put(context.file, mNames);

            Element root = ((XmlContext) context).document.getDocumentElement();
            if (root != null) {
                String locale = root.getAttributeNS(TOOLS_URI, ATTR_LOCALE);
                if (locale != null && !locale.isEmpty()) {
                    if (mFileToLocale == null) {
                        mFileToLocale = Maps.newHashMap();
                    }
                    mFileToLocale.put(context.file, locale);
                }
                // Add in English here if not specified? Worry about false positives listing "en" explicitly
            }
        }

        mNames = null;
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:TranslationDetector.java

示例2: afterCheckFile

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void afterCheckFile(@NonNull Context context) {
    if (context.getPhase() == 1) {
        // Store this layout's set of ids for full project analysis in afterCheckProject
        mFileToIds.put(context.file, mIds);

        mIds = null;
    }
}
 
开发者ID:jessie345,项目名称:CustomLintRules,代码行数:10,代码来源:AutoPointIdInFileDetector.java

示例3: beforeCheckProject

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void beforeCheckProject(@NonNull Context context) {
    if (context.getPhase() == 1) {
        mFileToIds = new HashMap<>();
        mIncludes = new HashMap<>();
    }
}
 
开发者ID:jessie345,项目名称:CustomLintRules,代码行数:8,代码来源:AutoPointIdInFileDetector.java

示例4: afterCheckProject

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void afterCheckProject(@NonNull Context context) {
    // Process checks in two phases:
    // Phase 1: Gather styles and includes (styles are encountered after the layouts
    // so we can't do it in a single phase, and includes can be affected by includes from
    // layouts we haven't seen yet)
    // Phase 2: Process layouts, using gathered style and include data, and mark layouts
    // not known.
    //
    if (context.getPhase() == 1) {
        checkSizeSetInTheme();

        context.requestRepeat(this, Scope.RESOURCE_FILE_SCOPE);
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:RequiredAttributeDetector.java

示例5: beforeCheckProject

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void beforeCheckProject(@NonNull Context context) {
    if (context.getPhase() == 1) {
        mFileToIds = new HashMap<File, Set<String>>();
        mIncludes = new HashMap<File, List<String>>();
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:DuplicateIdDetector.java

示例6: afterCheckProject

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void afterCheckProject(@NonNull Context context) {
    int phase = context.getPhase();
    if (phase == 1 && mApplicableResources != null) {
        // We found resources for the string "Cancel"; perform a second pass
        // where we check layout text attributes against these strings.
        context.getDriver().requestRepeat(this, Scope.RESOURCE_FILE_SCOPE);
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ButtonDetector.java

示例7: beforeCheckFile

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void beforeCheckFile(@NonNull Context context) {
    if (context.getPhase() == 1) {
        mNames = new HashSet<String>();
    }

    // Convention seen in various projects
    mIgnoreFile = context.file.getName().startsWith("donottranslate") //$NON-NLS-1$
                    || UnusedResourceDetector.isAnalyticsFile(context);

    if (!context.getProject().getReportIssues()) {
        mIgnoreFile = true;
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:TranslationDetector.java

示例8: beforeCheckProject

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void beforeCheckProject(@NonNull Context context) {
    if (context.getPhase() == 1) {
        mDeclarations = new HashSet<String>(300);
        mReferences = new HashSet<String>(300);
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:UnusedResourceDetector.java

示例9: beforeCheckFile

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void beforeCheckFile(@NonNull Context context) {
    if (context.getPhase() == 1) {
        mIds = new HashSet<>();
    }
}
 
开发者ID:jessie345,项目名称:CustomLintRules,代码行数:7,代码来源:AutoPointIdInFileDetector.java

示例10: beforeCheckFile

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void beforeCheckFile(@NonNull Context context) {
    if (context.getPhase() == 1) {
        mIds = new HashSet<String>();
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:DuplicateIdDetector.java

示例11: beforeCheckProject

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void beforeCheckProject(@NonNull Context context) {
    if (context.getPhase() == 1) {
        mFileToArrayCount = ArrayListMultimap.create(30, 5);
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ArraySizeDetector.java


注:本文中的com.android.tools.lint.detector.api.Context.getPhase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。