Skip to content

Instantly share code, notes, and snippets.

@kshvkantg
Created December 17, 2022 19:26
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 kshvkantg/706b6d74d09b608b75e0df78c8b32517 to your computer and use it in GitHub Desktop.
Save kshvkantg/706b6d74d09b608b75e0df78c8b32517 to your computer and use it in GitHub Desktop.
private fun providePropertyChangedCallback(): OnPropertyChangedCallback {
return object : OnPropertyChangedCallback()
override fun onPropertyChanged(sender: Observable?, propertyId: Int) {
val product = sender as Product
viewModel.setDataMediatorValue (
!(product.quantity == null || product.quantity == 0 ||
product.weight.isNullOrEmpty() ||
(product.weight ?: "0.00").toDouble() == 0.00
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment