mathew-kurian / TextJustify-Android

:page_facing_up: Android Text Full Jusiftication / Wrapping / Justify / Hyphenate - V2.0
https://github.com/bluejamesbond/TextJustify-Android/wiki
Apache License 2.0
1.86k stars 370 forks source link

Functionality similar to TextView's getOffsetForPosition #81

Open sigrlami opened 9 years ago

sigrlami commented 9 years ago

I'm currently using TextView and getting character offset closest to the specified absolute position by 2 coordinates like this

tvWords.getOffsetForPosition(coordinates.get(0), coordinates.get(1));

I want to achieve similar functionality with DocumentView. There is only 2 methods now getOffsetX(), getOffsetY() which is not enough

tvWords.getDocumentLayoutParams().getOffsetX()
tvWords.getDocumentLayoutParams().getOffsetY()

Is there some way around, so I don't need to implement it myself?