Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoordinatorLayout嵌套SwipeToLoadLayout出现滑动冲突 #143

Open
duxgwork opened this issue Jan 17, 2018 · 4 comments
Open

CoordinatorLayout嵌套SwipeToLoadLayout出现滑动冲突 #143

duxgwork opened this issue Jan 17, 2018 · 4 comments

Comments

@duxgwork
Copy link

duxgwork commented Jan 17, 2018

问题:在CoordinatorLayout中嵌套ViewPager,ViewPager的Fragment中使用SwipeToLoadLayout嵌套RecyclerView。向下拉RecyclerView列表时,当CoordinatorLayout的头部还没完全隐藏时,就已经启动下拉刷新状态(换成Google自带的SwipeRefreshLayout刷新控件则没有此问题,因为SwipeRefreshLayout实现了NestedScrollingParent和NestedScrollingChild接口,而SwipeToLoadLayout则没有实现这两个接口)。希望在下个版本中优化此问题,谢谢。

@soonlen
Copy link

soonlen commented Apr 2, 2018

我也发现了这个问题怎么解决叱?

@joevess
Copy link

joevess commented Apr 18, 2018

同样嵌套遇见类似的问题,上拉加载不会显示立刻请求,感觉是这个滑动事件冲突

@jackli688
Copy link

遇到过类似的问题,当RecyclerView中的数据不足刚刚满足一页的时候,最后一条条目显示不全。

@cagezhao
Copy link

cagezhao commented Dec 4, 2024

public class MainHomeFragment extends BaseFragment implements AppBarLayout.OnOffsetChangedListener{

@Bind(R.id.app_bar_layout)
AppBarLayout app_bar_layout;
@Bind(R.id.swipeToLoadView)
SwipeToLoadView swipeToLoadView;

private void initDisplay() {
    app_bar_layout.addOnOffsetChangedListener(this);
}

@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int i) {
    // i == 0 就代表AppBarLayout展开了
    if (!swipeToLoadView.isRefreshing()) 
        swipeToLoadView.setRefreshEnabled(i==0);
}

}

参考别人的回答,设置开关控制吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants