AndroidIDE icon indicating copy to clipboard operation
AndroidIDE copied to clipboard

doubletap/longpress one-word selection

Open dhaigit opened this issue 3 years ago • 2 comments

Could we have doubletapping and longpressing select only one word as it was a couple of commits ago?

We should always start with one word as we only have "expand" and no "contract". It would mean we could never be able to select a single word without dragging the handles manually.

dhaigit avatar Feb 05 '22 05:02 dhaigit

This happens because the editor uses Android's BreakIterator on Android 24 and higher for selecting words on long press . See this.

itsaky avatar Feb 14 '22 09:02 itsaky

This happens because the editor uses Android's BreakIterator on Android 24 and higher for selecting words on long press . See this.

Intercepting the editor's LongClickEvent and DoubleClickEvent to call setSelectionRegion() with custom arguments can modify this default behavior. Note that this should be done in the last listener you added for this type of event or other listeners of this type will not receive the intercepted event.

Rosemoe avatar Feb 14 '22 13:02 Rosemoe