Skip to content

图片滑动效果不连贯 #6

@Fessible

Description

@Fessible

布局上添加图片以后,当滑动到临界位置进行切换时,会有小小的跳动动画。
无限循环时效果不是非常完美。

不完美处在这里

@OverRide
public void onPageSelected(int position) {
curPosition = position;

    if (curPosition == list.size() - 1 || curPosition == 0) {
        final int newReplacePosition = getRealPosition(curPosition);
   
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                viewPager.setCurrentItem(newReplacePosition,false);
            }
        },250);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions