Skip to content

Instantly share code, notes, and snippets.

@ataulm
Last active August 18, 2020 16:29
Show Gist options
  • Save ataulm/2f9797529ada70df4721ec0e3bcfe8a3 to your computer and use it in GitHub Desktop.
Save ataulm/2f9797529ada70df4721ec0e3bcfe8a3 to your computer and use it in GitHub Desktop.
override fun getVirtualViewAt(x: Float, y: Float): Int {
ratingsHistogram?.let {
val intervalWidth = width.toFloat() / it.intervals.size
return min((x / intervalWidth).toInt(), it.intervals.size - 1)
}
return HOST_ID
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment