override fun visitElement()

in lint-checks-android/src/main/java/com/uber/lintchecks/android/XmlWebViewInsideScrollViewDetector.kt [58:74]


  override fun visitElement(context: XmlContext, element: Element) {
    val parentScrollView = findParentScrollView(element)
    parentScrollView?.attributes?.let { attrs ->
      if (attrs.getNamedItem(ATTR_ANDROID_VIEWPORT) == null ||
          attrs.getNamedItem(ATTR_ANDROID_VIEWPORT).nodeValue != "true") {
        val replaceFix = LintFix.create()
            .set()
            .attribute(ATTR_FILL_VIEWPORT)
            .value("true")
            .build()
        context.report(ISSUE,
            context.getElementLocation(parentScrollView),
            LINT_ERROR_MESSAGE,
            replaceFix)
      }
    }
  }