尝试使用 simpleGestureDetector 检测 TextView 上的投掷:
public void onCreate(Bundle savedInstanceState) {
    ...
    textContent.setOnTouchListener(new View.OnTouchListener() {
        public boolean onTouch(View v, MotionEvent ev) {
                return gestureDetector.onTouchEvent(ev);
        }        
    });
}
class MyGestureDetector extends SimpleOnGestureListener {
    @Override
    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
            if(foo) {
                fooBar();
                return true;
            }
        return super.onFling(e1, e2, velocityX, velocityY);
    }
} 
从某种意义上说,fooBar()如果满足条件,我的代码就会运行foo,但我发现的问题是,当条件不满足时,返回 super.onFling() 会导致取消投掷,因为 textview手指抬起后,滚动不再继续。这是 XML:
<RelativeLayout
    android:id="@+id/main_area"
    android:layout_height="match_parent"
    android:layout_width="match_parent">
    <TextView
        android:id="@+id/main_text"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="10dp"
        android:textSize="16dp"
        android:lineSpacingExtra="2dip"
    />
</RelativeLayout>
有什么办法可以保持普通的滚动行为并仍然检测到投掷?
编辑:对不起,我的错,这与手势检测器无关,这只是因为我将 TextView 从其 ScrollView 中取出 - 由于某种原因,TextViews 似乎没有像 ScrollViews 那样平滑(惯性)滚动。