Code example for Attr

Methods: getValue

        return ALL; 
    public void visitAttribute(XmlContext context, Attr attribute) {
        String value = attribute.getValue();
        if (value.endsWith("px") && value.matches("\\d+px")) { //$NON-NLS-1$
            if (value.charAt(0) == '0') {
                // 0px is fine. 0px is 0dp regardless of density... 
  , attribute, context.getLocation(attribute),
                    "Avoid using \"px\" as units; use \"dp\" instead", null); 
Stop searching for code, let great code find you!  Add Codota to your java IDE