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


Java Context.getProject方法代码示例

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


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

示例1: afterCheckProject

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void afterCheckProject(@NonNull Context context) {

    // if it's not a library, it's an application
    if (context.getProject() == context.getMainProject() && !context.getMainProject().isLibrary() && mApplicationTagLocation != null) {

        if (!mHasActivity) {
            context.report(ISSUE_MISSING_LAUNCHER, mApplicationTagLocation,
                    "Expecting " + ANDROID_MANIFEST_XML + " to have an <" + TAG_ACTIVITY + "> tag.");
        } else if (!mHasLauncherActivity) {
            context.report(ISSUE_MISSING_LAUNCHER, mApplicationTagLocation,
                    "Expecting " + ANDROID_MANIFEST_XML + " to have an activity with a launcher intent.");
        }

    }
}
 
开发者ID:inaka,项目名称:lewis,代码行数:17,代码来源:LauncherActivityDetector.java

示例2: getRequiredDensityFolders

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
private List<String> getRequiredDensityFolders(@NonNull Context context) {
    if (mCachedRequiredDensities == null
            || context.getProject() != mCachedDensitiesForProject) {
        mCachedDensitiesForProject = context.getProject();
        mCachedRequiredDensities = Lists.newArrayListWithExpectedSize(10);

        List<String> applicableDensities = context.getProject().getApplicableDensities();
        if (applicableDensities != null) {
            mCachedRequiredDensities.addAll(applicableDensities);
        } else {
            if (INCLUDE_LDPI) {
                mCachedRequiredDensities.add(DRAWABLE_LDPI);
            }
            mCachedRequiredDensities.add(DRAWABLE_MDPI);
            mCachedRequiredDensities.add(DRAWABLE_HDPI);
            mCachedRequiredDensities.add(DRAWABLE_XHDPI);
            mCachedRequiredDensities.add(DRAWABLE_XXHDPI);
            mCachedRequiredDensities.add(DRAWABLE_XXXHDPI);
        }
    }

    return mCachedRequiredDensities;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:IconDetector.java

示例3: afterCheckProject

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void afterCheckProject(@NonNull Context context) {

    // if it's a library
    if (context.getProject() == context.getMainProject() && context.getMainProject().isLibrary()) {
        for (int i = 0; i < mIconAttributesLocations.size(); i++) {
            context.report(ISSUE_ICON_IN_LIBRARY, mIconAttributesLocations.get(i),
                    "Expecting " + ANDROID_MANIFEST_XML + " not to have an icon inside <" + TAG_APPLICATION + "> tag");
        }
    }
}
 
开发者ID:inaka,项目名称:lewis,代码行数:12,代码来源:IconInLibraryDetector.java

示例4: afterCheckProject

import com.android.tools.lint.detector.api.Context; //导入方法依赖的package包/类
@Override
public void afterCheckProject(@NonNull Context context) {

    // if it is a library
    if (context.getProject() == context.getMainProject() && context.getMainProject().isLibrary()) {
        for (Location location : mPermissionTagsLocations) {
            context.report(ISSUE_PERMISSION_USAGE_IN_LIBRARY, location,
                    "Expecting " + ANDROID_MANIFEST_XML + " not to have a <" + TAG_USES_PERMISSION + "> tag invocation");
        }
    }
}
 
开发者ID:inaka,项目名称:lewis,代码行数:12,代码来源:PermissionsInLibraryDetector.java


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