public static void processLayoutAttributes(@NotNull AndroidFacet facet,@NotNull XmlTag tag,@NotNull LayoutElement element,@NotNull Set<XmlName> skipAttrNames,@NotNull AttributeProcessor callback){
  Map<String,PsiClass> map=getViewClassMap(facet);
  if (!(element instanceof DataBindingElement)) {
    registerToolsAttribute(ATTR_TARGET_API,callback);
    if (tag.getParentTag() == null) {
      registerToolsAttribute(ATTR_CONTEXT,callback);
      registerToolsAttribute(ATTR_MENU,callback);
      registerToolsAttribute(ATTR_ACTION_BAR_NAV_MODE,callback);
      registerToolsAttribute(ATTR_SHOW_IN,callback);
    }
    final PsiClass adapterView=map.get(ADAPTER_VIEW);
    final PsiClass psiClass=map.get(tag.getName());
    if (adapterView != null && psiClass != null && psiClass.isInheritor(adapterView,true)) {
      registerToolsAttribute(ATTR_LISTITEM,callback);
      registerToolsAttribute(ATTR_LISTHEADER,callback);
      registerToolsAttribute(ATTR_LISTFOOTER,callback);
    }
    final PsiClass drawerLayout=map.get(CLASS_DRAWER_LAYOUT);
    if (drawerLayout != null && psiClass != null && (psiClass.isEquivalentTo(drawerLayout) || psiClass.isInheritor(drawerLayout,true))) {
      registerToolsAttribute(ATTR_OPEN_DRAWER,callback);
    }
  }
  if (element instanceof Tag || element instanceof Include || element instanceof Data) {
    return;
  }
  String tagName=tag.getName();
switch (tagName) {
case VIEW_TAG:
    for (    PsiClass aClass : map.values()) {
      final String name=aClass.getName();
      if (name == null) {
        continue;
      }
      registerAttributes(facet,element,name,callback,skipAttrNames);
    }
  break;
case VIEW_MERGE:
if (tag.getParentTag() == null) {
  registerToolsAttribute(ATTR_PARENT_TAG,callback);
}
registerAttributesForClassAndSuperclasses(facet,element,map.get(VIEW_MERGE),callback,skipAttrNames);
String parentTagName=tag.getAttributeValue(ATTR_PARENT_TAG,TOOLS_URI);
if (parentTagName != null) {
registerAttributesForClassAndSuperclasses(facet,element,map.get(parentTagName),callback,skipAttrNames);
}
break;
default :
PsiClass c=map.get(tagName);
registerAttributesForClassAndSuperclasses(facet,element,c,callback,skipAttrNames);
break;
}
if (tagName.equals(VIEW_MERGE)) {
return;
}
XmlTag parentTag=tag.getParentTag();
if (parentTag != null) {
String parentTagName=parentTag.getName();
if (VIEW_MERGE.equals(parentTagName)) {
parentTagName=parentTag.getAttributeValue(ATTR_PARENT_TAG,TOOLS_URI);
}
if (TAG_LAYOUT.equals(parentTagName)) {
parentTagName=VIEW_GROUP;
}
if (parentTagName != null) {
PsiClass c=map.get(parentTagName);
while (c != null) {
registerAttributesFromSuffixedStyleables(facet,element,c,callback,skipAttrNames);
c=getSuperclass(c);
}
return;
}
}
for (PsiClass c : map.values()) {
registerAttributesFromSuffixedStyleables(facet,element,c,callback,skipAttrNames);
}
}

public static void processLayoutAttributes ( @ NotNull AndroidFacet facet , @ NotNull XmlTag tag , @ NotNull LayoutElement element , @ NotNull Set < XmlName > skipAttrNames , @ NotNull AttributeProcessor callback ) { Map < String , PsiClass > map = getViewClassMap ( facet ) ; if ( ! ( element instanceof DataBindingElement ) ) { registerToolsAttribute ( ATTR_TARGET_API , callback ) ; if ( tag . getParentTag ( ) == null ) { registerToolsAttribute ( ATTR_CONTEXT , callback ) ; registerToolsAttribute ( ATTR_MENU , callback ) ; registerToolsAttribute ( ATTR_ACTION_BAR_NAV_MODE , callback ) ; registerToolsAttribute ( ATTR_SHOW_IN , callback ) ; } final PsiClass adapterView = map . get ( ADAPTER_VIEW ) ; final PsiClass psiClass = map . get ( tag . getName ( ) ) ; if ( adapterView != null && psiClass != null && psiClass . isInheritor ( adapterView , true ) ) { registerToolsAttribute ( ATTR_LISTITEM , callback ) ; registerToolsAttribute ( ATTR_LISTHEADER , callback ) ; registerToolsAttribute ( ATTR_LISTFOOTER , callback ) ; } final PsiClass drawerLayout = map . get ( CLASS_DRAWER_LAYOUT ) ; if ( drawerLayout != null && psiClass != null && ( psiClass . isEquivalentTo ( drawerLayout ) || psiClass . isInheritor ( drawerLayout , true ) ) ) { registerToolsAttribute ( ATTR_OPEN_DRAWER , callback ) ; } } if ( element instanceof Tag || element instanceof Include || element instanceof Data ) { return ; } String tagName = tag . getName ( ) ; switch ( tagName ) { case VIEW_TAG : for ( PsiClass aClass : map . values ( ) ) { final String name = aClass . getName ( ) ; if ( name == null ) { continue ; } registerAttributes ( facet , element , name , callback , skipAttrNames ) ; } break ; case VIEW_MERGE : if ( tag . getParentTag ( ) == null ) { registerToolsAttribute ( ATTR_PARENT_TAG , callback ) ; } registerAttributesForClassAndSuperclasses ( facet , element , map . get ( VIEW_MERGE ) , callback , skipAttrNames ) ; String parentTagName = tag . getAttributeValue ( ATTR_PARENT_TAG , TOOLS_URI ) ; if ( parentTagName != null ) { registerAttributesForClassAndSuperclasses ( facet , element , map . get ( parentTagName ) , callback , skipAttrNames ) ; } break ; default : PsiClass c = map . get ( tagName ) ; registerAttributesForClassAndSuperclasses ( facet , element , c , callback , skipAttrNames ) ; break ; } if ( tagName . equals ( VIEW_MERGE ) ) { return ; } XmlTag parentTag = tag . getParentTag ( ) ; if ( parentTag != null ) { String parentTagName = parentTag . getName ( ) ; if ( VIEW_MERGE . equals ( parentTagName ) ) { parentTagName = parentTag . getAttributeValue ( ATTR_PARENT_TAG , TOOLS_URI ) ; } if ( TAG_LAYOUT . equals ( parentTagName ) ) { parentTagName = VIEW_GROUP ; } if ( parentTagName != null ) { PsiClass c = map . get ( parentTagName ) ; while ( c != null ) { registerAttributesFromSuffixedStyleables ( facet , element , c , callback , skipAttrNames ) ; c = getSuperclass ( c ) ; } return ; } } for ( PsiClass c : map . values ( ) ) { registerAttributesFromSuffixedStyleables ( facet , element , c , callback , skipAttrNames ) ; } }
entry point for xml elements in layout xmls
