com.nhaarman.listviewanimations.itemmanipulation.OnDismissCallback Java Examples
The following examples show how to use
com.nhaarman.listviewanimations.itemmanipulation.OnDismissCallback.
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
Source File: SwipeDismissListViewTouchListener.java From android-open-project-demo with Apache License 2.0 | 5 votes |
/** * 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
Source File: SwipeDismissAdapter.java From android-open-project-demo with Apache License 2.0 | 2 votes |
/** * 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
Source File: SwipeDismissAdapter.java From android-open-project-demo with Apache License 2.0 | 2 votes |
/** * 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; }