Skip to content
一个带渐变层叠动画的左右滑动效果(类似于探探、tinder)
Branch: master
Clone or download
Latest commit b8caed6 Nov 7, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
gradle/wrapper gradle 3.3 Mar 11, 2017
.gitignore
LICENSE Initial commit Feb 23, 2016
README.md update readme Nov 7, 2017
build.gradle
ezgif.com.gif
gradle.properties
gradlew code Feb 23, 2016
gradlew.bat
settings.gradle

README.md

SwipeCardView

SwipeCardView是基于Diolor的Swipecards控件改进实现,SwipeCardView是一个优雅的刷脸控件,滑动刷脸伴随渐变层叠动画,带来前所未有的滑动刷脸体验。  

thanks Diolor Swipecards

Screenshot

screen

Relative Project

SwipeAdapterView

Usage

XML:

<com.lorentzos.flingswipe.SwipeFlingAdapterView
    android:id="@+id/swipe_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    swipe:min_adapter_stack="4"
    swipe:max_visible="4"
    swipe:y_offset_step="28dp"/>

Java Code:

swipeView = (SwipeFlingAdapterView) findViewById(R.id.swipe_view);
    swipeView.setIsNeedSwipe(true);// 是否开启swipe滑动效果,当不调用此方法设置时,默认开启。
    swipeView.setFlingListener(this);
    swipeView.setOnItemClickListener(this);

onFlingListener

@Override
public void removeFirstObjectInAdapter() {
    adapter.remove(0);
}

@Override
public void onLeftCardExit(Object dataObject) {
    // to do something
}

@Override
public void onRightCardExit(Object dataObject) {
    // to do something
}

@Override
public void onAdapterAboutToEmpty(int itemsInAdapter) {
    if (itemsInAdapter == 3) {
        loadData();
    }
}

Click to swipe

@Override
public void onClick(View v) {
    // swipe left
    swipeView.swipeLeft();
    // swipe right
    //swipeView.swipeRight();
}

About me

微博:@萧雾宇

You can’t perform that action at this time.