我收到了这段代码:
@Override
public boolean onTouchEvent(MotionEvent event)
{
switch(event.getAction())
{
case MotionEvent.ACTION_DOWN:
x1 = event.getX();
break;
case MotionEvent.ACTION_UP:
x2 = event.getX();
float deltaX = x2 - x1;
if (Math.abs(deltaX) > MIN_DISTANCE)
{
}
else
{
}
break;
}
return super.onTouchEvent(event);
}
...我应该让onTouchEvent激活/仅执行以下操作:
(不是两个在同一时间)