![swipes android swipes android](https://www.androidworld.it/wp-content/uploads/2015/03/swipes-android-1280x853.png)
You can get the layout I used here from the GitHub repository, or build your own. We won't be making the XML code for the user interface.
![swipes android swipes android](https://www.codester.com/static/uploads/items/11583/preview/008.jpg)
There's also a ProgressBar that gets shown while loading a new quote. It is an androidX CardView with a bunch of TextViews and an ImageView. Here's a demo of how it works:įor this tutorial, we will use Kotlin as the programming language for our app – but you can easily translate the code to Java and it would work the same.įor reference, this is the quote card that we wish to enable the swipe feature on.
Swipes android how to#
When they've swiped far enough, the app will load a new card with a new quote.īy the end of this post, you will learn how to make a really smooth animated card which a user can swipe that can perform whatever action you choose. So what we'll do in this tutorial is drop the buttons, and instead have logic where a user can swipe the card to the left. But that's pretty basic and any app could do that! Even if you're just building a simple side-project, there's no trade-off for good UX :) Of course, you could just add two simple buttons to load the next/previous quote and call it a day. It can be hard to hook the user and keep them interested. Now, it might seem difficult to make your app stand out if you just have something basic like a quote sharing app (which is what we are going to work on here). And since interactive experiences are kind of the new norm, you'll want to figure out ways to set your app apart. These days, if you see an app that has no animation, it can feel odd and out-dated. They can improve your app's user experience and increase retention. If you're building an Android app, you should consider adding animations.