Skip to content

Feat: Optimize Leaderboard Scroll Performance and Add Go to Top Navigation#6905

Open
Kota-Jagadeesh wants to merge 3 commits into
commons-app:mainfrom
Kota-Jagadeesh:fix/leaderboard-fast-scroll
Open

Feat: Optimize Leaderboard Scroll Performance and Add Go to Top Navigation#6905
Kota-Jagadeesh wants to merge 3 commits into
commons-app:mainfrom
Kota-Jagadeesh:fix/leaderboard-fast-scroll

Conversation

@Kota-Jagadeesh

Copy link
Copy Markdown
Collaborator

Description (required)

Fixes #5768

What changes did you make and why?

  • converted the leaderboard Button to a MaterialButton to dynamically handle the text and the icon state switches based on scroll thresholds.
  • and replaced the linear smoothScrollToPosition() inside scrollToUserRank() with an optimized smartScrollTo() method. for long distances (e.g., traveling down to ranks like 12,000+), the app now uses scrollToPositionWithOffset() to teleport instantly close to the target position before performing a short, smooth scroll.
  • and added an OnScrollListener to the leaderboard_list RecyclerView. When a user scrolls past 20 items, the button dynamically updates to a "Go to Top" button (linked with a standard up arrow icon). tapping it smartly scrolls back to Rank

Tests performed (required)

Tested ProDebug on Redmi Note 13 Pro with API level 35

Screenshots (for UI changes only)

commons.mp4

@github-actions

Copy link
Copy Markdown

✅ Generated APK variants!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

My Rank button in the Leaderboard takes too long

1 participant