Skip to content

Instantly share code, notes, and snippets.

@Krishan14sharma
Created November 10, 2017 12:01
Show Gist options
  • Save Krishan14sharma/7df8b7c521f55015ab885b0171f26f15 to your computer and use it in GitHub Desktop.
Save Krishan14sharma/7df8b7c521f55015ab885b0171f26f15 to your computer and use it in GitHub Desktop.
var rectIndex = Pair(0, 0)
var touching: Boolean = false
..
..
MotionEvent.ACTION_DOWN -> {
rectIndex = getRectIndexesFor(x, y)
touching = true
invalidate(squares[rectIndex.first][rectIndex.second])
}
MotionEvent.ACTION_UP -> {
touching = false
invalidate(squares[rectIndex.first][rectIndex.second])
}
..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment