Skip to content
Browse files

Added choice for setting the items with or without animation.

  • Loading branch information...
1 parent c615f66 commit aa49b9c7f76cb800ad24fba3e0ab33a201ee49a2 @roughike committed
View
4 swipe-selector/src/main/java/com/roughike/swipeselector/SwipeAdapter.java
@@ -281,9 +281,9 @@ protected SwipeItem getSelectedItem() {
return mItems.get(mCurrentPosition);
}
- public void setSelectedItem(int position) {
+ public void setSelectedItem(int position, boolean animate) {
if (position >= 0 && position < mItems.size()) {
- mViewPager.setCurrentItem(position, true);
+ mViewPager.setCurrentItem(position, animate);
}
}
View
6 swipe-selector/src/main/java/com/roughike/swipeselector/SwipeSelector.java
@@ -188,7 +188,11 @@ protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container) {
}
public void setSelectedItem(int position) {
- mAdapter.setSelectedItem(position);
+ setSelectedItem(position, true);
+ }
+
+ public void setSelectedItem(int position, boolean animate) {
+ mAdapter.setSelectedItem(position, animate);
}
public void setSelectedItem(SwipeItem item) {

0 comments on commit aa49b9c

Please sign in to comment.
Something went wrong with that request. Please try again.