vilnius / tvarkau-vilniu

Tvarkau Vilniu Android app
https://play.google.com/store/apps/details?id=lt.vilnius.tvarkau
MIT License
24 stars 14 forks source link

Parceler warnings with Kotlin data class #152

Closed vycius closed 6 years ago

vycius commented 7 years ago

There is a lot of warnings from Parceler when used with Kotlin data class:

Warning:Parceler: Reflection is required to access private field: String thumbnail, consider using non-private.

Consider moving to another library for better Kotlin support e.g https://github.com/grandstaish/paperparcel

mjurkus commented 7 years ago

More info is here: http://grandstaish.github.io/paperparcel/

I don't know... Don't really like extending and implementing interface for each of the models.

vycius commented 7 years ago

Parcelable is interface on Android. So you need to implement this interface if you want use Bundle::putParcelable without any additional methods. Parceler needs @Parcel annotation, Paperparcel needs @PaperParcel annotation. With Paperparcel there is no Parcels::wrap and Parcels::unwrap, but you need to extend with : PaperParcelable and define CREATOR in companion object. KT example https://github.com/grandstaish/paperparcel/blob/master/examples/kotlin-example/src/main/kotlin/nz/bradcampbell/kotlinexample/State.kt

mjurkus commented 6 years ago

Irrelevant with Kotlin's Parcelize