0

I'm creating a new IME for android and I want to render a floating UI depending on the cursor's position. I've already found that if I override the onUpdateCursorAnchorInfo function of InputMethodService (Build version Lollipop or later) than I can get the coordinates of the cursor in the edittext, if I request the updates like: inputConnection.requestCursorUpdates(InputConnection.CURSOR_UPDATE_MONITOR).

But how can I calc the absolute coordinates of the cursor (from the top left corner) in the IME?? Is there a HACK or any solution for this? Please help me! What is this onUpdateCursorAnchorInfo function for if I cannot use it for rendering a view next to the cursor :( ?

bendaf
  • 2,981
  • 5
  • 27
  • 62

1 Answers1

0

This is for the IME(keyboard) developer only. If you are App developer, you may want to try getSelectionStart() method of TextView or other input instead.

vanna
  • 949
  • 2
  • 9
  • 16
  • Thanks for the answer, I am an IME developer :(. Actually I found the part of the solution, so I will edit my question, thanks for the reminder. :) – bendaf Aug 19 '15 at 11:19