mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-23 04:43:07 +00:00
Common: fix parcelable-implementation for ConferenceGroup
This commit is contained in:
parent
2760969414
commit
5236832d23
1 changed files with 5 additions and 3 deletions
|
@ -9,24 +9,26 @@ import android.os.Parcelable
|
|||
indices = [Index(value = ["name"], unique = true)])
|
||||
data class ConferenceGroup(
|
||||
var name: String = ""
|
||||
): Parcelable, Comparable<ConferenceGroup> {
|
||||
): Comparable<ConferenceGroup>, Parcelable {
|
||||
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
var id: Long = 0
|
||||
|
||||
@ColumnInfo(name = "order_index")
|
||||
var index: Int = 1_000_000
|
||||
|
||||
constructor(parcel: Parcel) : this(parcel.readString()) {
|
||||
id = parcel.readLong()
|
||||
index = parcel.readInt()
|
||||
}
|
||||
|
||||
override fun compareTo(other: ConferenceGroup) = index.compareTo(other.index)
|
||||
override fun writeToParcel(parcel: Parcel, flags: Int) {
|
||||
parcel.writeString(name)
|
||||
parcel.writeLong(id)
|
||||
parcel.writeInt(index)
|
||||
}
|
||||
|
||||
override fun compareTo(other: ConferenceGroup) = index.compareTo(other.index)
|
||||
|
||||
override fun describeContents(): Int {
|
||||
return 0
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue