-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix(Card Browser): ANR on using scrollbar #20176
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
base: main
Are you sure you want to change the base?
Conversation
1532f08 to
38247e7
Compare
Please clarify this In general, if you can list 'reverted X', then name the commit which is in I believe the commit is: ca95728 |
Ah, by new function I meant the overriding of onTouchEvent which I had done for the main issue of tap and drag, should've phrased it better oops. Will edit the commit message now. |
Would I not have to mention 3c0b2bb since I removed the onTouchListener introduced in that commit, wouldn't it be better to write 'Reverts the onTouchListener introduced in 3c0b2bb'? I could be confusing the meaning of revert here so I just wanted to clarify. |
38247e7 to
8758ff8
Compare
|
Not sure if the new commit description works, but it made sense like this in my head |
8758ff8 to
8a597c3
Compare
|
@david-allison do we want to draft since the new browser redesign is coming? |
|
Let's keep going with this. The redesign will be dev only for a long time, and I expect "production" features to break it. In addition, I'm mostly reworking search, the rendered rows won't change |
criticalAY
left a comment
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 tested it since you removed had the logic set by pixels and you are counting items by number, add cards with uneven content (basically not equal height for all cards) then scroll the cards you will see a sudden snap while browsing the list
Could I have the deck file? I think either way, it has to be a tradeoff since if we revert to pixels then ANR is possible for decks with a large number of cards so we wouldn't be able to implement the tap and drag functionality otherwise we stick to using indexes to solve this issue but there would be the snapping you mentioned. I will look into it more though once I reproduce and see what I can do Edit: I've reproduced it and I see the issue, will try and figure something out |
4886586 to
2581ef4
Compare
|
I implemented a fix but it's more of just a band-aid. We basically just use proportional scrolling rather than calculating pixels so it changes according to the size of the card, thereby making it smoother and not jumpy but in my testing there still is a little jump when you have very varied sizes. |
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.
LGTM (from a code perspective), feel free to accept/reject comments, as I feel they're all subjective nitpicks
AnkiDroid/src/main/java/com/ichi2/anki/ui/RecyclerFastScroller.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/ui/RecyclerFastScroller.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/ui/RecyclerFastScroller.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/ui/RecyclerFastScroller.kt
Outdated
Show resolved
Hide resolved
2581ef4 to
eb1b1d8
Compare
|
I think I really messed up the git in my branch.. |
eb1b1d8 to
fa980c4
Compare
8091db2 to
d328016
Compare
cd232df to
f73206d
Compare
|
undo the 'merge' and rebase instead |
902087b to
9351bff
Compare
|
My review still stands, Cheers! I'm going to unwatch this one, ping me if I'm needed |
fc1e468 to
1f12a3e
Compare
1f12a3e to
f451e03
Compare
criticalAY
left a comment
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.
Ok! now I am happy, LGTM
Purpose / Description
ANR when the scrollbar was dragged or tapped in larger collections, arose due to the addition of pr #19980
Fixes
Approach
I deleted the previous delta based logic implemented and let the new function handle dragging and tapping which doesn't cause ANRs, for extra optimisation added a scrolltopositionwithoffset.
How Has This Been Tested?
Tested the scrolling with a deck of 100k cards and found no issue on rapid scrolling for 30 seconds along with taps throughout the browser
Checklist
Please, go through these checks before submitting the PR.