Skip to content

Instantly share code, notes, and snippets.

@saurabharora90
Last active July 29, 2019 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saurabharora90/4094d4146647cccf6512fa03750a4e30 to your computer and use it in GitHub Desktop.
Save saurabharora90/4094d4146647cccf6512fa03750a4e30 to your computer and use it in GitHub Desktop.
Dark Theme Lint Checks
object DirectColorUseIssue {
private const val ID = "DirectColorUse"
private const val DESCRIPTION = "Color used directly"
const val EXPLANATION =
'''Avoid direct use of colors in XML files.
This will cause issues with different theme (dark-theme?) support'''
private val CATEGORY = Category.CORRECTNESS
private const val PRIORITY = 6
private val SEVERITY = Severity.WARNING
val ISSUE = Issue.create(
ID,
DESCRIPTION,
EXPLANATION,
CATEGORY,
PRIORITY,
SEVERITY,
Implementation(
DirectColorUseDetector::class.java,
Scope.RESOURCE_FILE_SCOPE
)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment