Skip to content

Commit

Permalink
Merge pull request daimajia#52 from RichardHan/master
Browse files Browse the repository at this point in the history
add move to prev & next method.
  • Loading branch information
daimajia committed Nov 24, 2014
2 parents 44bfc8d + 28d2dfb commit 4a70d46
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -640,4 +640,26 @@ public void removeAllSliders(){
mViewPager.setCurrentItem(mViewPager.getCurrentItem() + count,false);
}
}

/**
* move to prev slide.
*/
public void movePrevPosition() {

if (getRealAdapter() == null)
throw new IllegalStateException("You did not set a slider adapter");

mViewPager.setCurrentItem(mViewPager.getCurrentItem() - 1, true);
}

/**
* move to next slide.
*/
public void moveNextPosition() {

if (getRealAdapter() == null)
throw new IllegalStateException("You did not set a slider adapter");

mViewPager.setCurrentItem(mViewPager.getCurrentItem() + 1, true);
}
}

0 comments on commit 4a70d46

Please sign in to comment.