Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

Swipecards

> 编程语言
Open source

A Tinder-like Android library to create the swipe cards effect. You can swipe left or right to like or dislike the content.

2.3K stars0 likes0 views
WebsiteGitHub

About

A Tinder-like Android library to create the swipe cards effect. You can swipe left or right to like or dislike the content.

Swipecards

Travis master:

A Tinder-like cards effect as of August 2014. You can swipe left or right to like or dislike the content. The library creates a similar effect to Tinder's swipable cards with Fling animation.

It handles greatly asynchronous loading of adapter's data and uses the same layout parameters as FrameLayout (you may use android:layout_gravity in your layout xml file).


Installation

Go ahead find the latest version on Gradle please cowboy! Be sure to add the @aar suffix.

groovy
dependencies {
    compile 'com.lorentzos.swipecards:library:X.X.X@aar'
}

Example

The example is quite straightforward and documented in comments. You may find it under the relevant directory.

…

You can alternatively use a helpful method which sets in one line both the listeners and the adapter.

java
    // where "this" stands for the Context
    flingContainer.init(this, arrayAdapter);

Adding buttons is easy. Get the top card listener and trigger manually the right or left animation. On the end of the animation the above listeners (e.g. removeFirstObjectInAdapter) will be triggered depending on the direction.

java
    /**
     * Trigger the right event manually.
     */
    flingContainer.getTopCardListener().selectRight();

Tip: If you start a new Activity in the onItemClicked you will probably want to avoid double activity instances. If so these solutions might work for you: 1, 2 and I personally prefer 3

Configuration

You can optionally specify some attrs for the animation and the stack. The easiest way is in xml:

xml
<com.lorentzos.flingswipe.SwipeFlingAdapterView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:rotation_degrees="16"
    app:max_visible="4"
    app:min_adapter_stack="6" />

Or use styles:

xml

<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
    
    <item name="SwipeFlingStyle">@style/SwipeFling</item>
</style>
  • rotation_degrees: the degrees of the card rotation offset
  • max_visible: the max visible cards at the time
  • min_adapter_stack: the min number of objects left. Initiates onAdapterAboutToEmpty() method.

License

   Copyright 2014 Dionysis Lorentzos

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言