When the list item changes, grab all the Ids on the items in the collections.Attach a listener to the RecyclerView Adapter to listen for when the list item changes.Implement drag and drop on the RecyclerView.Here is how I have chosen to implement this functionality. You may think that there is a new Intent ( REMEMBER_LIST_POSITION) you can call but there is none, at-least I have not seen any so you will have to implement this manually if you desire such functionality. Whichever way you implement RecyclerView drag and drop, the challenge is when you exit the app and come back, how does your app remember the last positions of the list items after they were re-organized. ![]() ![]() I will build upon this tutorial to show how your app can remember the new re-ordered position after the list has been re-ordered by drag and dropping. There are few third party libraries that exist to help implement drag and drop in RecyclerView and Paul Burke provided an excellent three part tutorial on how to use native components to implement drag and drop. In this post, I will provide a tutorial on how to remember the drag and drop position of your RecyclerView list items in Android.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |