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 :( ?