as31: Fix test data for android lint based tests for AS 3.0

This commit is contained in:
Vyacheslav Gerasimov
2017-10-23 18:03:24 +03:00
committed by Nikolay Krasko
parent e12e63572c
commit 4c498b004f
83 changed files with 650 additions and 38 deletions
@@ -1,5 +1,5 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
import kotlin.reflect.KClass
@@ -0,0 +1,14 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
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 {
}
@@ -1,5 +1,5 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
@@ -0,0 +1,13 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
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()
}
}
@@ -1,5 +1,5 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.annotation.TargetApi
import android.graphics.drawable.VectorDrawable
import android.os.Build
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
fun withDefaultParameter(vector: VectorDrawable = VectorDrawable()) {
}
@@ -1,5 +1,5 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.annotation.TargetApi
import android.graphics.drawable.VectorDrawable
import android.os.Build
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
class MyVectorDrawable : VectorDrawable() {
}
@@ -1,5 +1,5 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
@@ -0,0 +1,15 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
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()
}
}
}
@@ -1,5 +1,5 @@
// INTENTION_TEXT: Add @TargetApi(KITKAT) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintInlinedApiInspection
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintInlinedApiInspection
class Test {
fun foo(): Int {
@@ -0,0 +1,12 @@
import android.annotation.TargetApi
import android.os.Build
// INTENTION_TEXT: Add @TargetApi(KITKAT) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintInlinedApiInspection
class Test {
@TargetApi(Build.VERSION_CODES.KITKAT)
fun foo(): Int {
return android.R.attr.windowTranslucentStatus
}
}
@@ -1,5 +1,5 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
@@ -0,0 +1,13 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
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()
}
}
@@ -1,5 +1,5 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.annotation.TargetApi
import android.graphics.drawable.VectorDrawable
import android.os.Build
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
class VectorDrawableProvider {
val VECTOR_DRAWABLE = VectorDrawable()
}
@@ -0,0 +1,6 @@
// INTENTION_TEXT: Add @TargetApi(M) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.app.Activity
val top: Int
get() = Activity().<caret>checkSelfPermission(READ_CONTACTS)
@@ -0,0 +1,9 @@
// INTENTION_TEXT: Add @TargetApi(M) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.annotation.TargetApi
import android.app.Activity
import android.os.Build
val top: Int
@TargetApi(Build.VERSION_CODES.M)
get() = Activity().checkSelfPermission(READ_CONTACTS)
+1 -1
View File
@@ -1,5 +1,5 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: org.jetbrains.android.inspections.lint.AndroidLintInspectionToolProvider$AndroidLintNewApiInspection
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
@@ -0,0 +1,17 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
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()
}
}
}