castorflex / VerticalViewPager

Copy pasted version of the support ViewPager, but vertical!
1.11k stars 307 forks source link

setOnPageChangeListener doesn't work #6

Closed cesards closed 10 years ago

cesards commented 10 years ago

I've been trying to figure out why setOnPageChangeListener doesn't work with the VerticalViewPager. I do the next:

pagerView.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
      @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
       ...
      }

      @Override public void onPageSelected(int position) {
       ...
      }

      @Override public void onPageScrollStateChanged(int state) {
        i...
      }
    });

Methods are never called.

castorflex commented 10 years ago

Weird, it works great here :s Can you share more code?

cesards commented 10 years ago

I just solved the problem.

I'm using your library with ViewPagerIndicator. As VerticalViewPager is not extending support ViewPager, I had to hack a little bit VPI to make it work. It was not your library problem, so it's fixed.

I think the library would become more usable if it would extend ViewPager, because it has to be adjusted for every "ViewPager" need... I could try to have a look and study what we can do with it.

Do you think it's worth?

Regards!

MeetM commented 10 years ago

Hey Cesards, can you share what changes you did in the VPI to get it working with Vertical VP? Thanks

raychenon commented 8 years ago

The VerticalViewPager's OnPageChangeListener is set to null when ViewPagerIndicator is used. Please re open this ticket