Skip to content

Commit 8de543f

Browse files
author
Eric Leong
committed
Fix issues with the fallback touch listener.
1 parent 1bdf23c commit 8de543f

File tree

1 file changed

+11
-5
lines changed
  • backboard/src/main/java/com/tumblr/backboard

1 file changed

+11
-5
lines changed

backboard/src/main/java/com/tumblr/backboard/Actor.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,17 @@ private class MotionListener implements View.OnTouchListener {
600600
@SuppressLint("ClickableViewAccessibility")
601601
public boolean onTouch(@NonNull final View v, @NonNull final MotionEvent event) {
602602

603-
if (!mMotionListenerEnabled) {
603+
final boolean retVal;
604+
605+
if (!mMotionListenerEnabled || mMotions.isEmpty()) {
604606

605607
if (mOnTouchListener != null) {
606-
mOnTouchListener.onTouch(v, event);
608+
retVal = mOnTouchListener.onTouch(v, event);
609+
} else {
610+
retVal = false;
607611
}
608612

609-
return false;
613+
return retVal;
610614
}
611615

612616
for (Motion motion : mMotions) {
@@ -616,7 +620,9 @@ public boolean onTouch(@NonNull final View v, @NonNull final MotionEvent event)
616620
}
617621

618622
if (mOnTouchListener != null) {
619-
mOnTouchListener.onTouch(v, event);
623+
retVal = mOnTouchListener.onTouch(v, event);
624+
} else {
625+
retVal = true;
620626
}
621627

622628
if (mRequestDisallowTouchEvent) {
@@ -648,7 +654,7 @@ public boolean onTouch(@NonNull final View v, @NonNull final MotionEvent event)
648654
}
649655
}
650656

651-
return true;
657+
return retVal;
652658
}
653659
}
654660
}

0 commit comments

Comments
 (0)