本文整理汇总了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;
}
}
示例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;
}
}
示例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<>();
}
}
示例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);
}
}
示例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>>();
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
示例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<>();
}
}
示例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>();
}
}
示例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);
}
}