Assigned
Status Update
Comments
vi...@gmail.com <vi...@gmail.com> #2
vi...@google.com <vi...@google.com> #3
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Expected output
What is the expected output?
Current output
What is the current output?
logcat output
Seehttp://developer.android.com/tools/help/logcat.html . Copy and paste relevant sections of the logcat output into this issue.
Android bug report capturing
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Expected output
What is the expected output?
Current output
What is the current output?
logcat output
See
Android bug report capturing
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
vi...@gmail.com <vi...@gmail.com> #4
I've attached a release (signed) apk that reproduces the issue.
You'll need to login into the app in order to see the issue. I've hardcoded a user email and passowrd for you so that you only need to click the login button. To perform the login do:
1) Run the app
2) On the very first screen, click on the text "Ya tengo cuenta" above the yellow button. This opens the login screen.
3) On the login screen, just click the yellow button at the bottom to perform the login. This opens the MainActivity, which contains the horizontal RecyclerView with the PagerSnapHelper in which you can observe the infinite horizontal oscillation.
4) Once on the MainActivity, swipe horizontally to the left a few times. To reproduce the horizontal oscillation, scroll horizontally to the left or right a bit, then stop scrolling (ie. keep your finger motionless), and then lift the finger. The RecyclerView should start moving left right oscillating indefinitely.
You'll need to login into the app in order to see the issue. I've hardcoded a user email and passowrd for you so that you only need to click the login button. To perform the login do:
1) Run the app
2) On the very first screen, click on the text "Ya tengo cuenta" above the yellow button. This opens the login screen.
3) On the login screen, just click the yellow button at the bottom to perform the login. This opens the MainActivity, which contains the horizontal RecyclerView with the PagerSnapHelper in which you can observe the infinite horizontal oscillation.
4) Once on the MainActivity, swipe horizontally to the left a few times. To reproduce the horizontal oscillation, scroll horizontally to the left or right a bit, then stop scrolling (ie. keep your finger motionless), and then lift the finger. The RecyclerView should start moving left right oscillating indefinitely.
sh...@google.com <sh...@google.com> #6
Hi Albert,
Thanks for reporting the issue. Could you do me a favor and verify whether or not it is reproducible on stable androidx.recyclerview:recyclerview:1.0.0?
Thanks!
Thanks for reporting the issue. Could you do me a favor and verify whether or not it is reproducible on stable androidx.recyclerview:recyclerview:1.0.0?
Thanks!
vi...@gmail.com <vi...@gmail.com> #7
I've tried with androidx.recyclerview:recyclerview:1.0.0 and infinite oscillation happens too.
Let me know if you need anything else.
Let me know if you need anything else.
sh...@google.com <sh...@google.com> #8
Hi, sorry for the slow response!
Could you provide the source code for the minimal reproduction sample? I tried to reproduce the issue but wasn't able to. You never know what aspects of the set up may reproduce this issue and seeing your sample code would be very helpful.
Thanks!
Description
androidx.recyclerview:recyclerview:1.1.0-alpha04
androidx.appcompat:appcompat:1.0.2
Version used:
Theme used:
Devices/Android versions reproduced on:
OnePlus 5T
I have an horizontal RecyclerView with a PagerSnapHelper. If I scroll left or right a bit, then stop scrolling (ie. keep my finger motionless), and then I lift my finger, the RecyclerView starts moving left right oscillating indefinitely. The swing doesn't stop. I need to fling left or right to stop it.
- Relevant code to trigger the issue.
I can provide all the code if necessary but I've just attached a PagerSnapHelper to the RecyclerView as usual.
- A screenrecord or screenshots showing the issue (if UI related).
I've attached a GIF that shows the behavior. The GIF is also available online here:
- Some things I've tried:
I've found a way to fix this by copy-pasting the SnapHelper class and modifying it. On the method "void snapToTargetExistingView()" change:
mRecyclerView.smoothScrollBy(snapDistance[0], snapDistance[1]);
by:
mRecyclerView.scrollBy(snapDistance[0], snapDistance[1]);
You can also add a "new DecelerateInterpolator(100)" as a 3rd parameter. Using mRecyclerView.scrollToPosition(mRecyclerView.getChildAdapterPosition(snapView)) does work too.
While this changes solve the indefinite swing, the movement is abrupt, too fast.
As a workaround I'm currently I'm relying on an old implementation that I developed in 2016 before the SnapHelper existed: