Recall & Review
beginner
What is "Swipe to dismiss" in Android apps?
It is a user interaction where you swipe a list item sideways to remove it from the screen, like swiping away a notification.
Click to reveal answer
beginner
Which Android component helps detect swipe gestures for dismissing items?
ItemTouchHelper is a utility class that simplifies adding swipe and drag & drop support to RecyclerView items.Click to reveal answer
intermediate
What method do you override to handle swipe dismiss in ItemTouchHelper.Callback?
You override onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) to react when an item is swiped.
Click to reveal answer
intermediate
How do you update the UI after an item is swiped away?
Remove the item from your data list and notify the adapter with notifyItemRemoved(position) to update the RecyclerView.
Click to reveal answer
beginner
Why is it important to provide an undo option after swipe to dismiss?
Because users might swipe accidentally, an undo option improves user experience by allowing recovery of dismissed items.
Click to reveal answer
Which class helps add swipe to dismiss functionality to RecyclerView items?
✗ Incorrect
ItemTouchHelper is designed to add swipe and drag support to RecyclerView items.
What method is called when a RecyclerView item is swiped?
✗ Incorrect
onSwiped() is called by ItemTouchHelper.Callback when an item is swiped.
After removing an item from the data list, which adapter method updates the UI?
✗ Incorrect
notifyItemRemoved(position) tells RecyclerView to animate removal of the item.
Why should you avoid removing the item from the data list before swipe animation completes?
✗ Incorrect
Removing the item too early stops the swipe animation from playing smoothly.
What is a good UX practice after swipe to dismiss?
✗ Incorrect
An undo option lets users recover accidentally dismissed items, improving experience.
Explain how to implement swipe to dismiss in a RecyclerView using Kotlin.
Think about how to detect swipe and update the list.
You got /4 concepts.
Describe why providing an undo option after swipe to dismiss is important for user experience.
Consider what happens if a user makes a mistake.
You got /4 concepts.