Skip to content
Browse files

Added commenting.

  • Loading branch information...
1 parent df4708e commit 12d1658d5d8bd9efc1d75eaf567d88ef446b9118 @roughike committed
Showing with 50 additions and 0 deletions.
  1. +50 −0 swipe-selector/src/main/java/com/roughike/swipeselector/SwipeSelector.java
View
50 swipe-selector/src/main/java/com/roughike/swipeselector/SwipeSelector.java
@@ -187,18 +187,68 @@ protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container) {
dispatchThawSelfOnly(container);
}
+ /**
+ * Select an item at the specified position and animate the change.
+ *
+ * @param position the position to select.
+ */
public void selectItemAt(int position) {
selectItemAt(position, true);
}
+ /**
+ * Select an item at the specified position.
+ *
+ * @param position the position to select.
+ * @param animate should the change be animated or not.
+ */
public void selectItemAt(int position, boolean animate) {
mAdapter.selectItemAt(position, animate);
}
+ /**
+ * Select an item that has the specified value. The value was given
+ * to the {@link SwipeItem} when constructing it.
+ *
+ * For example, an item constructed like this:
+ *
+ * {@code
+ * new SwipeItem(1, "Example title", "Example description");
+ * }
+ *
+ * would have the value "1" (without the quote marks). Then you would
+ * select that item by using something like this:
+ *
+ * {@code
+ * swipeSelector.selectItemWithValue(1);
+ * }
+ *
+ * @param value the value of the item to select.
+ */
public void selectItemWithValue(Object value) {
selectItemWithValue(value, true);
}
+ /**
+ * Select an item that has the specified value. The value was given
+ * to the {@link SwipeItem} when constructing it.
+ *
+ * For example, an item constructed like this:
+ *
+ * {@code
+ * new SwipeItem(1, "Example title", "Example description");
+ * }
+ *
+ * would have the value "1" (without the quote marks). Then you would
+ * select that item by using something like this:
+ *
+ * {@code
+ * swipeSelector.selectItemWithValue(1, true);
+ * }
+ *
+ * @param value the value of the item to select.
+ * @param animate should the change be animated or not.
+ */
public void selectItemWithValue(Object value, boolean animate) {
mAdapter.selectItemWithValue(value, animate);
}

0 comments on commit 12d1658

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