I have a StackView
which has custom items
that contains RecyclerView
.
I dont't want the user to switch the stackview
by himself , instead I wanted it to switch it programmaticaly when all the questions inside the RecyclerView
is answered .
When I scroll StackView
gets switched some time , and RecyclerView
scrolls sometime .
my code
rvScore.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
@Override
public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
int action = e.getAction();
switch (action) {
case MotionEvent.ACTION_MOVE:
rv.getParent().requestDisallowInterceptTouchEvent(true);
break;
}
return false;
}
@Override
public void onTouchEvent(RecyclerView rv, MotionEvent e) {
}
@Override
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
}
});
If need full code I can post it