发布于 2018-03-08 14:07:41
在寻找了几个小时后,终于找到了一个变通办法/解决方案!这很简单,我知道可能没有人会再使用这个库了,但是你永远不会知道你可能会在某个时候用到它!
因此,基本上,Moondroid CoverFlow本身就是从applm的ma-components的另一个存储库派生出来的。
步骤1:所以您需要做的是将存储库(applm的ma组件)作为库导入到您的项目中。这样你就可以直接修改CoverFlow的代码了!
步骤2:导入库后,从com.martinappl.components.ui.containers打开EndlessLoopAdapterContainer!
步骤3:找到Adapter内部的fling方法,它应该是这样的:
public void fling(int velocityX, int velocityY){
mTouchState = TOUCH_STATE_FLING;
final int x = getScrollX();
final int y = getScrollY();
mScroller.fling(x, y, velocityX, velocityY, Integer.MIN_VALUE,Integer.MAX_VALUE, Integer.MIN_VALUE,Integer.MAX_VALUE);
invalidate();
}现在,只需在调用mScroller.fling()之前添加以下行:
velocityX *= 0.1; //change the float value as per your need, a lesser value will slow down the scroll speed就是这样,你已经成功地减慢了CoverFlow的滚动速度!
https://stackoverflow.com/questions/44922256
复制相似问题