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

FlowLayoutManager数据不满屏的暂时解决办法 #22

Open
MageLin opened this issue Jan 3, 2018 · 0 comments
Open

FlowLayoutManager数据不满屏的暂时解决办法 #22

MageLin opened this issue Jan 3, 2018 · 0 comments

Comments

@MageLin
Copy link

MageLin commented Jan 3, 2018

@OverRide
public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state)
{
//位移0、没有子View 当然不移动
if (dy == 0 || getChildCount() == 0)
{
return 0;
}
//以下是边界判断
if (getItemCount() == getChildCount()
&& getDecoratedTop(getChildAt(0)) >= 0
&& (getHeight() - getPaddingBottom()) >= getDecoratedBottom(getChildAt(getChildCount() - 1)))
{
return 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

1 participant