https://github.com/xiepeijie/SwipeCardView
一个带渐变层叠动画的左右滑动效果(类似于探探、tinder)

<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"/>
swipe:y_offset_step="-28dp" 负的上面偏移
Java Code:
核心用法(即AdapterView的用法)
swipeView = (SwipeFlingAdapterView) findViewById(R.id.swipe_view);
//swipeView.setIsNeedSwipe(true);// 是否开启swipe滑动效果,当不调用此方法设置时,默认开启。
swipeView.setFlingListener(this);
swipeView.setOnItemClickListener(this);
onFlingListener的回调方法

该博客介绍了如何使用SwipeFlingAdapterView库创建一个类似探探和Tinder应用的左右滑动卡片效果,包括XML布局配置、Java代码实现以及监听器回调方法的详细说明,展示了如何实现卡片的渐变层叠动画和点击事件处理。
最低0.47元/天 解锁文章
5251

被折叠的 条评论
为什么被折叠?



