The scroller would want to scroll through the list too quickly and the logic
would execute too much logic during the layout phase - for now just cap the max
scroll speed
https://cyanogen.atlassian.net/browse/MUSIC-174
Change-Id: I61ac30feb43afe672a8a38637b97ee622e332268
}
}
mWidthMeasureSpec = widthMeasureSpec;
+ mDragScroller.setListHeight(getHeight());
}
/**
private boolean mScrolling = false;
+ private int mMaxScrollSpeed;
+
public boolean isScrolling() {
return mScrolling;
}
}
+ public void setListHeight(final int height) {
+ // cap the max scroll speed per frame to be 1/5 of the list height
+ mMaxScrollSpeed = height / 5;
+ }
+
/**
* {@inheritDoc}
*/
dy = Math.round(mScrollSpeed * dt);
mScrollY += dy;
+ // cap the scroll speed
+ mScrollY = Math.max(Math.min(mScrollY, mMaxScrollSpeed), -mMaxScrollSpeed);
+
requestLayout();
mPrevTime += dt;