Skip to content

Instantly share code, notes, and snippets.

@Krishan14sharma
Created November 11, 2017 11:18
Show Gist options
  • Save Krishan14sharma/11d257e6d7c1ae79f763b7018b3b6af5 to your computer and use it in GitHub Desktop.
Save Krishan14sharma/11d257e6d7c1ae79f763b7018b3b6af5 to your computer and use it in GitHub Desktop.
MotionEvent.ACTION_UP -> {
touching = false
invalidate(squares[rectIndex.first][rectIndex.second])
val (finalX1, finalY1) = getRectIndexesFor(x, y)
if ((finalX1 == rectIndex.first) && (finalY1 == rectIndex.second)) { // if initial touch and final touch is in same rectangle or not
squarePressListener?.onSquarePressed(rectIndex.first, rectIndex.second)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment