parceler

Use of Parceler with Kotlin data class with constructor for serialization

北战南征 提交于 2020-01-22 10:33:46
问题 Is there a way to use Parceler with Kotlin data classes and constructor for serialization without using @ParcelProperty annotation for each field? If I try and use library like this: @Parcel data class Valve @ParcelConstructor constructor(val size: Int) I get Error:Parceler: No corresponding property found for constructor parameter arg0 . But if I add @ParcelProperty("size") it works just fine. Why is that? Update : There are other another way to use this library. I could just remove

Use of Parceler with Kotlin data class with constructor for serialization

混江龙づ霸主 提交于 2020-01-22 10:31:11
问题 Is there a way to use Parceler with Kotlin data classes and constructor for serialization without using @ParcelProperty annotation for each field? If I try and use library like this: @Parcel data class Valve @ParcelConstructor constructor(val size: Int) I get Error:Parceler: No corresponding property found for constructor parameter arg0 . But if I add @ParcelProperty("size") it works just fine. Why is that? Update : There are other another way to use this library. I could just remove

Android: convert Parcelable to JSON

∥☆過路亽.° 提交于 2020-01-05 03:39:06
问题 I am working with socket.io library which emits messages to the socket.io server. The server expects JSON objects, arrays, etc. My original implementation used JSONOject and JSONArray datatypes. However, I would like to switch to using classes generated via Parceler library. The classes generated with library's annotations can be wrapped into Parcels. It seems like a very convenient way of managing such communication. However, is there a way to convert Parceler's class or a Parcel class into

Pass bundle intent in android using MVP

人盡茶涼 提交于 2019-12-21 04:58:24
问题 I want to pass the Model data into another activity using Parceler through Bundle intent. My problem is how could I pass the data from Presenter into the View layer to display in another activity using MVP architecture in android? 回答1: This is certainly possible. Presuming that your Activity implements your View interface you'd have a method in the interface like: void startNextActivity(MyData data); Then in the Activity: @Override void startNextActivity(MyData data) { // create bundle //

DP5 7.0 - Does adding extras to a pending intent fail?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 07:54:26
问题 Adding the linked issue on tracker: https://code.google.com/p/android/issues/detail?id=216581&thanks=216581&ts=1468962325 So I installed the DP5 Android 7.0 release onto my Nexus 5X today. I've been working on an app that schedules local notifications at specific times using Android's AlarmManager class. Up until this release, the code has been working great on devices running KitKat, Lollipop, and Marshmallow. Below is how I'm scheduling the alarms: Intent intent = new Intent(context,

Unable to find generated Parcelable class

空扰寡人 提交于 2019-12-11 08:07:35
问题 I am trying to use Parceler in my android project. This is my Song model. @Parcel(implementations = {SongRealmProxy.class}, value = Parcel.Serialization.BEAN, analyze = {Song.class}) public class Song extends RealmObject { @PrimaryKey public String id; public String isrc; public String songName; public String artistName; public String album_id; public String albumArtUrl; public String genre_id; public String genreName; public String releaseYear; public String price; public String lyrics;

Proguard with Parceler and Realm

断了今生、忘了曾经 提交于 2019-12-11 06:54:27
问题 I'm using Realm and Parceler and everything is working fine but when I enable the Proguard I'm getting an error when doing: Parcels.wrap(obj) I'm getting the following error: org.parceler.ParcelerRuntimeException: Unable to find generated Parcelable class for io.realm.g, verify that your class is configured properly and that the Parcelable class io.realm.g$$Parcelable is generated by Parceler. Although I have configured the proguard rules like: ##---------------Begin: proguard configuration

Parceler and Lombok not working together?

血红的双手。 提交于 2019-12-07 13:11:38
问题 For my android app I use the parceler library and the lombok library. These are the annotations of my class: @Table @ToString @Getter @NoArgsConstructor @Parcel public class MyClass { However, during gradle build, Parceler complains that there is no default empty constructor. So does this mean it doesn't recognize the @NoArgsConstructor annotation and these two simply won't work together? Because e.g. SugarORM has no probs with it. Or am I just missing something? 回答1: This gets into how

Parceler and Lombok not working together?

試著忘記壹切 提交于 2019-12-06 03:23:21
For my android app I use the parceler library and the lombok library. These are the annotations of my class: @Table @ToString @Getter @NoArgsConstructor @Parcel public class MyClass { However, during gradle build, Parceler complains that there is no default empty constructor. So does this mean it doesn't recognize the @NoArgsConstructor annotation and these two simply won't work together? Because e.g. SugarORM has no probs with it. Or am I just missing something? This gets into how Lombok adds code to your class. Lombok uses a known trick in the Java annotation processor to add code to your

Pass bundle intent in android using MVP

坚强是说给别人听的谎言 提交于 2019-12-04 07:24:37
I want to pass the Model data into another activity using Parceler through Bundle intent. My problem is how could I pass the data from Presenter into the View layer to display in another activity using MVP architecture in android? This is certainly possible. Presuming that your Activity implements your View interface you'd have a method in the interface like: void startNextActivity(MyData data); Then in the Activity: @Override void startNextActivity(MyData data) { // create bundle // send intent } And in Presenter: view().startNextActivity(myData); However I don't recommend that you do this I