Create your account

Already have an account? Login here

Create account

86. Disable Swipe For Footer

Design + Code an Android App from Scratch

Woah, wait a second..

Scrounge up some loose change to become a pro member, or login to your account to view this lesson.

Alright, join now. Or login to your account if you're already a pro member.

This video shows how to disable swipe to delete for special items such as the Footer and the No Items View. Inside the onSwipe method of our ItemTouchHelper.Callback subclass we check if the type of the ViewHolder is a regular item and propagate the swipe event only if its a regular item In the next step, we override the onChildDraw and onChildDrawOver to trigger their default behaviour which basically moves the item while it is being swiped only if its a regular item.

Course Cirriculum