com.android.tools.lint.detector.api
Class LayoutDetector

java.lang.Object
  extended by com.android.tools.lint.detector.api.Detector
      extended by com.android.tools.lint.detector.api.Detector.XmlDetectorAdapter
          extended by com.android.tools.lint.detector.api.ResourceXmlDetector
              extended by com.android.tools.lint.detector.api.LayoutDetector
All Implemented Interfaces:
Detector.XmlScanner

public abstract class LayoutDetector
extends ResourceXmlDetector

Abstract class specifically intended for layout detectors which provides some common utility methods shared by layout detectors.

NOTE: This is not a public or final API; if you rely on this be prepared to adjust your code for the next tools release.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.android.tools.lint.detector.api.Detector
Detector.ClassScanner, Detector.JavaScanner, Detector.XmlDetectorAdapter, Detector.XmlScanner
 
Field Summary
 
Fields inherited from interface com.android.tools.lint.detector.api.Detector.XmlScanner
ALL
 
Constructor Summary
LayoutDetector()
           
 
Method Summary
 boolean appliesTo(com.android.resources.ResourceFolderType folderType)
          Returns whether this detector applies to the given folder type.
protected  boolean hasPadding(Element root)
           
protected static boolean isHeightFillParent(Element element)
           
protected static boolean isWidthFillParent(Element element)
           
 
Methods inherited from class com.android.tools.lint.detector.api.ResourceXmlDetector
appliesTo, run
 
Methods inherited from class com.android.tools.lint.detector.api.Detector.XmlDetectorAdapter
getApplicableAttributes, getApplicableElements, visitAttribute, visitDocument, visitElement, visitElementAfter
 
Methods inherited from class com.android.tools.lint.detector.api.Detector
afterCheckFile, afterCheckProject, beforeCheckFile, beforeCheckProject, getSpeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutDetector

public LayoutDetector()
Method Detail

appliesTo

public boolean appliesTo(com.android.resources.ResourceFolderType folderType)
Description copied from class: ResourceXmlDetector
Returns whether this detector applies to the given folder type. This allows the detectors to be pruned from iteration, so for example when we are analyzing a string value file we don't need to look up detectors related to layout.

Overrides:
appliesTo in class ResourceXmlDetector
Parameters:
folderType - the folder type to be visited
Returns:
true if this detector can apply to resources in folders of the given type

isWidthFillParent

protected static boolean isWidthFillParent(Element element)

isHeightFillParent

protected static boolean isHeightFillParent(Element element)

hasPadding

protected boolean hasPadding(Element root)


Copyright © 2008-2012. All Rights Reserved.