Bimba.git

ref: dd2ee96d47a98c46ac7ca5a5631e01b8b40a4bea

app/src/main/java/ml/adamsprogs/bimba/models/StopSuggestion.kt


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package ml.adamsprogs.bimba.models

import android.os.Parcel
import android.os.Parcelable
import com.arlib.floatingsearchview.suggestions.model.SearchSuggestion

class StopSuggestion(text: String, val id: String) : SearchSuggestion {
    private val body: String = text

    constructor(parcel: Parcel) : this(parcel.readString(), parcel.readString())

    override fun describeContents(): Int {
        TODO("not implemented")
    }

    override fun writeToParcel(dest: Parcel?, flags: Int) {
        dest?.writeString(body)
        dest?.writeString(id)
    }

    override fun getBody(): String {
        return body
    }

    companion object CREATOR : Parcelable.Creator<StopSuggestion> {
        override fun createFromParcel(parcel: Parcel): StopSuggestion {
            return StopSuggestion(parcel)
        }

        override fun newArray(size: Int): Array<StopSuggestion?> {
            return arrayOfNulls(size)
        }
    }
}