Search in sources :

Example 1 with AttributeDefinitionsImpl

use of org.jetbrains.android.dom.attrs.AttributeDefinitionsImpl in project android by JetBrains.

the class AndroidTargetData method getLayoutLibrary.

@Nullable
public synchronized LayoutLibrary getLayoutLibrary(@NotNull Project project) throws RenderingException, IOException {
    if (myLayoutLibrary == null) {
        if (myTarget instanceof CompatibilityRenderTarget) {
            IAndroidTarget target = ((CompatibilityRenderTarget) myTarget).getRenderTarget();
            AndroidTargetData targetData = mySdkData.getTargetData(target);
            if (targetData != this) {
                myLayoutLibrary = targetData.getLayoutLibrary(project);
                return myLayoutLibrary;
            }
        }
        final AttributeDefinitionsImpl attrDefs = getAllAttrDefs(project);
        if (attrDefs == null) {
            return null;
        }
        myLayoutLibrary = LayoutLibraryLoader.load(myTarget, attrDefs.getEnumMap());
    }
    return myLayoutLibrary;
}
Also used : CompatibilityRenderTarget(com.android.tools.idea.rendering.multi.CompatibilityRenderTarget) AttributeDefinitionsImpl(org.jetbrains.android.dom.attrs.AttributeDefinitionsImpl) IAndroidTarget(com.android.sdklib.IAndroidTarget) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

IAndroidTarget (com.android.sdklib.IAndroidTarget)1 CompatibilityRenderTarget (com.android.tools.idea.rendering.multi.CompatibilityRenderTarget)1 AttributeDefinitionsImpl (org.jetbrains.android.dom.attrs.AttributeDefinitionsImpl)1 Nullable (org.jetbrains.annotations.Nullable)1