In my program I must insert this onTouchEvent method in a BaseAdapter component:
public class FlipAdapter extends BaseAdapter {
...
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: {
startY = event.getY();
break;
}
case MotionEvent.ACTION_UP: {
float endY = event.getY();
if (endY > startY) {
layoutComments.startAnimation(animDown);
layoutComments.setVisibility(View.GONE);
}
}
}
return true;
}
This function works in an Activity (it's right) but in this component it's not works. I think that the problem is that the layoutComments is inserted in a ViewHolder, but I can't pass the view to the onTouchEvent. Any ideas?