I'm using ViewDragHelper to slide a view to a new location, and I'm trying to use viewDragHelper.smoothSlideViewTo(dragView, x, y)
. The question is: How do I get a notification after the slide animation is complete? I'm looking for a way to listen to the slide animation events (especially something like onSlideAnimationComplete() ). Any idea folks?
private boolean smoothSlideTo(float slideOffset) {
final int topBound = getPaddingTop();
int x = (int) (slideOffset * (getWidth() - transformer.getMinWidthPlusMarginRight()));
int y = (int) (topBound + slideOffset * getVerticalDragRange());
if (viewDragHelper.smoothSlideViewTo(dragView, x, y)) {
ViewCompat.postInvalidateOnAnimation(this);
return true;
}
return false;
}