181: Fix test data for android lint based tests

This commit is contained in:
Vyacheslav Gerasimov
2017-10-23 18:03:24 +03:00
committed by Nikolay Krasko
parent 585348c590
commit ae338566c2
109 changed files with 2822 additions and 0 deletions
@@ -0,0 +1,11 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
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: 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 {
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
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: 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()
}
}
@@ -0,0 +1,9 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
fun withDefaultParameter(vector: VectorDrawable = <caret>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()) {
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class MyVectorDrawable : <caret>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() {
}
@@ -0,0 +1,12 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
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: 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()
}
}
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Add @TargetApi(KITKAT) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintInlinedApiInspection
class Test {
fun foo(): Int {
return android.R.attr.<caret>windowTranslucentStatus
}
}
@@ -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
}
}
@@ -0,0 +1,10 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
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: 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()
}
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
import android.graphics.drawable.VectorDrawable
class VectorDrawableProvider {
val VECTOR_DRAWABLE = <caret>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)
@@ -0,0 +1,14 @@
// INTENTION_TEXT: Add @TargetApi(LOLLIPOP) Annotation
// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintNewApiInspection
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: 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()
}
}
}