Last active
July 9, 2024 15:20
-
-
Save DanishAmjad12/fc98d215e255c20274e291fc41896391 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onBindViewHolder(h: RecyclerView.ViewHolder, position: Int, payloads: List<Any>) { | |
if (payloads.isNotEmpty()) { | |
val item = data[position] | |
for (payload in payloads) { | |
if (payload == payloadName) { | |
// in this case only like icon will be updated | |
(h as CardMovie).updateLikeIcon(movie) | |
} | |
} | |
} else { | |
// in this case regular onBindViewHolder will be called | |
super.onBindViewHolder(h, position, payloads) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment