android.support.v7.widget.RecyclerView.SmoothScroller.Action的实例源码

项目:letv    文件:LinearSmoothScroller.java   
protected void onTargetFound(View targetView,State state,Action action) {
    int dx = calculateDxToMakeVisible(targetView,getHorizontalSnapPreference());
    int dy = calculateDyToMakeVisible(targetView,getVerticalSnapPreference());
    int time = calculateTimeForDeceleration((int) Math.sqrt((double) ((dx * dx) + (dy * dy))));
    if (time > 0) {
        action.update(-dx,-dy,time,this.mDecelerateInterpolator);
    }
}
项目:letv    文件:LinearSmoothScroller.java   
protected void onSeekTargetStep(int dx,int dy,Action action) {
    if (getChildCount() == 0) {
        stop();
        return;
    }
    this.mInterimTargetDx = clampApplyScroll(this.mInterimTargetDx,dx);
    this.mInterimTargetDy = clampApplyScroll(this.mInterimTargetDy,dy);
    if (this.mInterimTargetDx == 0 && this.mInterimTargetDy == 0) {
        updateActionForInterimTarget(action);
    }
}
项目:letv    文件:LinearSmoothScroller.java   
protected void updateActionForInterimTarget(Action action) {
    PointF scrollVector = computeScrollVectorForPosition(getTargetPosition());
    if (scrollVector == null || (scrollVector.x == 0.0f && scrollVector.y == 0.0f)) {
        Log.e(TAG,"To support smooth scrolling,you should override \nLayoutManager#computeScrollVectorForPosition.\nFalling back to instant scroll");
        action.jumpTo(getTargetPosition());
        stop();
        return;
    }
    normalize(scrollVector);
    this.mTargetVector = scrollVector;
    this.mInterimTargetDx = (int) (scrollVector.x * 10000.0f);
    this.mInterimTargetDy = (int) (scrollVector.y * 10000.0f);
    action.update((int) (((float) this.mInterimTargetDx) * TARGET_SEEK_EXTRA_SCROLL_RATIO),(int) (((float) this.mInterimTargetDy) * TARGET_SEEK_EXTRA_SCROLL_RATIO),(int) (((float) calculateTimeForScrolling(10000)) * TARGET_SEEK_EXTRA_SCROLL_RATIO),this.mLinearInterpolator);
}
项目:boohee_v5.6    文件:LinearSmoothScroller.java   
protected void onTargetFound(View targetView,this.mDecelerateInterpolator);
    }
}
项目:boohee_v5.6    文件:LinearSmoothScroller.java   
protected void onSeekTargetStep(int dx,dy);
    if (this.mInterimTargetDx == 0 && this.mInterimTargetDy == 0) {
        updateActionForInterimTarget(action);
    }
}
项目:boohee_v5.6    文件:LinearSmoothScroller.java   
protected void updateActionForInterimTarget(Action action) {
    PointF scrollVector = computeScrollVectorForPosition(getTargetPosition());
    if (scrollVector == null || (scrollVector.x == 0.0f && scrollVector.y == 0.0f)) {
        Log.e(TAG,this.mLinearInterpolator);
}

相关文章

买水果
比较全面的redis工具类
gson 反序列化到多态子类
java 版本的 mb_strwidth
JAVA 反转字符串的最快方法,大概比StringBuffer.reverse()性...
com.google.gson.internal.bind.ArrayTypeAdapter的实例源码...