Comments (3)
to comment these lines worked for me.
// recyclerView.post(new Runnable() {
// @OverRide public void run() {
adapter.notifyItemMoved(fromPosition, toPosition);
// }
// });
from dragsortadapter.
Should this already have been fixed?
There's a comment in the code like // fix for weird scrolling when animating first item
... But the current version does not work correctly.
For me, flaquir4's solution stops everything to work. of course, the adpater must be notified about the change...
EDIT
Following fixes the problem for me and is confirm to what the issue report suggests, call scrollToPosition(0)
AFTER notifyItemMoved
:
if (adapter.move(fromPosition, toPosition)) {
recyclerView.post(new Runnable() {
@Override public void run() {
adapter.notifyItemMoved(fromPosition, toPosition);
if (fromPosition == 0 || toPosition == 0)
recyclerView.scrollToPosition(0);
}
});
}
https://code.google.com/p/android/issues/detail?id=99047
}
from dragsortadapter.
MFlisar's fix works for me.
from dragsortadapter.
Related Issues (20)
- Edge Scrolling
- How can I use the DragSortAdapter with List<String>? HOT 3
- I have a similar issue with #11,"use the DragSortAdapter with List<String>" HOT 1
- Why API 14? HOT 1
- Weird behavior with multiple RecyclerViews and DragSortAdapters HOT 2
- Crash when fast double click to call startDrag
- While dragging sometimes items disapper HOT 3
- Swapping the first two items causes weird effect HOT 1
- Can't update to compile 'com.android.support:recyclerview-v7:23.1.1' HOT 1
- What should I do if I want to use your code in another repo? HOT 1
- Still have wired scroll when drag the first item down slowly
- Please add onDrop override method to the example. HOT 2
- How can I use the DragSortAdapter with ListView? HOT 1
- DragDrop no longer works on Android 9.0
- Drag Shadow on Lollipop has ripple in it HOT 2
- Dragged item blips when releasing HOT 6
- Example image (possibly a gif) HOT 2
- Scrolling while dragging does not work when layout is horizontal
- Java errors in the Adapter example HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dragsortadapter.