Search in sources :

Example 1 with AndroidResourceType

use of org.jetbrains.android.dom.AndroidResourceType in project android by JetBrains.

the class ResourceReferenceConverter method getResourceTypes.

@NotNull
public Set<ResourceType> getResourceTypes(@NotNull DomElement element) {
    AndroidResourceType resourceType = element.getAnnotation(AndroidResourceType.class);
    Set<ResourceType> types = EnumSet.copyOf(myResourceTypes);
    if (resourceType != null) {
        String s = resourceType.value();
        if (s != null) {
            ResourceType t = ResourceType.getEnum(s);
            if (t != null) {
                types.add(t);
            }
        }
    }
    if (types.size() == 0) {
        return VALUE_RESOURCE_TYPES;
    } else if (types.contains(ResourceType.DRAWABLE)) {
        types.add(ResourceType.COLOR);
    }
    return types;
}
Also used : AndroidResourceType(org.jetbrains.android.dom.AndroidResourceType) ResourceType(com.android.resources.ResourceType) AndroidResourceType(org.jetbrains.android.dom.AndroidResourceType) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ResourceType (com.android.resources.ResourceType)1 AndroidResourceType (org.jetbrains.android.dom.AndroidResourceType)1 NotNull (org.jetbrains.annotations.NotNull)1