一个带渐变层叠动画的左右滑动效果(类似于探探、tinder)

Min SDK   14
Latest Commit   2017-03-11 12:59:37
License   Apache-2.0

Github   https://github.com/xiepeijie/SwipeCardView

         

使用APP客户端扫描二维码运行Demo


...

xiepeijie

深圳


         

类似的还有....
RecyclerViewCardGallery @Deprecated RecyclerView实现Card Gallery效果,替代ViewPager方案
SwipeCardsView Android高仿秒拍热榜的卡片滑动和左右飞出效果,支持保留最后一张卡片
CardSwipeLayout Use RecyclerView to achieve card swipe layout , like Tantan . (模仿探探卡片滑动效果的布局)
README

README.md

SwipeCardView

SwipeCard效果是基于Diolor的Swipecards控件改进实现,通过添加了滑动渐变层叠动画,达到更佳的滑动刷脸体验。
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

微博:@萧雾宇