Skip to content

Instantly share code, notes, and snippets.

@oscarg798
Created April 24, 2020 18:10
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 oscarg798/b2c85f73cb139b521e72d4041f236709 to your computer and use it in GitHub Desktop.
Save oscarg798/b2c85f73cb139b521e72d4041f236709 to your computer and use it in GitHub Desktop.
override fun onBindViewHolder(
holder: ProductViewHolder,
position: Int,
payloads: MutableList
) {
if (payloads.isEmpty()) {
onBindViewHolder(holder, position)
} else {
for (data in payloads) {
when (data as Int) {
INVALID_PRODUCT_POSITION -> holder.updateProductQuantity(products[position].quantityInCart)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment