Implement quickfixes for Android Lint api issues

#KT-16624 Fixed
#KT-16625 Fixed
#KT-14947 Fixed
This commit is contained in:
Vyacheslav Gerasimov
2017-03-03 16:12:54 +03:00
parent a907ec92b5
commit 1376c8f8cf
178 changed files with 1307 additions and 221 deletions
@@ -0,0 +1,49 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.support.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.CLASS;
/**
* Denotes that the annotated element should only be called on the given API level
* or higher.
* <p>
* This is similar in purpose to the older {@code @TargetApi} annotation, but more
* clearly expresses that this is a requirement on the caller, rather than being
* used to "suppress" warnings within the method that exceed the {@code minSdkVersion}.
*/
@Retention(CLASS)
@Target({TYPE,METHOD,CONSTRUCTOR,FIELD})
public @interface RequiresApi {
/**
* The API level to require. Alias for {@link #api} which allows you to leave out the
* {@code api=} part.
*/
@IntRange(from=1)
int value() default 1;
/** The API level to require */
@IntRange(from=1)
int api() default 1;
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
import kotlin.reflect.KClass
annotation class SomeAnnotationWithClass(val cls: KClass<*>)
@SomeAnnotationWithClass(<caret>VectorDrawable::class)
class VectorDrawableProvider {
}
@@ -0,0 +1,15 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
import android.os.Build
import android.support.annotation.RequiresApi
import kotlin.reflect.KClass
annotation class SomeAnnotationWithClass(val cls: KClass<*>)
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
@SomeAnnotationWithClass(VectorDrawable::class)
class VectorDrawableProvider {
}
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
companion object {
val VECTOR_DRAWABLE = <caret>VectorDrawable()
}
}
@@ -0,0 +1,14 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
import android.os.Build
import android.support.annotation.RequiresApi
class VectorDrawableProvider {
companion object {
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
val VECTOR_DRAWABLE = VectorDrawable()
}
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
fun withDefaultParameter(vector: VectorDrawable = <caret>VectorDrawable()) {
}
@@ -0,0 +1,13 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
import android.os.Build
import android.support.annotation.RequiresApi
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
fun withDefaultParameter(vector: VectorDrawable = VectorDrawable()) {
}
@@ -0,0 +1,9 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class MyVectorDrawable : <caret>VectorDrawable() {
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
import android.os.Build
import android.support.annotation.RequiresApi
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
class MyVectorDrawable : VectorDrawable() {
}
@@ -0,0 +1,13 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
with(this) {
return <caret>VectorDrawable()
}
}
}
@@ -0,0 +1,16 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
import android.os.Build
import android.support.annotation.RequiresApi
class VectorDrawableProvider {
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
fun getVectorDrawable(): VectorDrawable {
with(this) {
return VectorDrawable()
}
}
}
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
return <caret>VectorDrawable()
}
}
@@ -0,0 +1,14 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
import android.os.Build
import android.support.annotation.RequiresApi
class VectorDrawableProvider {
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
fun getVectorDrawable(): VectorDrawable {
return VectorDrawable()
}
}
@@ -0,0 +1,9 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val VECTOR_DRAWABLE = <caret>VectorDrawable()
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
import android.os.Build
import android.support.annotation.RequiresApi
class VectorDrawableProvider {
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
val VECTOR_DRAWABLE = VectorDrawable()
}
+15
View File
@@ -0,0 +1,15 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
return when (flag) {
true -> <caret>VectorDrawable()
else -> VectorDrawable()
}
}
}
@@ -0,0 +1,18 @@
// INTENTION_TEXT: Add @RequiresApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
// DEPENDENCY: RequiresApi.java -> android/support/annotation/RequiresApi.java
import android.graphics.drawable.VectorDrawable
import android.os.Build
import android.support.annotation.RequiresApi
class VectorDrawableProvider {
val flag = false
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
fun getVectorDrawable(): VectorDrawable {
return when (flag) {
true -> VectorDrawable()
else -> VectorDrawable()
}
}
}
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
import kotlin.reflect.KClass
annotation class SomeAnnotationWithClass(val cls: KClass<*>)
@SomeAnnotationWithClass(<caret>VectorDrawable::class)
class VectorDrawableProvider {
}
@@ -0,0 +1,14 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.annotation.TargetApi
import android.graphics.drawable.VectorDrawable
import android.os.Build
import kotlin.reflect.KClass
annotation class SomeAnnotationWithClass(val cls: KClass<*>)
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@SomeAnnotationWithClass(VectorDrawable::class)
class VectorDrawableProvider {
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
companion object {
val VECTOR_DRAWABLE = <caret>VectorDrawable()
}
}
@@ -0,0 +1,13 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.annotation.TargetApi
import android.graphics.drawable.VectorDrawable
import android.os.Build
class VectorDrawableProvider {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
companion object {
val VECTOR_DRAWABLE = VectorDrawable()
}
}
@@ -0,0 +1,9 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
fun withDefaultParameter(vector: VectorDrawable = <caret>VectorDrawable()) {
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.annotation.TargetApi
import android.graphics.drawable.VectorDrawable
import android.os.Build
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
fun withDefaultParameter(vector: VectorDrawable = VectorDrawable()) {
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class MyVectorDrawable : <caret>VectorDrawable() {
}
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.annotation.TargetApi
import android.graphics.drawable.VectorDrawable
import android.os.Build
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
class MyVectorDrawable : VectorDrawable() {
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
with(this) {
return <caret>VectorDrawable()
}
}
}
@@ -0,0 +1,15 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.annotation.TargetApi
import android.graphics.drawable.VectorDrawable
import android.os.Build
class VectorDrawableProvider {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
fun getVectorDrawable(): VectorDrawable {
with(this) {
return VectorDrawable()
}
}
}
+10
View File
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
return <caret>VectorDrawable()
}
}
@@ -0,0 +1,13 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.annotation.TargetApi
import android.graphics.drawable.VectorDrawable
import android.os.Build
class VectorDrawableProvider {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
fun getVectorDrawable(): VectorDrawable {
return VectorDrawable()
}
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val VECTOR_DRAWABLE = <caret>VectorDrawable()
}
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.annotation.TargetApi
import android.graphics.drawable.VectorDrawable
import android.os.Build
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
class VectorDrawableProvider {
val VECTOR_DRAWABLE = VectorDrawable()
}
+14
View File
@@ -0,0 +1,14 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
return when (flag) {
true -> <caret>VectorDrawable()
else -> VectorDrawable()
}
}
}
@@ -0,0 +1,17 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.annotation.TargetApi
import android.graphics.drawable.VectorDrawable
import android.os.Build
class VectorDrawableProvider {
val flag = false
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
fun getVectorDrawable(): VectorDrawable {
return when (flag) {
true -> VectorDrawable()
else -> VectorDrawable()
}
}
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INTENTION_NOT_AVAILABLE
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
import kotlin.reflect.KClass
annotation class SomeAnnotationWithClass(val cls: KClass<*>)
@SomeAnnotationWithClass(<caret>VectorDrawable::class)
class VectorDrawableProvider {
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INTENTION_NOT_AVAILABLE
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
fun withDefaultParameter(vector: VectorDrawable = <caret>VectorDrawable()) {
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable = <caret>VectorDrawable()
}
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
import android.os.Build
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
VectorDrawable()
}
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
with(this) {
return <caret>VectorDrawable()
}
}
}
@@ -0,0 +1,15 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
import android.os.Build
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
with(this) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return VectorDrawable()
}
}
}
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
if (flag)
return <caret>VectorDrawable()
}
}
@@ -0,0 +1,15 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
import android.os.Build
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
if (flag)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return VectorDrawable()
}
}
}
@@ -0,0 +1,13 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
if (flag) {
return <caret>VectorDrawable()
}
}
}
@@ -0,0 +1,16 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
import android.os.Build
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
if (flag) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return VectorDrawable()
}
}
}
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
return <caret>VectorDrawable()
}
}
@@ -0,0 +1,13 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
import android.os.Build
class VectorDrawableProvider {
fun getVectorDrawable(): VectorDrawable {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return VectorDrawable()
}
}
}
@@ -0,0 +1,14 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
return when (flag) {
true -> <caret>VectorDrawable()
else -> VectorDrawable()
}
}
}
@@ -0,0 +1,17 @@
// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.graphics.drawable.VectorDrawable
import android.os.Build
class VectorDrawableProvider {
val flag = false
fun getVectorDrawable(): VectorDrawable {
return when (flag) {
true -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
VectorDrawable()
}
else -> VectorDrawable()
}
}
}
@@ -0,0 +1,5 @@
{
"rFile": "../../R.kt",
"resDirectory": "../../res",
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
}
@@ -0,0 +1,5 @@
{
"rFile": "../../R.kt",
"resDirectory": "../../res",
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
}

Some files were not shown because too many files have changed in this diff Show More