Skip to content
Commit c103424e authored by Tony Mak's avatar Tony Mak
Browse files

Revert "Do not invoke textclassifier when dimissing the selection"

Reverting ag/13435448.

The bug that the change fixed was that TextView invokes classifyText
when the selection is going to be dimissed due to an ACTION_UP event.
The fix was that we only  call showFloatingToolbar() if users are
dragging the selection curosr when we get an ACTION_UP event.

QA has found a bug recently.
When user selects some text and then scrolls the TextView, we hide the
floating toolbar temporarily. When user finishes scrolling, TextView
does not reshow the toolbar immediately due to the fix.

I don't have a fix that I feel comfortable to get into S given
that we are pretty late in the process, so reverting the fix.

Some more details:
IMO, the fix should be calling showFloatingToolbar() only if
TextView has a selection(i.e. TextView.hasSelection()) when we are
processing the ACTION_UP event in updateFloatingToolbarVisibility().
Sadly, it does not work because the selection is not actually dismissed
yet when we are trying to update the visiblity of
the floating toolbar in updateFloatingToolbarVisibility().
The selection is actually dismissed when Editor.onTouchUpEvent is
called to handle the UP event, but updateFloatingToolbarVisibility() is
called before that :/

Moving around the code so that updateFloatingToolbarVisibility() is
called after Editor.onTouchEvent() may work, but I am not comfortable
to get in a risky change like this at the moment.

Reason for revert: b/187862341

Bug: 187862341

Change-Id: Ic49c6792dc86c01fcc78a4d3bc5bfd85b7772197
parent 90e8a19f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment