Skip to content

Instantly share code, notes, and snippets.

@afrishberg
Created January 11, 2021 22:02
Show Gist options
  • Save afrishberg/255e03f6543dcb4d1b5dc71a8b5bf747 to your computer and use it in GitHub Desktop.
Save afrishberg/255e03f6543dcb4d1b5dc71a8b5bf747 to your computer and use it in GitHub Desktop.
Adapter.kt
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val dataItem = data[position]
holder.textView.text = dataItem.id.toString()
holder.textView.animate().rotation(
if (dataItem.rotated) 180.0f else 0.0f
).setDuration(400).start()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment