Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xiepeijie/SwipeCardView
一个带渐变层叠动画的左右滑动效果
https://github.com/xiepeijie/SwipeCardView
android swipecard swipeview
Last synced: 3 months ago
JSON representation
一个带渐变层叠动画的左右滑动效果
- Host: GitHub
- URL: https://github.com/xiepeijie/SwipeCardView
- Owner: xiepeijie
- License: apache-2.0
- Created: 2016-02-23T05:06:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-07T14:35:35.000Z (about 7 years ago)
- Last Synced: 2024-06-16T03:31:47.226Z (5 months ago)
- Topics: android, swipecard, swipeview
- Language: Java
- Homepage:
- Size: 39.5 MB
- Stars: 1,465
- Watchers: 38
- Forks: 282
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-android-ui - SwipeCardView - 基于Diolor的Swipecards控件改进实现 (Card)
README
# SwipeCardView
SwipeCardView是基于Diolor的[Swipecards](https://github.com/Diolor/Swipecards)控件改进实现,SwipeCardView是一个优雅的刷脸控件,滑动刷脸伴随渐变层叠动画,带来前所未有的滑动刷脸体验。thanks Diolor [Swipecards](https://github.com/Diolor/Swipecards)
## Screenshot
![screen](https://github.com/xiepeijie/SwipeCardView/blob/master/ezgif.com.gif)## Relative Project
[SwipeAdapterView](https://github.com/xiepeijie/SwipeAdapterView)## Usage
### XML:
``````
### 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
微博:[@萧雾宇](http://weibo.com/payge)