Comments (6)
You need to actually move the elements yourself in the onItemMoved method,
are you doing this?
On 7 July 2015 at 03:20, azizimusa [email protected] wrote:
Hi,
Whenever I drag and drop. The list is back to original position. FYI I use
recyclerview adapter with cursor adapter support. But I am not so sure if
the adapter is the cause of the problem—
Reply to this email directly or view it on GitHub
#19.
from dragsortrecycler.
Yeah. I figure about it actually. Forgot to update issue. But I'm having problem about recyclerview.getChildAt(index) . It seem only allow me to fetch 1st 4 item, while I got 12 items in the list. How to overcome this?
from dragsortrecycler.
I'm not sure, are you saying the DragSortRecycler is effecting this
function?
On 7 July 2015 at 07:45, azizimusa [email protected] wrote:
Yeah. I figure about it actually. Forgot to update issue. But I'm having
problem about recyclerview.getChildAt(index) . It seem only allow me to
fetch 1st 4 item, while I got 12 items in the list. How to overcome this?—
Reply to this email directly or view it on GitHub
#19 (comment)
.
from dragsortrecycler.
No. not at all. sorry.
from dragsortrecycler.
OK no problem, I was just checking :)
On 7 July 2015 at 08:34, azizimusa [email protected] wrote:
No. not at all. sorry.
—
Reply to this email directly or view it on GitHub
#19 (comment)
.
from dragsortrecycler.
Here is my implementation of saving new order after drag and drop. Might be useful for incoming newbie like me :)
Cursor cursor = mainRecord.getAllData(currentMonth, currentYear);
if (from < to){
for (int i=from; i <= to; i++) {
cursor.moveToPosition(i);
String type = cursor.getString(cursor.getColumnIndexOrThrow(MainRecord.col_type));
if (i != from) {
newOrder = i-1;
} else {
newOrder = to;
}
mainRecord.updateOrder(type, newOrder);
}
} else {
for (int i=from; i >= to; i--) {
cursor.moveToPosition(i);
String type = cursor.getString(cursor.getColumnIndexOrThrow(MainRecord.col_type));
if (i != from) {
newOrder = i+1;
} else {
newOrder = to;
}
mainRecord.updateOrder(type, newOrder);
}
}
updateAdapter();
from dragsortrecycler.
Related Issues (15)
- Upload the lib to Maven HOT 4
- Support to drag on long press HOT 4
- Drag and Drop with long click and Contextual Action Bar HOT 1
- OnItemMovedListener provide wrong "to" position when dragged to bottom of screen from top HOT 2
- setHasStableIds(true) method ? HOT 2
- Drag Handler bitmap? HOT 2
- Add support for dragging on horizontal RecyclerViews
- Using DragSort recycler with SwipeRefreshLayout HOT 3
- How to integrate this plugin with HashMap<String, String> kind of data? HOT 4
- Faded item stuck at drop point after draggning HOT 8
- Check visibility of the viewhandle HOT 1
- getItemId in sample code should not use position HOT 4
- minSdkVersion=15 HOT 2
- Click listener HOT 5
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 dragsortrecycler.