Fix bug where dragview gets stuck on screen.

* Since the BubbleTextViews views do not have a listener, the long press
  was still getting triggered even though it was in a pressed state.
* We only trigger long press if the view is not pressed or if there is no listener.
* A listener is only added for widgets, and for long press wiidgets are not
  pressed state.

Bug: 162636845
Test: manual test, repo steps in bug
Change-Id: Ia9df12cf31a0844403d69ddacebf2bdbc5c59d3b
(cherry picked from commit 6fa63473e1)
This commit is contained in:
Jon Miranda
2021-01-25 15:30:26 -05:00
committed by Jonathan Miranda
parent 5662a653da
commit b453ef7621

View File

@@ -115,7 +115,7 @@ public class CheckLongPressHelper {
private void triggerLongPress() {
if ((mView.getParent() != null)
&& mView.hasWindowFocus()
&& (!mView.isPressed() || mListener == null)
&& (!mView.isPressed() || mListener != null)
&& !mHasPerformedLongPress) {
boolean handled;
if (mListener != null) {