lsjwzh / RecyclerViewPager

Deprecated
Apache License 2.0
3.53k stars 667 forks source link

LoopRecyclerViewPager inside ViewPager doesn't scroll to right #179

Open damiafuentes opened 7 years ago

damiafuentes commented 7 years ago

A LoopRecyclerViewPager inside a Fragment of a ViewPager do not scroll to right. So the thing is that if I scroll to left the recyclerView scrolls, but if I scroll to right the viewPager scrolls and should scroll the recyclerView. Any idea?

damiafuentes commented 7 years ago

Finally I did this workaround in my ViewPager:

    @Override
    protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
        if(v instanceof LoopRecyclerViewPager){
            // To let the LoopRecyclerViewPager scroll to right and left
            return true;
        }
        return super.canScroll(v, checkV, dx, x, y);
    }