0
私はGridViewを持つAndroidアプリを持っています。GestureDetector conflit onFlingとonSingleTapUp
多くのイベントを検出する必要があり、GestureDetectorを使用する必要がありますが、グリッドアイテムをクリックすると、onSingleTapUp
の代わりにイベントonFling
がトリガーされることがあります。
私は間違っていますか?
class GestureDetectorGrid extends SimpleOnGestureListener
{
/**
* Sliding from right to the left to move to another grid
*/
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2,
float velocityX,float velocityY)
{
//my code
return false;
}
/**
* Go to another Activity by clicking on a element from the grid.
*/
@Override
public boolean onSingleTapUp(MotionEvent e)
{
//my code
return true;
}
@Override
public void onLongPress(MotionEvent e)
{
//my code
super.onLongPress(e);
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2,
float distanceX, float distanceY)
{
//my code
return true;
}
@Override
public void onShowPress(MotionEvent e)
{
super.onShowPress(e);
}
@Override
public boolean onDown(MotionEvent e)
{
//my code
return true;
}
}
私はAndroidのGestureDetectorがonFling
代わりonSingleTapUp
を前提として理由を知りたいので、私の質問は、重複は異なっています。それとも私が何か悪いことをしている場合。
[グリッドレイアウト上の情事のジェスチャ検出]の可能な重複(http://stackoverflow.com/questions/937313/fling-gesture-detection-on-gridを-レイアウト) –