Created
February 28, 2020 14:21
-
-
Save abbas-oveissi/9df1af6baf92464f9cb65311ece26816 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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