I have a ViewPager
with two different Fragments
into another Fragment
(I am using NavigationBar). Into the first Fragment of my ViewPager I have a particular view (a scrollable android chart made by MP Android Chart) which has to be navigated horizontally by swipes. I want to disable the swype of the Fragment during the swype of this view, is that possible?
EDIT
I am using such a class to extend the ViewPager:
public class Cl_ViewPager extends ViewPager {
private boolean isPagingEnabled = true;
public Cl_ViewPager (Context context) {
super(context);
}
public Cl_ViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
return this.isPagingEnabled && super.onTouchEvent(event);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
return this.isPagingEnabled && super.onInterceptTouchEvent(event);
}
public void setPagingEnabled(boolean b) {
this.isPagingEnabled = b;
}
}
But what I want to achieve is: disable the swipe IF the swipe is done within a certain view (my chart). So far anything helped me.