List of usage examples for android.widget EdgeEffect onAbsorb
public void onAbsorb(int velocity)
From source file:net.simonvt.staggeredgridview.StaggeredGridView.java
@Override public void computeScroll() { if (scroller.computeScrollOffset()) { final int y = scroller.getCurrY(); final int dy = (int) (y - lastTouchY); lastTouchY = y;//from w w w .j a v a 2 s.c o m final boolean stopped = !trackMotionScroll(dy, false); if (!stopped && !scroller.isFinished()) { postInvalidateOnAnimation(); } else { if (stopped) { final int overScrollMode = getOverScrollMode(); if (overScrollMode != OVER_SCROLL_NEVER) { final EdgeEffect edge; if (dy > 0) { edge = topEdge; } else { edge = bottomEdge; } edge.onAbsorb(Math.abs((int) scroller.getCurrVelocity())); postInvalidateOnAnimation(); } scroller.abortAnimation(); } touchMode = TOUCH_MODE_IDLE; } } }