-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvement(browse): re-implement scrolling #17839
base: main
Are you sure you want to change the base?
Conversation
Added in f0e4ceb or flags This was reverted, but the padding remained
Cause: 16620 (da72986) changed from a ListView to a RecyclerView and scrollbars were not included NOTE: commit message is incorrect due to a bad fixup ==== Fix I could not get `fastScrollEnabled` to work, and only a visual indicator was insufficient `recycler-fast-scroll` [Apache 2.0] was unmaintained but seemed like a reasonable solution. So it was vendored, refactored and used https://github.com/pluscubed/recycler-fast-scroll/tree/master Fixes 17786 ===== I tried `com.simplecityapps.recyclerview_fastscroll.views` * Rendering was slow * But it extended RecyclerView, rather than needing another View
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* https://github.com/pluscubed/recycler-fast-scroll/blob/3de76812553a77bfd25d3aea0a0af4d96516c3e3/library/src/main/java/com/pluscubed/recyclerfastscroll/RecyclerFastScroller.java |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this is vendored code, unsure how you want to review it
This comment was marked as outdated.
This comment was marked as outdated.
fun updateRvScroll(dY: Int) { | ||
try { | ||
recyclerView?.scrollBy(0, dY) | ||
} catch (t: Throwable) { | ||
Timber.w(t) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not going to have capacity to take on this issue this week.
The issue with this PR is in this line. With 60k cards, this renders most of them if you scroll from top to bottom in order to calculate what dy
means.
We need to move from a 'scroll' based scroller to a 'position' based scroller
Or, find another library if this is unacceptable.
I like this vendored library:
- Design is identical to ListView
- Fairly simple code given the domain
But if we can't make it fast, it needs to go
Purpose / Description
Cause: #16620 (da72986) changed from a ListView to a RecyclerView and scrollbars were not included
NOTE: commit above message is incorrect due to a bad fixup
Fixes
Approach
recycler-fast-scroll
[Apache 2.0] was unmaintained but seemed like a reasonable solution.So it was vendored, refactored and used
https://github.com/pluscubed/recycler-fast-scroll/tree/master
How Has This Been Tested?
S21. Colors are the same in night and light mode. Performance appears to be GREAT, but we can probably improve further.
Learning (optional, can help others)
I could not get
fastScrollEnabled
to work on a RecyclerView, and the visual indicator without allowing a user to scroll quickly was insufficientI tried
com.simplecityapps.recyclerview_fastscroll.views
Checklist