Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

listview in viewpager 有问题当数据源的size=3,切换的时候数据源左边和右边的个数会改变

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
mobile

Research direction

Start by reproducing the ViewPager/ListView behavior with a data source of size 3, then inspect the shown scrollTo override and the isTopHidden condition. Verify the header, adjacent item counts, and bottom ListView respond correctly to an upward fling after the header hides.

Written by the indexing model from the issue text.

Description

bug : listview in viewpager 有问题当数据源的size=3,切换的时候数据源左边和右边的个数会改变
question:当头部可见时,用力向上滑,当头部隐藏后,底部的ListView中的类容不会通过惯性自动向上滑动,但我见过的其他应用是可以惯性滑动的,例如QQ音乐,魅族应用中心详情
看了代码是吧height的大小限制,要实现例如新浪微博的评论效果,要怎么做呢
@Override
public void scrollTo(int x, int y) {
if (y < 0) {
y = 0;
}
Log.e("scrollTo", "y======" + y);
if (y > mTopViewHeight) {
y = mTopViewHeight;
}
if (y != getScrollY()) {
super.scrollTo(x, y);
}

    isTopHidden = getScrollY() == mTopViewHeight;

}
Dominant language
Java
Stars
1.4k
Forks
437
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hongyangAndroid/Android-StickyNavLayout

All issues in hongyangAndroid/Android-StickyNavLayout

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.