I have a container View
that should process touches. It has Listview
with overrided onTouch()
, which returns false
(it will return true
, when container is expanded by swipe). When Listview
touch occurs it passes to container View
and everything is ok. But I need to add click handling for items of Listview
.
When I set onClickListener
for item, I see in logs it is no MotionEvent
passed to container, it is stucked in ListView
onTouch()
(which return false
and does nothing). I'm trying to set onTouchListener
for item like this:
viewHolder.itemLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
return true;
case MotionEvent.ACTION_MOVE:
return false;
case MotionEvent.ACTION_UP:
Log.d(TAG, "something like click detected");
return true;
}
return false;
}
});
But result is the same. Can someone explain why my container does not receive touch event even ListView
returns false
for its overrided onTouch()
?