liaohuqiu / android-Ultra-Pull-To-Refresh

Ultra Pull to Refresh for Android. Support all the views.
MIT License
9.59k stars 2.66k forks source link

上拉加载更多之后怎么滑倒底部啊,一直不行啊,用recyclerview的smothto #318

Open wudaotiantian opened 7 years ago

iielse commented 6 years ago

https://github.com/alibaba/vlayout/issues/187

看看这个吧

  @Override
    protected int getVerticalSnapPreference() {
        return SNAP_TO_START;
    }

可能有个 SNAP_TO_END 什么的

zhangman523 commented 6 years ago

实现了支持所有View 的上拉加载 https://github.com/zhangman523/LoadMoreViewLayout

timi-codes commented 6 years ago

Try this

mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
    @Override
    public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
        // TODO Auto-generated method stub
        //super.onScrollStateChanged(recyclerView, newState);
        int firstPos = mLayoutManager.findFirstCompletelyVisibleItemPosition();
        if (firstPos > 0) {
            ptrFrameLayout.setEnabled(false);
        } else {
            ptrFrameLayout.setEnabled(true);
        }
    }

    @Override
    public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
        super.onScrolled(recyclerView, dx, dy);
    }
});