Drag and drop Reorder in Recycler View | Android
HTML-код
- Опубликовано: 3 окт 2024
- In this video you will learn how to handle #drag and drop reordering inside a recycler view.
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for 6 months and I love it! www.kite.com/g...
FREE $100 credit @Digital Ocean: m.do.co/c/3208...
Patreon: / trulymittal
Subscribe: www.youtube.co...
#RecyclerView (Basic Setup): • Recycler View with com...
Pull to Refresh Recycler View: • Pull to Refresh in Rec...
Swipe gestures Recycler View: • Swipe gestures in Recy...
Github(Tutorial): github.com/tru...
RecyclerView: developer.andr...
RecyclerView(dependency): developer.andr...
---------------
More useful videos
---------------
#ViewModel: • View Model | Live Data...
#Retrofit: • RETROFIT Tutorial (v 2...
#WorkManager: • Work Manager | Android...
#KeyframeAnimations: • Keyframe Animations wi...
#CollapsingToolbar Layout: • Collapsing Toolbar Lay...
#BottomNavigation View: • Bottom Navigation View...
#NavigationComponent: • Navigation Component |...
#NightMode: • Night Mode | Dark Mode...
#ButterKnife: • Butter Knife | Field a...
SplashScreen: • Splash screen | Launch...
Singletons: • Singletons | What When...
---------------
What I use
---------------
Mouse: amzn.to/2O9RJtu
Keyboard: amzn.to/2qxajCU
Keyboard 2: amzn.to/2XDWH4X
Monitor: amzn.to/2pDg7dH
Processor: amzn.to/347WWIb
RAM: amzn.to/2QEkUqw
Graphics: amzn.to/33aBrF4
Microphone: amzn.to/2DabdI9
#yoursTruly #tutorial #how-to #android
Thanks a lot! Short, simple, working and exactly what I was searching for.
Subscribe like share😊
++
Thanks a lot! Short, simple, working and exactly what I was searching And Struggle For eight hours !
man, this was such a nice thorough explanation, thanks a lot, you have me curious about the source of that noise tho lol
Pressure cooker lol. A common vessel in Indian cooking. Goes to show he made this tutorial while waiting for his rice or curry to cook
Mogambo khush hua...😎
Aur apoko 1 new subscriber mil gya
Amazing tutorial, just what I need! Thank you so much.
Subscribe like share 😊
Thank you so much bro, you do a great job. I follow you continuously.
thanks for your simple and clear tutorial!!
Wow man this is simple and works as magic. Thanks
Excellent tutorial, very well explained and demonstrated. Thanks. Love from England ❤️
Subscribe like share
@@mafiacodes I liked and subscribed, I don't have anyone to share too 😂
😅
@@mafiacodes are all of your Android tutorials in Java ? Have you shifted to Kotlin ?
thank you for this short and very useful vidoe
Great explanation mate
5:14 Pressure cooker :D
Great video. Explained everything to the point. Thanks
Subscribe like share
still relevant in 2021 thanks..
but, how to get latest position of all array, after rearange the playlist ?
Thank you bro, thats exactly what i need.
Thank you very much for this tutorial.
best tutorials ever
sir u have the one of the best android lectrs, i have seen your recyclerview and it was somuch easy to understand , kindly expain data base and broadcast recievers plz
thanks
Thanks, I have a playlist for Room Database, you can watch that.
ruclips.net/p/PLdHg5T0SNpN3CMNtsd5KGaiBtzhTGIwtC
@@mafiacodes ok sir plz do on broadcasts
Thanks for the help but how to change the position in database as well?
Thanks a lot dude for this nice tutorial, it worked great!
Subscribe like share😊
Awesome tutorial
Thank you, helped!
Thanks
Really nice tutorial, you got a new sub!
😊
great tutorial! ty so much dude:)
Subscribe like share
can you do a video on this, but change the background color of the item that is being dragged?
Congratulations on the content, but if I quit sort a list down, if I quit the activity, is the reordering saved? I don't think so, I never see these videos in their entirety. What to do to try to follow your channel, will you complete the rest of the video?
Thank you, how will the settings stay?
Nice pressure cooker
😂😂😂😂
Really helpful!
The SWAP operation is not correct. Let's say I have a list of 3 elements [A,B,C] and the user moved the item from position 2 (C) to position 0 very quickly that the onMove() method was called *only once* when fromPosition=2 and toPosition=0 (It happened to me) then the updated list should be [C,A,B] and not [C,B,A] as the SWAP operation does
thx
@yourtruly there is a position like 0,1,2,3,4,5 on the listing. Can you suggest to me how I can update that position as well?
Very helpful, thanks
but how to make is automatically changed the index after the swap
And SharefPreference in Drag in Drog of the RecyclerView?
Hello, thanks for the great video but unfortunately it solved just an half of my problem. My recViews are connected to a realtime Firebase Database and I would like to implement the changes in position (swapping) also in the database so that those changes are then kind of permanent and they do not disappear when I exit the activity.
Thanks in advance for your help and God bless u
The order of keys that you see in the console is fixed. It's just the lexicographic (alphabetical) ordering of the keys. There is no "move" operation for child keys. If you want the children to be ordered, put some child value under each of them that you can use in a query to order them.
Thank you, that you have to do manually by triggering a call to firebase api. Afaik.
I found this answer on stackoverflow and it looks promising
Sir , how i can change the color of view only for moving time and then back to normal.
i have mini. target device is 19 so please give me solution.
Your video is helped me in achieving the functionality but I want you to please explain a bit more about the classess you use. I mean I don't know what is item touch helper is and how can I modify it according to my convenience.
PS: Sorry for the grammatical mistakes.
I'll try to make a video for the same sometime sooner.
Is there a way to do this without long press, but just with touch and drag? I would like to insert an image, a handle so user can touch on that handle and drag instead of touch and hold for drag?
I'm looking for this as well. Other options seem rather complicated.
it's running in my app
Fabulous tutorial! Is there a way to add unique buttons to each line of the recyclerview?
Probably you want is this Multi view RecyclerView | getItemViewType() | Android ruclips.net/video/VtnLpHUu2U0/видео.html
OR
depending on the row you can change the button title dynamically.
Subscribe like share😊
Really great tutorial ! Thank you !
One question please - in the onMove method, the return value was "false". Why ?
I tried to replase the "false" to "true", but nothing changed in the functionality.
What is the purpose of that boolean "return" value, since nothing is changed based on that value ?
Thank you !
You should return TRUE, its like telling the touch helper that the move was handled.
Why does my RecyclerView with ItemTouchHelper stop dragging after only one item
i fixed it by deleting this method in my recycle view adapter
@Override
public int getItemViewType(int position)
{
return position;
}
@@jatinchopra1621 Man, you are awesome!
I solving this problem for more than two days and only you helped me!
Thank you very much!
And SQLite record position of this RecyclerView, i not searching video in you tube? with use of the onLongClickListener?
great man! ❤
but I want to drag and drop by touch any button of recyclerview item instead of Long press .
please help :(
very nice bro, can you please tell me if you know how to drag an item into folder?
Portuguese legends, please!!!
Awesome!
Can you please help , in Drag and Drop for child items having different sizes.
I am using StaggeredGridLayoutManager.
Drag and Drop is working fine. But during Drag of Big items leads to Items duplication in RecyclerView background.
hi i am getting error " java.lang.IndexOutOfBoundsException: Index: 5, Size: 0" on collections.swap. my data is from firestore. can u help me?
But After App close , items go to the initial position..
How to solve this this?
You have a good keyboard :-)
*Как мне двигать кнопки в LinearLayout?*
Thank's brother
Subscribe like share
Plz teach me pagination adapter in recycler view
Is it possible to save their position after changing order, even after closing the app remains same.
Need to create a field in ur db and then change sort order there after sortint
@@mafiacodes can you make a video for that?
Sir, it is only working to rearranging names , if we use different icons for each movie(or other information) then this won't work for their icon(or other information) ,anyway i resolved it , but you should mention it in video too......anyway thanks...
how did you resolve it?
@@moazzahran313 in this tutorial they only took , list of name .If u are using with list of icons(or many extra things) then just use all the list along with name lists(like in swap function) ,I can more clear it , Watsapp me at 7897570695...if u are interested 😄
im dying with that noise :v
Many thanks for the tutorial. I tried to follow your instructions. Unfortunately the drag and drop doesn't work. As soon as I click on the button longer, the entry is not moved but deleted. Do you have an idea what I am doing wrong?
Seems that u have added a long click listener on ur items and that I called before drag could work, if possible share ur code on github so I can see what’s happening
@@mafiacodes I have tried to put put the Code to GIT. Hope you have access to my "MainActivity!" File.
Send me the link
@@mafiacodes github.com/SoftwareBaschtler/recyclerView_V01.git
@@mafiacodes Does the link work? Could you read the file?
is there a way to add a hide/unhide icon on drag view?
Use on drag start drag end to hide and show
TYSOOM :)
subscribe like share....
How to capture fromPosition and id to post?
Watch @ 4:45 to know how to get from and to position
how to do this for only card views
U mean without recycler view
@@mafiacodes yes,Only for cardviews inside a fragment.Can we do it?if yes,please do a video
This method is for recycler view
@@mafiacodes yes,but can we do it for card view only?
🌹🌹🌹
Thanks a lot! Short, simple, working and exactly what I was searching for.