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

topview为横向RecyclerView时,滑动导致头部缩回。

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

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, java
Domain
mobile-dev

Research direction

Start in StickyNavLayout and reproduce the issue with id_stickynavlayout_topview containing a horizontally scrolling RecyclerView. Inspect the velocityY branch around mOffsetAnimator and compare horizontal scrolling with upward scrolling. Done means horizontal gestures no longer collapse the topview while the intended upward animation still works.

Written by the indexing model from the issue text.

Description

当id_stickynavlayout_topview包含可以左右滑动的RecyclerView时,左右滑动recyclerView会导致头部topview缩回。看了一下StickyNavLayout中下面这几行代码导致了topview缩回。

        if (velocityY >= 0) {
            mOffsetAnimator.setIntValues(currentOffset, topHeight);
            mOffsetAnimator.start();
        }

velocityY > 0 或者注释掉 mOffsetAnimator.start();可以解决。但似乎破坏了velocityY>=0时上滑的动画逻辑?
看了一下这里的代码是后来模仿AppLayoutBar merge进来的,是不是还有一点问题。

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.