Java Code Examples for com.nhaarman.listviewanimations.itemmanipulation.OnDismissCallback

The following examples show how to use com.nhaarman.listviewanimations.itemmanipulation.OnDismissCallback. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Constructs a new swipe-to-dismiss touch listener for the given list view.
 *
 * @param listView
 *            The list view whose items should be dismissable.
 * @param callback
 *            The callback to trigger when the user has indicated that she
 *            would like to dismiss one or more list items.
 */
public SwipeDismissListViewTouchListener(final AbsListView listView, final OnDismissCallback callback, final SwipeOnScrollListener onScroll) {
    ViewConfiguration vc = ViewConfiguration.get(listView.getContext());
    mSlop = vc.getScaledTouchSlop();
    mMinFlingVelocity = vc.getScaledMinimumFlingVelocity() * MIN_FLING_VELOCITY_FACTOR;
    mMaxFlingVelocity = vc.getScaledMaximumFlingVelocity();
    mAnimationTime = listView.getContext().getResources().getInteger(android.R.integer.config_shortAnimTime);
    mListView = listView;
    mCallback = callback;

    onScroll.setTouchListener(this);
    mListView.setOnScrollListener(onScroll);
}
 
Example 2
/**
 * Create a new SwipeDismissAdapter.
 *
 * @param baseAdapter       the {@link android.widget.BaseAdapter to use}
 * @param onDismissCallback the {@link OnDismissCallback} to be notified of dismissed items.
 */
public SwipeDismissAdapter(final BaseAdapter baseAdapter, final OnDismissCallback onDismissCallback) {
    this(baseAdapter, onDismissCallback, new SwipeOnScrollListener());
}
 
Example 3
/**
 * Create a new SwipeDismissAdapter.
 *
 * @param baseAdapter           the {@link android.widget.BaseAdapter to use}
 * @param onDismissCallback     the {@link OnDismissCallback} to be notified of dismissed items.
 * @param swipeOnScrollListener the {@link SwipeOnScrollListener} to use.
 */
public SwipeDismissAdapter(final BaseAdapter baseAdapter, final OnDismissCallback onDismissCallback, final SwipeOnScrollListener swipeOnScrollListener) {
    super(baseAdapter);
    mOnDismissCallback = onDismissCallback;
    mSwipeOnScrollListener = swipeOnScrollListener;
}