Skip to content

Instantly share code, notes, and snippets.

@JonCooperWorks
Last active April 10, 2019 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonCooperWorks/88551f03adb4c62b01041b131d970b96 to your computer and use it in GitHub Desktop.
Save JonCooperWorks/88551f03adb4c62b01041b131d970b96 to your computer and use it in GitHub Desktop.
override fun onTouch(v: View, event: MotionEvent): Boolean {
val x = event.x
val y = event.y
Log.d(TAG, "Touch coordinates: ($x, $y)")
// Android returns (0, 0) for all touches outside of our overlay.
// Since all overlays share this OnTouchListener, this condition will only be true when the
// user has clicked on the hole left for the clickjacked UI control.
if (x == 0.0F && y == 0.0F) {
onUserClickedOutsideOverlay()
}
return false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment