Created
June 28, 2020 22:09
-
-
Save NewtronLabs/c9fab6579c9c7cf643de5dd75136b2a2 to your computer and use it in GitHub Desktop.
IpcEventBus-conclusion.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EventExample : EventIpcSimple { | |
private var mData: IData? = null | |
constructor(data: IData?) { | |
mData = data | |
} | |
internal constructor(`in`: Parcel) { | |
readFromParcel(`in`) | |
} | |
override fun readFromParcel(parcel: Parcel) { | |
// Must be done for every object in the event. | |
mData = | |
ParcelHelper.getInstance().createFromParcel<IData>(parcel, IData::class.java) as IData | |
} | |
override fun writeToParcel(dest: Parcel, flags: Int) { | |
// Must be done for every object in the event. | |
ParcelHelper.getInstance().writeToParcel(dest, flags, mData) | |
} | |
val data: IData? | |
get() = mData | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment