Skip to content

Instantly share code, notes, and snippets.

@abbas-oveissi
Created February 28, 2020 14:21
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 abbas-oveissi/9df1af6baf92464f9cb65311ece26816 to your computer and use it in GitHub Desktop.
Save abbas-oveissi/9df1af6baf92464f9cb65311ece26816 to your computer and use it in GitHub Desktop.
int getTouchedLine(float y) {
int line = 0;
for (int i = 0; i < layout.getLineCount(); i++) {
if (y > layout.getLineTop(i) && y < layout.getLineBottom(i)) {
line = i;
break;
}
}
return line;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment