adam-codersgu / supernova

A Kotlin-based Android application that allows the user to play music from their device while custom animations fall over the album artwork of the currently playing song.
0 stars 0 forks source link

Implement a better scroll handler #58

Closed adam-codersgu closed 1 year ago

adam-codersgu commented 1 year ago

The current scroll handler is Current one https://github.com/timusus/RecyclerView-FastScroll

It would be beneficial to have one that's smoother and less glitchy but still displays the letter heads. Maybe borrow one from elsewhere or create one from scratch

adam-codersgu commented 1 year ago

Working on branch enhancement/recycler_view_scrollbar

adam-codersgu commented 1 year ago

All of the publicly available scrollbar solutions I have looked at have problems. A possible solution may be to create a vertical seekbar that appears down the right-hand side of the layout. The seekbar should have a fixed thumb height. The thumb should display the first character of the RecyclerView element at the scrolled position. This should dynamically changed. The scrollbar should also be programmatically notified of changes to the number of elements in the RecyclerView and scroll position etc.

adam-codersgu commented 1 year ago

If the above scrollbar solution is good, may be worth looking at releasing it as a library so it can be implemented in other projects. See https://developer.android.com/studio/publish-library

adam-codersgu commented 1 year ago

A useful log in case there are conflicts with the onTouch callback and the underlying RecyclerView

Log.e("DEBUGGING", "The coordinates of the touch are x: ${event?.x}" + " and y: ${event?.y}. The thumb Rect dimens are: $thumbRect")

adam-codersgu commented 1 year ago

Finished and merged https://github.com/adam-codersgu/supernova/pull/75. I created a scrollbar from scratch. A ticket will be created at a later date for publishing the scrollbar as a library