@Override public void visitAttribute(Context context, Attr attribute) { String uri = attribute.getNamespaceURI(); if (uri == null || uri.length() == 0) { String name = attribute.getName(); if (name == null) { return; } if (NO_PREFIX_ATTRS.contains(name)) { return; } Element element = attribute.getOwnerElement(); if (isCustomView(element)) { return; } if (name.startsWith(XMLNS_PREFIX)) { return; } context.client.report(context, MISSING_NAMESPACE, context.getLocation(attribute), "Attribute is missing the Android namespace prefix", null); } }
return; if (isNoPrefixAttribute(name)) { return; if (isCustomView(element) && context.getResourceFolderType() != null) { return; } else if (context.getResourceFolderType() == LAYOUT) { && !TOOLS_URI.equals(uri) && context.getResourceFolderType() == LAYOUT && !isCustomView(attribute.getOwnerElement()) && !isFragment(attribute.getOwnerElement()) && !attribute.getLocalName().startsWith(ATTR_LAYOUT_RESOURCE_PREFIX) && !isCustomView((Element) attribute.getOwnerElement().getParentNode())) {
if (isCustomView(element) && context.getResourceFolderType() != null) { return; } else if (context.getResourceFolderType() == ResourceFolderType.LAYOUT) { && !TOOLS_URI.equals(uri) && context.getResourceFolderType() == ResourceFolderType.LAYOUT && !isCustomView(attribute.getOwnerElement()) && !attribute.getLocalName().startsWith(ATTR_LAYOUT_RESOURCE_PREFIX)