Skip to content

Conversation

@terofeev
Copy link
Contributor

Hope this legacy 7-year-old issue is now eliminated :)

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

Fixes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I manually tested my changes on device/emulator (if applicable).

@naveensingh
Copy link
Member

This effectively disables upward scrolling:

  • Scroll down
  • Try to scroll up
  • Notice the pull-to-refresh indicator appears and no scrolling happens

Scrolling up is only possible if you scroll down and up in the same touch sequence.

@terofeev terofeev marked this pull request as draft May 19, 2025 07:12
@terofeev
Copy link
Contributor Author

This effectively disables upward scrolling:

  • Scroll down
  • Try to scroll up
  • Notice the pull-to-refresh indicator appears and no scrolling happens

Scrolling up is only possible if you scroll down and up in the same touch sequence.

Thanks, @naveensingh!

Marking this PR as Draft for further investigation.

The RecyclerViewFastScroller in items_fragment.xml breaks the proposed fix. If we comment out this block, the fix works as expected:

<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
    android:id="@+id/items_fastscroller"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:supportSwipeToRefresh="true">
…  
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>

The fast scroller dependency is archived (RecyclerView‑Fast‑Scroller).

Should we remove the RecyclerViewFastScroller (and its archived dependency) from items_fragment.xml altogether?

@naveensingh
Copy link
Member

The RecyclerViewFastScroller in items_fragment.xml breaks the proposed fix.

I did not see that coming. We can't remove the scrollbar, so how about overriding canChildScrollUp()?

    override fun canChildScrollUp(): Boolean {
        val directChild = getChildAt(0)
        return when (directChild) {
            is RecyclerViewFastScroller -> {
                val innerRecyclerView = // iterate on children and find it 
                innerRecyclerView?.canScrollVertically(-1) == true
            }
            else -> super.canChildScrollUp()
        }
    }

I have only briefly tested it, and it worked fine.

@terofeev terofeev marked this pull request as ready for review May 20, 2025 07:05
@terofeev
Copy link
Contributor Author

The RecyclerViewFastScroller in items_fragment.xml breaks the proposed fix.

I did not see that coming. We can't remove the scrollbar, so how about overriding canChildScrollUp()?

    override fun canChildScrollUp(): Boolean {
        val directChild = getChildAt(0)
        return when (directChild) {
            is RecyclerViewFastScroller -> {
                val innerRecyclerView = // iterate on children and find it 
                innerRecyclerView?.canScrollVertically(-1) == true
            }
            else -> super.canChildScrollUp()
        }
    }

I have only briefly tested it, and it worked fine.

Applied the suggested changes - it works perfectly now. Thanks! Marked this PR as ready. @naveensingh

@naveensingh
Copy link
Member

I will test and merge this soon. Thank you!

terofeev and others added 2 commits May 20, 2025 12:40
@naveensingh naveensingh merged commit 68c00dc into FossifyOrg:master May 20, 2025
4 of 5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants