Implement quickfixes for Android Lint api issues
#KT-16624 Fixed #KT-16625 Fixed #KT-14947 Fixed
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
|
||||
fun Activity.getSomeText() {
|
||||
getString(R.string.resource_id)
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some text</string>
|
||||
</resources>
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
|
||||
fun Activity.getSomeText() {
|
||||
"some <caret>text"
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
|
||||
class MyActivity: Activity() {
|
||||
fun foo() {
|
||||
val a = getString(R.string.resource_id)
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some string</string>
|
||||
</resources>
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
|
||||
class MyActivity: Activity() {
|
||||
fun foo() {
|
||||
val a = "some <caret>string"
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
|
||||
class MyActivity: Activity() {
|
||||
class Helper {
|
||||
fun test(context: Context) {
|
||||
val b = context.getString(R.string.resource_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some string</string>
|
||||
</resources>
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
|
||||
class MyActivity: Activity() {
|
||||
class Helper {
|
||||
fun test(context: Context) {
|
||||
val b = "some <caret>string"
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.myapp
|
||||
|
||||
import android.content.Context
|
||||
|
||||
fun foo(context: Context) {
|
||||
with (context) {
|
||||
with (2) {
|
||||
getString(R.string.resource_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">zxc</string>
|
||||
</resources>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
package com.myapp
|
||||
|
||||
import android.content.Context
|
||||
|
||||
fun foo(context: Context) {
|
||||
with (context) {
|
||||
with (2) {
|
||||
"z<caret>xc"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package com.myapp
|
||||
|
||||
import android.content.Context
|
||||
|
||||
fun getSomeText(context: Context) {
|
||||
context.getString(R.string.resource_id)
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some text</string>
|
||||
</resources>
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.myapp
|
||||
|
||||
import android.content.Context
|
||||
|
||||
fun getSomeText(context: Context) {
|
||||
"some <caret>text"
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package com.myapp
|
||||
|
||||
import android.content.Context
|
||||
|
||||
fun <T: Context> T.getText(): String? = getString(R.string.resource_id)
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some text</string>
|
||||
</resources>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package com.myapp
|
||||
|
||||
import android.content.Context
|
||||
|
||||
fun <T: Context> T.getText(): String? = "some <caret>text"
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
|
||||
class MyActivity: Activity() {
|
||||
inner class Helper {
|
||||
fun a(): String = "q"
|
||||
|
||||
inner class HelperOfHelper {
|
||||
fun b(): String = getString(R.string.resource_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some string</string>
|
||||
</resources>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
|
||||
class MyActivity: Activity() {
|
||||
inner class Helper {
|
||||
fun a(): String = "q"
|
||||
|
||||
inner class HelperOfHelper {
|
||||
fun b(): String = "some <caret>string"
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
|
||||
class MyActivity: Activity() {
|
||||
inner class SubView constructor(context: Context): View(context) {
|
||||
fun test() {
|
||||
val b = context.getString(R.string.resource_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some string</string>
|
||||
</resources>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
|
||||
class MyActivity: Activity() {
|
||||
inner class SubView constructor(context: Context): View(context) {
|
||||
fun test() {
|
||||
val b = "some <caret>string"
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
|
||||
class MyActivity: Activity() {
|
||||
object A {
|
||||
fun doSomething(context: Context) {
|
||||
context.getString(R.string.resource_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some string</string>
|
||||
</resources>
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
|
||||
class MyActivity: Activity() {
|
||||
object A {
|
||||
fun doSomething(context: Context) {
|
||||
"some <caret>string"
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
|
||||
class MyActivity: Activity() {
|
||||
fun foo() {
|
||||
object {
|
||||
val text = getString(R.string.resource_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some string</string>
|
||||
</resources>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
|
||||
class MyActivity: Activity() {
|
||||
fun foo() {
|
||||
object {
|
||||
val text = "some <caret>string"
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
|
||||
fun foo(context: Context) {
|
||||
object {
|
||||
val text = context.getString(R.string.resource_id)
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some string</string>
|
||||
</resources>
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
|
||||
fun foo(context: Context) {
|
||||
object {
|
||||
val text = "some <caret>string"
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
val a = "some"
|
||||
val b = "text"
|
||||
val bar = "$a <caret>+ $b"
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource",
|
||||
"isApplicable": false
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
|
||||
class MyActivity: Activity() {
|
||||
fun View.foo() {
|
||||
val a = context.getString(R.string.resource_id)
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some string</string>
|
||||
</resources>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
|
||||
class MyActivity: Activity() {
|
||||
fun View.foo() {
|
||||
val a = "some <caret>string"
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
package com.myapp
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
|
||||
class DemoView constructor(context: Context): View(context) {
|
||||
fun test() {
|
||||
val b = context.getString(R.string.resource_id)
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="resource_id">some string</string>
|
||||
</resources>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.myapp
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
|
||||
class DemoView constructor(context: Context): View(context) {
|
||||
fun test() {
|
||||
val b = "some <caret>string"
|
||||
}
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rFile": "../../R.kt",
|
||||
"resDirectory": "../../res",
|
||||
"intentionClass": "org.jetbrains.kotlin.android.intention.KotlinAndroidAddStringResource"
|
||||
}
|
||||
Reference in New Issue
Block a user