use of org.jetbrains.android.dom.manifest.ActivityAlias in project android by JetBrains.
the class AndroidActivityAliasCompletionContributor method doCollectActivityAliases.
private static void doCollectActivityAliases(@NotNull AndroidFacet facet, @NotNull Set<String> result) {
final Manifest manifest = facet.getManifest();
if (manifest == null) {
return;
}
final String aPackage = manifest.getPackage().getStringValue();
final Application application = manifest.getApplication();
if (application == null) {
return;
}
for (ActivityAlias activityAlias : application.getActivityAliases()) {
String alias = activityAlias.getName().getStringValue();
if (alias != null && alias.length() > 0) {
if (!alias.startsWith(".")) {
if (alias.indexOf('.') > 0) {
result.add(alias);
}
alias = "." + alias;
}
if (aPackage != null && aPackage.length() > 0 && StringUtil.commonPrefixLength(aPackage, alias) == 0) {
result.add(aPackage + alias);
}
}
}
}
Aggregations