I have a fullscreen TextView
with a very long text, ie. like a story with say 400 lines.
I would like to be able to drop icons into the TextView, then insert some text in the position where the icon was dropped.
For example, i drop the icon at the coordinates 400,1700 and that corresponds to the word 'especialmente' at the string position 597 (see screenshot)
I have the DnD thing done, however, I don't know how to calculate the indexOf
of the TextView
from the droped coordinates.
Is there a simple way to do it ? Or this will get that complex so as to create StaticLayout
's and a ton of math?