Issue Types

## Overview

| Performance
1 | warning DrawAllocation: Memory allocations within drawing code
| Disabled Checks (29)

## Memory allocations within drawing code

../../src/main/java/com/sybotan/android/graphy/items/SGraphyClockItem.kt:106: Avoid object allocations during draw/layout operations (preallocate and reuse instead)

     103         }
     104
     105
     106         calendar.time = Date()
     107         val hour = calendar.get(Calendar.HOUR)
     108         val minute = calendar.get(Calendar.MINUTE)
     109         var second = calendar.get(Calendar.SECOND).toFloat()

You should avoid allocating objects during a drawing or layout operation. These are called frequently, so a smooth UI can be interrupted by garbage collection pauses caused by the object allocations.
The way this is generally handled is to allocate the needed objects up front and to reuse them for each drawing operation.
Some methods allocate memory on your behalf (such as `Bitmap.create`), and these should be handled in the same way.
To suppress this error, use the issue id "DrawAllocation" as explained in the Suppressing Warnings and Errors section.
DrawAllocation Performance Warning Priority 9/10

## Disabled Checks

One or more issues were not run by lint, either because the check is not enabled by default, or because it was disabled with a command line flag or via one or more `lint.xml` configuration files in the project directories.
AppLinksAutoVerifyError
Disabled By: Default
Ensures that app links are correctly set and associated with website.
More info: https://g.co/appindexing/applinks
To suppress this error, use the issue id "AppLinksAutoVerifyError" as explained in the Suppressing Warnings and Errors section.
AppLinksAutoVerifyWarning
Disabled By: Default
Ensures that app links are correctly set and associated with website.
More info: https://g.co/appindexing/applinks
To suppress this error, use the issue id "AppLinksAutoVerifyWarning" as explained in the Suppressing Warnings and Errors section.
BackButton
Disabled By: Default
According to the Android Design Guide,
"Other platforms use an explicit back button with label to allow the user to navigate up the application's hierarchy. Instead, Android uses the main action bar's app icon for hierarchical navigation and the navigation bar's back button for temporal navigation."
This check is not very sophisticated (it just looks for buttons with the label "Back"), so it is disabled by default to not trigger on common scenarios like pairs of Back/Next buttons to paginate through screens.
More info: http://developer.android.com/design/patterns/pure-android.html
To suppress this error, use the issue id "BackButton" as explained in the Suppressing Warnings and Errors section.
ConvertToWebp
Disabled By: Default
The WebP format is typically more compact than PNG and JPEG. As of Android 4.2.1 it supports transparency and lossless conversion as well. Note that there is a quickfix in the IDE which lets you perform conversion.
Launcher icons must be in the PNG format.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "ConvertToWebp" as explained in the Suppressing Warnings and Errors section.
EasterEgg
Disabled By: Default
An "easter egg" is code deliberately hidden in the code, both from potential users and even from other developers. This lint check looks for code which looks like it may be hidden from sight.
To suppress this error, use the issue id "EasterEgg" as explained in the Suppressing Warnings and Errors section.
FieldGetter
Disabled By: Default
Accessing a field within the class that defines a getter for that field is at least 3 times faster than calling the getter. For simple getters that do nothing other than return the field, you might want to just reference the local field directly instead.
NOTE: As of Android 2.3 (Gingerbread), this optimization is performed automatically by Dalvik, so there is no need to change your code; this is only relevant if you are targeting older versions of Android.
More info: http://developer.android.com/guide/practices/design/performance.html#internal_get_set
To suppress this error, use the issue id "FieldGetter" as explained in the Suppressing Warnings and Errors section.
GoogleAppIndexingApiWarning
Disabled By: Default
Adds URLs to get your app into the Google index, to get installs and traffic to your app from Google Search.
More info: https://g.co/AppIndexing/AndroidStudio
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "GoogleAppIndexingApiWarning" as explained in the Suppressing Warnings and Errors section.
IconExpectedSize
Disabled By: Default
There are predefined sizes (for each density) for launcher icons. You should follow these conventions to make sure your icons fit in with the overall look of the platform.
More info: http://developer.android.com/design/style/iconography.html
To suppress this error, use the issue id "IconExpectedSize" as explained in the Suppressing Warnings and Errors section.
KotlinPropertyAccess
Disabled By: Default
For a method to be represented as a property in Kotlin, strict “bean”-style prefixing must be used.
Accessor methods require a ‘get’ prefix or for boolean-returning methods an ‘is’ prefix can be used.
More info: https://android.github.io/kotlin-guides/interop.html#property-prefixes
To suppress this error, use the issue id "KotlinPropertyAccess" as explained in the Suppressing Warnings and Errors section.
LambdaLast
Disabled By: Default
To improve calling this code from Kotlin,
parameter types eligible for SAM conversion should be last.
More info: https://android.github.io/kotlin-guides/interop.html#lambda-parameters-last
To suppress this error, use the issue id "LambdaLast" as explained in the Suppressing Warnings and Errors section.
LogConditional
Disabled By: Default
The BuildConfig class (available in Tools 17) provides a constant, "DEBUG", which indicates whether the code is being built in release mode or in debug mode. In release mode, you typically want to strip out all the logging calls. Since the compiler will automatically remove all code which is inside a "if (false)" check, surrounding your logging calls with a check for BuildConfig.DEBUG is a good idea.
If you really intend for the logging to be present in release mode, you can suppress this warning with a @SuppressLint annotation for the intentional logging calls.
To suppress this error, use the issue id "LogConditional" as explained in the Suppressing Warnings and Errors section.
MangledCRLF
Disabled By: Default
On Windows, line endings are typically recorded as carriage return plus newline: \r\n.
This detector looks for invalid line endings with repeated carriage return characters (without newlines). Previous versions of the ADT plugin could accidentally introduce these into the file, and when editing the file, the editor could produce confusing visual artifacts.
More info: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375421
To suppress this error, use the issue id "MangledCRLF" as explained in the Suppressing Warnings and Errors section.
MinSdkTooLow
Disabled By: Default
The value of the `minSdkVersion` property is too low and can be incremented without noticeably reducing the number of supported devices.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "MinSdkTooLow" as explained in the Suppressing Warnings and Errors section.
MissingRegistered
Disabled By: Default
If a class is referenced in the manifest or in a layout file, it must also exist in the project (or in one of the libraries included by the project. This check helps uncover typos in registration names, or attempts to rename or move classes without updating the manifest file properly.
More info: http://developer.android.com/guide/topics/manifest/manifest-intro.html
To suppress this error, use the issue id "MissingRegistered" as explained in the Suppressing Warnings and Errors section.
NegativeMargin
Disabled By: Default
Margin values should be positive. Negative values are generally a sign that you are making assumptions about views surrounding the current one, or may be tempted to turn off child clipping to allow a view to escape its parent. Turning off child clipping to do this not only leads to poor graphical performance, it also results in wrong touch event handling since touch events are based strictly on a chain of parent-rect hit tests. Finally, making assumptions about the size of strings can lead to localization problems.
To suppress this error, use the issue id "NegativeMargin" as explained in the Suppressing Warnings and Errors section.
NewerVersionAvailable
Disabled By: Default
This detector checks with a central repository to see if there are newer versions available for the dependencies used by this project. This is similar to the `GradleDependency` check, which checks for newer versions available in the Android SDK tools and libraries, but this works with any MavenCentral dependency, and connects to the library every time, which makes it more flexible but also much slower.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "NewerVersionAvailable" as explained in the Suppressing Warnings and Errors section.
NoHardKeywords
Disabled By: Default
Do not use Kotlin’s hard keywords as the name of methods or fields.
These require the use of backticks to escape when calling from Kotlin.
Soft keywords, modifier keywords, and special identifiers are allowed.
For example, Mockito’s `when` function requires backticks when used from Kotlin:
val callable = Mockito.mock(Callable::class.java)
Mockito.`when`(callable.call()).thenReturn(/* … */)
More info: https://android.github.io/kotlin-guides/interop.html#no-hard-keywords
To suppress this error, use the issue id "NoHardKeywords" as explained in the Suppressing Warnings and Errors section.
PermissionImpliesUnsupportedChromeOsHardware
Disabled By: Default
The `<uses-permission>` element should not require a permission that implies an unsupported Chrome OS hardware feature. Google Play assumes that certain hardware related permissions indicate that the underlying hardware features are required by default. To fix the issue, consider declaring the corresponding uses-feature element with `required="false"` attribute.
More info: https://developer.android.com/topic/arc/manifest.html#implied-features
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "PermissionImpliesUnsupportedChromeOsHardware" as explained in the Suppressing Warnings and Errors section.
Registered
Disabled By: Default
Activities, services and content providers should be registered in the `AndroidManifest.xml` file using `<activity>`, `<service>` and `<provider>` tags.
If your activity is simply a parent class intended to be subclassed by other "real" activities, make it an abstract class.
More info: http://developer.android.com/guide/topics/manifest/manifest-intro.html
To suppress this error, use the issue id "Registered" as explained in the Suppressing Warnings and Errors section.
RequiredSize
Disabled By: Default
All views must specify an explicit `layout_width` and `layout_height` attribute. There is a runtime check for this, so if you fail to specify a size, an exception is thrown at runtime.
It's possible to specify these widths via styles as well. GridLayout, as a special case, does not require you to specify a size.
To suppress this error, use the issue id "RequiredSize" as explained in the Suppressing Warnings and Errors section.
SelectableText
Disabled By: Default
If a `<TextView>` is used to display data, the user might want to copy that data and paste it elsewhere. To allow this, the `<TextView>` should specify `android:textIsSelectable="true"`.
This lint check looks for TextViews which are likely to be displaying data: views whose text is set dynamically. This value will be ignored on platforms older than API 11, so it is okay to set it regardless of your `minSdkVersion`.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "SelectableText" as explained in the Suppressing Warnings and Errors section.
StopShip
Disabled By: Default
Using the comment `// STOPSHIP` can be used to flag code that is incomplete but checked in. This comment marker can be used to indicate that the code should not be shipped until the issue is addressed, and lint will look for these. In Gradle projects, this is only checked for non-debug (release) builds.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "StopShip" as explained in the Suppressing Warnings and Errors section.
SyntheticAccessor
Disabled By: Default
A private inner class which is accessed from the outer class will force the compiler to insert a synthetic accessor; this means that you are causing extra overhead. This is not important in small projects, but is important for large apps running up against the 64K method handle limit, and especially for libraries where you want to make sure your library is as small as possible for the cases where your library is used in an app running up against the 64K limit.
To suppress this error, use the issue id "SyntheticAccessor" as explained in the Suppressing Warnings and Errors section.
TypographyQuotes
Disabled By: Default
Straight single quotes and double quotes, when used as a pair, can be replaced by "curvy quotes" (or directional quotes). This can make the text more readable.
Note that you should never use grave accents and apostrophes to quote, `like this'.
(Also note that you should not use curvy quotes for code fragments.)
More info: http://en.wikipedia.org/wiki/Quotation_mark
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "TypographyQuotes" as explained in the Suppressing Warnings and Errors section.
UnknownNullness
Disabled By: Default
To improve referencing this code from Kotlin, consider adding
explicit nullness information here with either `@NonNull` or `@Nullable`.
More info: https://android.github.io/kotlin-guides/interop.html#nullability-annotations
To suppress this error, use the issue id "UnknownNullness" as explained in the Suppressing Warnings and Errors section.
UnpackedNativeCode
Disabled By: Default
This app loads native libraries using `System.loadLibrary()`.
Consider adding `android:extractNativeLibs="false"` to the `<application>` tag in AndroidManifest.xml. Starting with Android 6.0, this will make installation faster, the app will take up less space on the device and updates will have smaller download sizes.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "UnpackedNativeCode" as explained in the Suppressing Warnings and Errors section.
UnsupportedChromeOsHardware
Disabled By: Default
The `<uses-feature>` element should not require this unsupported Chrome OS hardware feature. Any uses-feature not explicitly marked with `required="false"` is necessary on the device to be installed on. Ensure that any features that might prevent it from being installed on a Chrome OS device are reviewed and marked as not required in the manifest.
More info: https://developer.android.com/topic/arc/manifest.html#incompat-entries
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "UnsupportedChromeOsHardware" as explained in the Suppressing Warnings and Errors section.
UnusedIds
Disabled By: Default
This resource id definition appears not to be needed since it is not referenced from anywhere. Having id definitions, even if unused, is not necessarily a bad idea since they make working on layouts and menus easier, so there is not a strong reason to delete these.
The unused resource check can ignore tests. If you want to include resources that are only referenced from tests, consider packaging them in a test source set instead.
You can include test sources in the unused resource check by setting the system property lint.unused-resources.include-tests=true, and to exclude them (usually for performance reasons), use lint.unused-resources.exclude-tests=true.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "UnusedIds" as explained in the Suppressing Warnings and Errors section.
WrongThreadInterprocedural
Disabled By: Default
Searches for interprocedural call paths that violate thread annotations in the program. Tracks the flow of instantiated types and lambda expressions to increase accuracy across method boundaries.
More info: https://developer.android.com/guide/components/processes-and-threads.html#Threads
To suppress this error, use the issue id "WrongThreadInterprocedural" as explained in the Suppressing Warnings and Errors section.

## Suppressing Warnings and Errors

Lint errors can be suppressed in a variety of ways:
1. With a `@SuppressLint` annotation in the Java code
2. With a `tools:ignore` attribute in the XML file
3. With a //noinspection comment in the source code
4. With ignore flags specified in the `build.gradle` file, as explained below
5. With a `lint.xml` configuration file in the project
6. With a `lint.xml` configuration file passed to lint via the --config flag
7. With the --ignore flag passed to lint.
To suppress a lint warning with an annotation, add a `@SuppressLint("id")` annotation on the class, method or variable declaration closest to the warning instance you want to disable. The id can be one or more issue id's, such as `"UnusedResources"` or `{"UnusedResources","UnusedIds"}`, or it can be `"all"` to suppress all lint warnings in the given scope.
To suppress a lint warning with a comment, add a `//noinspection id` comment on the line before the statement with the error.
To suppress a lint warning in an XML file, add a `tools:ignore="id"` attribute on the element containing the error, or one of its surrounding elements. You also need to define the namespace for the tools prefix on the root element in your document, next to the `xmlns:android` declaration:
`xmlns:tools="http://schemas.android.com/tools"`
To suppress a lint warning in a `build.gradle` file, add a section like this:
android {
lintOptions {
disable 'TypographyFractions','TypographyQuotes'
}
}
Here we specify a comma separated list of issue id's after the disable command. You can also use `warning` or `error` instead of `disable` to change the severity of issues.
To suppress lint warnings with a configuration XML file, create a file named `lint.xml` and place it at the root directory of the module in which it applies.
The format of the `lint.xml` file is something like the following:
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Ignore everything in the test source set -->
<issue id="all">
<ignore path="*/test/*" />
</issue>
<!-- Disable this given check in this project -->
<issue id="IconMissingDensityFolder" severity="ignore" />
<!-- Ignore the ObsoleteLayoutParam issue in the given files -->
<issue id="ObsoleteLayoutParam">
<ignore path="res/layout/activation.xml" />
<ignore path="res/layout-xlarge/activation.xml" />
<ignore regexp="(foo|bar).java" />
</issue>
<!-- Ignore the UselessLeaf issue in the given file -->
<issue id="UselessLeaf">
<ignore path="res/layout/main.xml" />
</issue>
<!-- Change the severity of hardcoded strings to "error" -->
<issue id="HardcodedText" severity="error" />
</lint>
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
`$ lint --ignore UnusedResources,UselessLeaf /my/project/path`
For more information, see http://g.co/androidstudio/suppressing-lint-warnings