Skip to content

Instantly share code, notes, and snippets.

@kozmi55
Created Aug 16, 2021
Embed
What would you like to do?
class CarAdViewModel(
val make: String,
val model: String,
val price: String,
@get:Bindable var borderColor: Int
) : BaseObservable(), ItemViewModel {
override val layoutId: Int = R.layout.item_car_listing_ad
override val viewType: Int = CarListViewModel.AD_ITEM
fun onCarPriceClick() {
borderColor = getRandomColor()
notifyPropertyChanged(BR.borderColor)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment