Covert — Swipe Actions made easy
Have you ever wanted to implement swiping on your RecyclerView items, only to find that you’ll have to draw graphics on a canvas to reveal anything behind the view? The Material Design Documentation website is full of beautiful mocks of interesting user experiences — more often than not however, these are just mocks. Covert takes the Material Swipe Actions mock, and builds it into an easily configurable library.
Covert was created to fill the gap in support for swipe actions. It allows you to add support for swipe actions in just a few lines of code, and is easily configurable for more advanced uses.
Matching the Guidelines
Applying Covert to your RecyclerView takes just a few lines. Here’s an example of applying Covert to make the interaction shown above.
First off, you need to define your config — this tells the library how to present the swipe interactions.
With your config set up, you can now build Covert and apply it to your RecyclerView.
Finally, pass through your Covert instance to your adapter to draw corner flags on your ViewHolders. This is used when initially binding the ViewHolder, to show flags on items which are initially checked.
More Advanced Applications
Covert can be applied using more complex configuration to enable unique swipe actions. For our Trade Me application, we went with different icons, different colours and a triangular corner flag
For more information on more advanced Covert configurations, check out the README in the Github Repo!
Give it a whirl!
Covert tries to make implementing Swipe Actions as easy as possible, while still opening up loads of different ways for you to make each interaction unique.
Check out Covert on Github — it’s under the MIT License, so go for gold!