Skip to content

Add quick scroll-to-top functionality via long press on Home button#1763

Merged
fire-light42 merged 7 commits intorecloudstream:masterfrom
onurcvnoglu:turn-fastly-homescreen
Jul 22, 2025
Merged

Add quick scroll-to-top functionality via long press on Home button#1763
fire-light42 merged 7 commits intorecloudstream:masterfrom
onurcvnoglu:turn-fastly-homescreen

Conversation

@onurcvnoglu
Copy link
Copy Markdown
Contributor

When users scroll down extensively on long pages, returning to the top can be inconvenient. With this update, users can now quickly return to the top of the main page by long-pressing the Home button, improving overall navigation and user experience.

Copilot AI review requested due to automatic review settings July 21, 2025 08:11

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

@fire-light42 fire-light42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand why you need 160 lines of code when you can accomplish the same result in 7.

for (view in listOf(binding?.navView, binding?.navRailView)) {
    view?.findViewById<View?>(R.id.navigation_home)?.setOnLongClickListener {
        val recycler = binding?.root?.findViewById<RecyclerView?>(R.id.home_master_recycler)
        recycler?.smoothScrollToPosition(0)
        return@setOnLongClickListener recycler != null
    }
}

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds scroll-to-top functionality that allows users to quickly return to the top of the main page by long-pressing the Home button in the navigation. This addresses the inconvenience of manually scrolling to the top on long pages.

  • Implements long press listener on Home navigation button to trigger scroll-to-top
  • Targets the home master recycler view for smooth scrolling to position 0
  • Applies functionality to both standard navigation view and rail navigation view
Files not reviewed (5)
  • .idea/AndroidProjectSystem.xml: Language not supported
  • .idea/compiler.xml: Language not supported
  • .idea/deploymentTargetSelector.xml: Language not supported
  • .idea/deviceManager.xml: Language not supported
  • .idea/runConfigurations.xml: Language not supported
Comments suppressed due to low confidence (3)

@onurcvnoglu
Copy link
Copy Markdown
Contributor Author

I reviewed and updated the codes. Thank you.

@fire-light42
Copy link
Copy Markdown
Collaborator

I reviewed and updated the codes. Thank you.

That is good, however you still have auto-generated files from your IDE in the .idea and .kotlin folder. Please remove those files as they are not relevant to other people. 👍

@onurcvnoglu
Copy link
Copy Markdown
Contributor Author

You're right. Thank you for your help and information. I've updated the code again.

@recloudstream recloudstream deleted a comment from Copilot AI Jul 22, 2025
@recloudstream recloudstream deleted a comment from Copilot AI Jul 22, 2025
@fire-light42 fire-light42 merged commit cc55559 into recloudstream:master Jul 22, 2025
2 checks passed
@Aurora3rs
Copy link
Copy Markdown

Aurora3rs commented Jul 22, 2025

This is a great feature, however it's only applicable to the Homepage, it would be better if it was the same for Library, especially since Library would normally be a long page and contain a lot of Movies/Series, in the "completed" section for e.g.
Thanks for your work.

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.

4 participants