Ignore some XML tags
This commit is contained in:
+6
-3
@@ -35,14 +35,17 @@ class AndroidXmlVisitor(val elementCallback: (String, String, XmlAttribute) -> U
|
||||
}
|
||||
|
||||
override fun visitXmlTag(tag: XmlTag?) {
|
||||
val localName = tag?.getLocalName() ?: ""
|
||||
if (isWidgetTypeIgnored(localName)) return
|
||||
|
||||
val idAttribute = tag?.getAttribute(AndroidConst.ID_ATTRIBUTE)
|
||||
if (idAttribute != null) {
|
||||
val idAttributeValue = idAttribute.getValue()
|
||||
if (idAttributeValue != null) {
|
||||
val classAttributeValue = tag?.getAttribute(AndroidConst.CLASS_ATTRIBUTE_NO_NAMESPACE)?.getValue()
|
||||
val xmlType = classAttributeValue ?: tag?.getLocalName()
|
||||
val widgetType = xmlType?.let { getRealWidgetType(it) }
|
||||
if (widgetType != null && isResourceDeclarationOrUsage(idAttributeValue)) {
|
||||
val xmlType = classAttributeValue ?: localName
|
||||
val widgetType = xmlType.let { getRealWidgetType(it) }
|
||||
if (isResourceDeclarationOrUsage(idAttributeValue)) {
|
||||
val name = idToName(idAttributeValue)
|
||||
if (name != null) elementCallback(name, widgetType, idAttribute)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user