Parcelable: Provide quick fixes for custom Parceler support
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
// "Annotate with ''@Parcelize''" "true"
|
||||
// ERROR: Class 'Foo' should be annotated with ''@Parcelize''
|
||||
// WITH_RUNTIME
|
||||
|
||||
package com.myapp.activity
|
||||
|
||||
import android.os.*
|
||||
import kotlinx.android.parcel.*
|
||||
|
||||
object StringParceler : Parceler<String> {
|
||||
override fun create(parcel: Parcel) = TODO()
|
||||
override fun String.write(parcel: Parcel, flags: Int) = TODO()
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
@TypeParceler<String, StringParceler>
|
||||
class Foo(<caret>val a: String) : Parcelable
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Annotate containing class with ''@Parcelize''" "true"
|
||||
// ERROR: Class 'Foo' should be annotated with ''@Parcelize''
|
||||
// WITH_RUNTIME
|
||||
|
||||
package com.myapp.activity
|
||||
|
||||
import android.os.*
|
||||
import kotlinx.android.parcel.*
|
||||
|
||||
object StringParceler : Parceler<String> {
|
||||
override fun create(parcel: Parcel) = TODO()
|
||||
override fun String.write(parcel: Parcel, flags: Int) = TODO()
|
||||
}
|
||||
|
||||
class Foo(@<caret>TypeParceler<String, StringParceler> val a: String)
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Remove redundant ''@TypeParceler'' annotation" "true"
|
||||
// WARNING: This annotation duplicates the one for Class 'Foo'
|
||||
// WITH_RUNTIME
|
||||
|
||||
package com.myapp.activity
|
||||
|
||||
import android.os.*
|
||||
import kotlinx.android.parcel.*
|
||||
|
||||
object StringParceler : Parceler<String> {
|
||||
override fun create(parcel: Parcel) = TODO()
|
||||
override fun String.write(parcel: Parcel, flags: Int) = TODO()
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
@TypeParceler<String, StringParceler>
|
||||
class Foo(<caret>val a: String) : Parcelable
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Remove redundant ''@TypeParceler'' annotation" "true"
|
||||
// WARNING: This annotation duplicates the one for Class 'Foo'
|
||||
// WITH_RUNTIME
|
||||
|
||||
package com.myapp.activity
|
||||
|
||||
import android.os.*
|
||||
import kotlinx.android.parcel.*
|
||||
|
||||
object StringParceler : Parceler<String> {
|
||||
override fun create(parcel: Parcel) = TODO()
|
||||
override fun String.write(parcel: Parcel, flags: Int) = TODO()
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
@TypeParceler<String, StringParceler>
|
||||
class Foo(@<caret>TypeParceler<String, StringParceler> val a: String) : Parcelable
|
||||
Reference in New Issue
Block a user