public class TypographyDetector
extends com.android.tools.lint.detector.api.ResourceXmlDetector
| Modifier and Type | Class and Description |
|---|---|
static class |
TypographyDetector.ReplaceEdit
An object describing a single edit to be made.
|
com.android.tools.lint.detector.api.Detector.BinaryResourceScanner, com.android.tools.lint.detector.api.Detector.ClassScanner, com.android.tools.lint.detector.api.Detector.GradleScanner, com.android.tools.lint.detector.api.Detector.OtherFileScanner, com.android.tools.lint.detector.api.Detector.ResourceFolderScanner, com.android.tools.lint.detector.api.Detector.UastScanner, com.android.tools.lint.detector.api.Detector.XmlScanner| Modifier and Type | Field and Description |
|---|---|
static com.android.tools.lint.detector.api.Issue |
DASHES
Replace hyphens with dashes?
|
static com.android.tools.lint.detector.api.Issue |
ELLIPSIS
Replace ...
|
static com.android.tools.lint.detector.api.Issue |
FRACTIONS
Replace fraction strings with fraction characters?
|
static com.android.tools.lint.detector.api.Issue |
OTHER
The main issue discovered by this detector
|
static com.android.tools.lint.detector.api.Issue |
QUOTES
Replace dumb quotes with smart quotes?
|
| Constructor and Description |
|---|
TypographyDetector()
Constructs a new
TypographyDetector |
| Modifier and Type | Method and Description |
|---|---|
boolean |
appliesTo(com.android.resources.ResourceFolderType folderType) |
void |
beforeCheckRootProject(com.android.tools.lint.detector.api.Context context) |
java.util.Collection<java.lang.String> |
getApplicableElements() |
static java.util.List<TypographyDetector.ReplaceEdit> |
getEdits(java.lang.String issueId,
java.lang.String message,
org.w3c.dom.Node textNode)
Returns a list of edits to be applied to fix the suggestion made by the given warning.
|
static java.util.List<TypographyDetector.ReplaceEdit> |
getEdits(java.lang.String issueId,
java.lang.String message,
java.lang.String text)
Returns a list of edits to be applied to fix the suggestion made by the given warning.
|
void |
visitElement(com.android.tools.lint.detector.api.XmlContext context,
org.w3c.dom.Element element) |
afterCheckEachProject, afterCheckFile, afterCheckLibraryProject, afterCheckProject, afterCheckRootProject, analyzeCallGraph, applicableAnnotations, applicableSuperClasses, appliesTo, appliesToResourceRefs, beforeCheckEachProject, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, checkBinaryResource, checkCall, checkClass, checkClass, checkDslPropertyAssignment, checkFolder, checkInstruction, checkMethodCall, createPsiVisitor, createUastHandler, fix, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallNames, getApplicableCallOwners, getApplicableConstructorTypes, getApplicableFiles, getApplicableMethodNames, getApplicablePsiTypes, getApplicableReferenceNames, getApplicableUastTypes, getCustomVisitor, getSpeed, isApplicableAnnotationUsage, isCallGraphRequired, visitAnnotationUsage, visitAnnotationUsage, visitAttribute, visitBuildScript, visitClass, visitClass, visitConstructor, visitConstructor, visitDocument, visitElementAfter, visitMethod, visitMethod, visitMethodCall, visitReference, visitReference, visitResourceReference, visitResourceReferenceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final com.android.tools.lint.detector.api.Issue DASHES
public static final com.android.tools.lint.detector.api.Issue QUOTES
public static final com.android.tools.lint.detector.api.Issue FRACTIONS
public static final com.android.tools.lint.detector.api.Issue ELLIPSIS
public static final com.android.tools.lint.detector.api.Issue OTHER
public TypographyDetector()
TypographyDetectorpublic boolean appliesTo(@NonNull
com.android.resources.ResourceFolderType folderType)
appliesTo in interface com.android.tools.lint.detector.api.XmlScannerappliesTo in class com.android.tools.lint.detector.api.ResourceXmlDetectorpublic java.util.Collection<java.lang.String> getApplicableElements()
getApplicableElements in interface com.android.tools.lint.detector.api.XmlScannergetApplicableElements in class com.android.tools.lint.detector.api.Detectorpublic void beforeCheckRootProject(@NonNull
com.android.tools.lint.detector.api.Context context)
beforeCheckRootProject in class com.android.tools.lint.detector.api.Detectorpublic void visitElement(@NonNull
com.android.tools.lint.detector.api.XmlContext context,
@NonNull
org.w3c.dom.Element element)
visitElement in interface com.android.tools.lint.detector.api.XmlScannervisitElement in class com.android.tools.lint.detector.api.Detectorpublic static java.util.List<TypographyDetector.ReplaceEdit> getEdits(java.lang.String issueId, java.lang.String message, org.w3c.dom.Node textNode)
This is intended to help tools implement automatic fixes of these warnings. The reason only the message and issue id can be provided instead of actual state passed in the data field to a reporter is that fix operation can be run much later than the lint is processed (for example, in a subsequent run of the IDE when only the warnings have been persisted),
issueId - the issue id, which should be the id for one of the typography issuesmessage - the actual error message, which should be a message provided by this detectortextNode - a text node which corresponds to the text node the warning operated onpublic static java.util.List<TypographyDetector.ReplaceEdit> getEdits(java.lang.String issueId, java.lang.String message, java.lang.String text)
This is intended to help tools implement automatic fixes of these warnings. The reason only the message and issue id can be provided instead of actual state passed in the data field to a reporter is that fix operation can be run much later than the lint is processed (for example, in a subsequent run of the IDE when only the warnings have been persisted),
issueId - the issue id, which should be the id for one of the typography issuesmessage - the actual error message, which should be a message provided by this detectortext - the text of the XML node where the warning appeared