Skip to content

Instantly share code, notes, and snippets.

@kozmi55
Created August 16, 2021 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kozmi55/0edda91310c24d510d6441f896cd0f80 to your computer and use it in GitHub Desktop.
Save kozmi55/0edda91310c24d510d6441f896cd0f80 to your computer and use it in GitHub Desktop.
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