I got it working. I extended FrameLayout and overrided method dispathTouchEvent:
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_MOVE) {
//if move event occurs
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis() + 100;
float x = ev.getRawX();
float y = ev.getRawY();
int metaState = 0;
//create new motion event
MotionEvent motionEvent = MotionEvent.obtain(
downTime,
eventTime,
MotionEvent.ACTION_DOWN,
x,
y,
metaState
);
//I store a reference to listview in this layout
listview.dispatchTouchEvent(motionEvent); //send event to listview
return true;
}
return super.dispatchTouchEvent(ev);
}
Now the FrameLayout is clickable, but after MOVE happens, it creates a new MotionEvent and sends it to ListView, where the content is scrolled or swiped away. I should probably add some +- to MOVE event, because when you press with finger, you usually do some MOVE events with it.