Android Development Tutorial - Swipe To Delete RecyclerView Item

preview_player
Показать описание

With the help of ItemTouchHelper class you can add swipe to dismiss, drag & drop support to RecyclerView. Swiping the row will remove the row from the RecyclerView, but it won’t refresh the data. You can see an empty row displayed on swiping the row. You have to take care of refreshing the list by removing the item from the adapter dataset.

ItemTouchHelper.SimpleCallback provides certain callback methods like onMove(), onChildDraw(), onSwiped() when the row is swiped. Showing the background view, removing the item from adapter can be done using these callback methods.

android development tutorial,
android programming tutorial,
android app development tutorial,
android tutorial for beginners ,
android app tutoria,
android studio tutorial,
learn android programming ,
android developer tutorial ,
android programming,
android development,
android studio tutorial for beginners,
android course,
android training,
android development course,
android app development course
Рекомендации по теме
Комментарии
Автор

Great video, thanks for sharing I bet you have many years of experience working as Android developer!

volodymyrprysiazhniuk
Автор

love you man, you make progamming fun and easy, I'll become your fan!

maykaragao
Автор

Thanks for your video! But I have one problem, bro. 29:45 When I create im my Fragment using word - THIS, it doesnt work. What I should to do? Please help <3

glebsalnikov
Автор

best android tutorial videos in youtube .
if you can comment on code with your voice it would be perfect

khlchs
Автор

The code works - thank you! However, perhaps in the future could you avoid the API request, and the Picaso image part? Those parts are not necessary if we are just concerned with the swipe to delete functionality. Instead, that time could have been spent explaining the RecyclerItemTouchHelper class. Excellent code though!

johnhostetter
Автор

Hi - thanks for this awesome video. How would I override the onClear class if I have two different views types in my adapter? I have googled all afternoon and cannot find an answer.

slasht
Автор

Suppose, I have implemented an alert dialog to confirm the deletion. If the user press "Cancel", how will I reposition foreground, as the foreground is staying on the left side until the user manually swipes back the foreground. And, great tutorial BTW. Congrats

flutter-insights
Автор

Sir, I really like your tutorial,
did you have any website that store some of your tutorial in article form?

deepseapenguin
Автор

sr i dont see the code for event change background to red color and show "delete" when swipe item, can u show me

huyle
Автор

how can you do that in 17:00 to choose? is there any shortkey?

galangbaskara
Автор

Thanks for the tutorial... I am trying to do the same thing but my background moves (delete) as I swipe the foreground! Do you know what I am doing wrong?

ehsanabdolmajidi
Автор

Does the code of your tutorials are in github?

MrCode
Автор

while swipe to delete i have set alert dialog box to delete it with password if user select cancel it show the background-view not the card view (foreground-view for that what should we do if u knw reply

mustafashaikh
Автор

what did you mean request API ?
did you you mean read data?
sorry I'm using firebase and i need to understand this

mahmoudadel
Автор

Good evening sir, I need help I want to implement a list with recyclerview in my project, and I want the items ordered by distance in meters or kilometers from the user's location, you have some video talking about it. If you can not implement this in my project? I'm using Firebase. My project is a resale of used vehicles, cars and motorcycles, and I want the user to open the list to show the vehicles closest to him and mark the distance in (m or km)

arthurkids
Автор

Nice tuto, well, can i call a phone call with the swipe? let me explain, i wanna make a call phone from my recyclerview, taking the number phone of my client and call him, i'm trying to make this in a dialog box, but its not working as i wish, so i'm thinking about the swipe... or other method.. thanks for the tutos.

luizguilhermedasilvapereir
Автор

But to implement from the right swipe with another color and action, for example green and completed?

soma
Автор

Thank you, It was a good and useful video, How can I make the same but with two actions? I mean, for example If I swipe from right to left, a product is deleted but if I swipe from left to right, a dialog is showed to edit the product, if you have an example it will be great, In advance thank you for your help.

ronaldogeldres
Автор

sir i'm facing unable to merge dex after updating android studio even after adding multiDexEnabled true

fareedmahar
Автор

Cant even see some of the code such as the end of the onChildDraw methods :/

rabiariaz
welcome to shbcf.ru