Swipe Dismiss with Coordinate layout

CoordinatorLayout

Yugandhar
Android App Development for beginners
1 min readJul 29, 2016

--

  • CoordinatorLayout is a super-powered FrameLayout.
  • It is intended for two primary use cases:
  1. As a top-level application decor or chrome layout
  2. As a container for a specific interaction with one or more child views

To I am going to implement how to do a swipe dismiss the Cardview with Coordinate Layout

Preparing for Swipe Dismiss

  • CoordinateLayout
  • CardView
  • SwipeDismissBehavior Class

CardView

A FrameLayout with a rounded corner background and shadow.

SwipeDismissBehavior

An interaction behavior plugin for child views of CoordinatorLayout to provide support for the ‘swipe-to-dismiss’ gesture.

Now Implementation

layout.xml

Activity.java

Dismiss the CardView by Swiping to any direction

--

--