How to Implement Swipe to Delete with Material3 - Android Studio Tutorial

  Рет қаралды 21,348

Philipp Lackner

Philipp Lackner

Күн бұрын

In this video you'll learn how you can implement a swipe to delete gesture for LazyColumns in Jetpack Compose.
💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:
pl-coding.com/...
⭐ Courses with real-life practices
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/...
Get my FREE PDF about 20 things you should never do in Jetpack Compose:
pl-coding.com/...
Regular programming advice on my Instagram page: / _philipplackner_
Join my Discord server:
/ discord
Get the source code for this video on GitHub:
github.com/phi...

Пікірлер: 49
@allanandliftedhands2669
@allanandliftedhands2669 7 ай бұрын
I like that "I will build this in a way that you can just copy paste this code in all of your projects and you can implement this behaviour"...Would be great if that style of tutorial would persist for simple tutorials like this. Could save us lots of time where one just need a simple certain functionality in their app
@koweratus
@koweratus 7 ай бұрын
this is deprecated on latest material3, newer version uses swipetodismissbox
@ranjansharma3776
@ranjansharma3776 7 ай бұрын
હિન્દી મે બાત કરીએ
@mirjamolqodirov7304
@mirjamolqodirov7304 9 күн бұрын
Thanks bro you are just one of my coding hero
@saaku_barahagalu
@saaku_barahagalu 7 ай бұрын
Thank you so much, Phillip! You are making me love Kotlin and the Android Development path.
@denisdavidek
@denisdavidek 7 ай бұрын
Thank you, Philipp for the tutorial. Sometimes it is required not to swipe completely to delete an item but to swipe a little bit to show the delete button and stop and only delete that item by clicking the delete button. How could the swipeToDeleteContainer be modified to reflect this change in the jetpack compose?
@ChrisAthanas
@ChrisAthanas 7 ай бұрын
Compose Tips - Easy Swipe to Delete with Confirmation kzbin.info/www/bejne/iIOYXpqPbt1qgrc
@Hunyor92
@Hunyor92 5 ай бұрын
let me know if you found a solution for this one :D
@anandg4018
@anandg4018 7 ай бұрын
The way you explains the things are just awesome. Please tell me data structures are necessary for android interviews? apart from android components mvvm, jetpack etc. how good one should be at coding and logic for cracking android interviews??? please answer
@Alchemist10241
@Alchemist10241 6 ай бұрын
Thanks, your tutorial made my job much easier and straightforward, now I can use swipe to delete functionality with a greater ease 👍
@timkeen7327
@timkeen7327 7 ай бұрын
I implemented SwipeToDelete in my app before, but the issue I had with it is it was easy for the user to "Fling" each row accidentally while scrolling through it and cause an un-intended deletion. I wasn't able to figure out how to adjust, or remove, the fling behavior to prevent this. If you, or anybody, knows how to address this issue I would love to hear it.
@rafamartindominguez3196
@rafamartindominguez3196 7 ай бұрын
Maybe add a confirmation button somewhere. Let's say: when you swipe, it disappears from the screen yet the object is not deleted from the db yet, the id is saved to do a query. After the user clicks on confirm, the queries to delete the items are launched 🧐
@timkeen7327
@timkeen7327 7 ай бұрын
@@rafamartindominguez3196 you can absolutely do that, but I would like to prevent the accidental swipe in the first place if possible.
@ChrisAthanas
@ChrisAthanas 7 ай бұрын
@@timkeen7327how do you propose to prevent a swipe?
@ChrisAthanas
@ChrisAthanas 7 ай бұрын
Compose Tips - Easy Swipe to Delete with Confirmation kzbin.info/www/bejne/iIOYXpqPbt1qgrc
@alsh2887
@alsh2887 7 ай бұрын
It's more often needed to have swipe-to-reveal when you swipe and see some buttons. Maybe you can make a video about it?
@GoopleDev-o6u
@GoopleDev-o6u Ай бұрын
Thanks for this great tutorial. How about if you want to undo the deletion of item?
@jurabekturgunboyev5981
@jurabekturgunboyev5981 7 ай бұрын
Very nice thank you very much Philipp Lackner :)
@sooshil
@sooshil 7 ай бұрын
This is great as always. I was looking for a little tweak here. Users swipes, the item won't get removed, but the delete button is exposed, and user needs to actually click on it to remove it. How can we stop the swipe at some point so that we can see a certain portion of the red background? I experienced a lot of accidental swipes in my app and want to implement such.
@parth3075
@parth3075 7 ай бұрын
Just like how it is on ios? Ya well if you figure out do let me know too
@ChrisAthanas
@ChrisAthanas 7 ай бұрын
Compose Tips - Easy Swipe to Delete with Confirmation kzbin.info/www/bejne/iIOYXpqPbt1qgrc
@troligtvisme
@troligtvisme 2 ай бұрын
You can always add a threshold to the swipe `dismissThresholds = { FractionalThreshold(0.5f) }` to avoid accidental swipes.
@tch.777
@tch.777 7 ай бұрын
Sweet like always, thank you!! 🙏
@jess_o
@jess_o 7 ай бұрын
Great tutorial, thanks Philipp!
@Kanha0321
@Kanha0321 7 ай бұрын
Thank you so much philipp ❤
@emmanuelmtera5936
@emmanuelmtera5936 7 ай бұрын
Now this is something. Quick question for compose multiplatform can you make a tutorial for ios working with keyboards would appreciate much. Thanks for your day to day efforts and guidance on mobile development.
7 ай бұрын
Nice! Thanks to share Phillip
@mohameddouch9503
@mohameddouch9503 7 ай бұрын
Nice idea ! Thanks Philpp ❤
@rogeralien
@rogeralien 7 ай бұрын
Nice tutorial, thank you!
@viablesubtlety
@viablesubtlety 7 ай бұрын
Thank you Phillip
@LucaElevate
@LucaElevate 6 ай бұрын
Hey I need to use a Column because I have groups of items in a lazycolumn. In Columns I cant use items. When I do it with foreach I have the bug that more then one gets deleted at a time How can I fix this?
@giuliopimenoff
@giuliopimenoff 7 ай бұрын
Nice, would have also been nicer to see who to handle undo operation with this dismissable thing, I had to make some workarounds to make that work
@PhilippLackner
@PhilippLackner 7 ай бұрын
Keep a reference to the item in your viewmodel and re-insert it when the user taps undo
@giuliopimenoff
@giuliopimenoff 7 ай бұрын
@@PhilippLackner yeah the issue is the the weird animation for when the item gets reinserted
@giuliopimenoff
@giuliopimenoff 7 ай бұрын
don't remember exactly what but it was a bit janky
@mubaraknative
@mubaraknative 7 ай бұрын
Yes on Views also @@giuliopimenoff
@sanki_programmer
@sanki_programmer 7 ай бұрын
like to watch your videos sir 👍👍
@Tsukikof
@Tsukikof 5 ай бұрын
Can you make drag and drop order of items in a list?
@mustafaammar551
@mustafaammar551 7 ай бұрын
Thank you BRO
@sparshchadha5469
@sparshchadha5469 7 ай бұрын
Any plans on making a system design video for app developers? There's hardly content for that on the internet.
@SergeyTosunyan-zb5jw
@SergeyTosunyan-zb5jw 7 ай бұрын
It's a great idea to share the PDF, but sadly the download button doesn't work on my phone's browser
@0_Cool
@0_Cool 6 ай бұрын
Seems like the remember does not allow you to add back in the values. Seems like its only useful for deletions.
@sumanshah5750
@sumanshah5750 7 ай бұрын
How to make a calander that add a task and visiable in number
@henrik908
@henrik908 7 ай бұрын
Can you please make another video on Tensorflow ❤.
@zakariabouchantouf5141
@zakariabouchantouf5141 7 ай бұрын
Yoooo filip can you learn us how to make the animation of explain tk the user how to use the applucation?
@amol1608
@amol1608 7 ай бұрын
why is this so complicated in Compose, yet Flutter has a straight-forward implementation of this simple thing.
@Theo-os3zi
@Theo-os3zi 2 ай бұрын
everything is complicated in android for no reason + everything gets deprecated so quickly, this one doesn't work anymore...
@Theo-os3zi
@Theo-os3zi 2 ай бұрын
Its been only 4 months and it's already changed, oh how I hate android...
@user-eh6yg2if9f
@user-eh6yg2if9f 6 күн бұрын
please vide newer version
BasicTextField2 - Everything You Need to Know 💻
14:23
Philipp Lackner
Рет қаралды 15 М.
derivedStateOf VS. remember(key) - THIS is Really the Difference 🤯
14:46
Electric Flying Bird with Hanging Wire Automatic for Ceiling Parrot
00:15
Пришёл к другу на ночёвку 😂
01:00
Cadrol&Fatich
Рет қаралды 3,9 МЛН
Nothing is really cool in Kotlin
7:43
Sebastian Sellmair
Рет қаралды 4,4 М.
KMP vs. Flutter - Who Will Win The Cross-Platform Battle?
16:19
Philipp Lackner
Рет қаралды 46 М.
The Top 3 State Management Mistakes On Android
14:30
Philipp Lackner
Рет қаралды 24 М.
This Is My FAVORITE Error Handling Class
28:57
Philipp Lackner
Рет қаралды 30 М.
Swipe gestures in Recycler View | Android
18:47
Mafia Codes
Рет қаралды 62 М.