Skip to content

Instantly share code, notes, and snippets.

@AshuTyagi16
Created May 14, 2020 11:27
Show Gist options
  • Save AshuTyagi16/a8d6af6f391ee8b1c2afaaa0a3b36370 to your computer and use it in GitHub Desktop.
Save AshuTyagi16/a8d6af6f391ee8b1c2afaaa0a3b36370 to your computer and use it in GitHub Desktop.
inline fun <reified T : RecyclerView.ViewHolder> RecyclerView.forEachVisibleHolder(
action: (T) -> Unit
) {
for (i in 0 until childCount) {
action(getChildViewHolder(getChildAt(i)) as T)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment