SwipeCardRecyclerView

Introduction: 利用 RecyclerView 打造的滑动卡片 View,支持左滑右滑删除
More: Author   ReportBugs   
Tags:

集成

Android Studio

1.在项目根目录 build.gradle 文件中加入:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

2.在 app build.gradle 文件中添加依赖

dependencies {
        compile 'com.github.HalfStackDeveloper:SwipeCardRecyclerView:v1.0.1'
}

使用 (参见 demo)

1.RecyclerView 设置

mRecyclerView = (SwipeCardRecyclerView) findViewById(R.id.recyclerView);
mRecyclerView.setLayoutManager(new SwipeCardLayoutManager());

mAdapter = new MyAdapter(this, list);
mRecyclerView.setAdapter(mAdapter);

2.创建继承自 SwipeCardAdapter 的 adapter

class MyAdapter extends SwipeCardAdapter

具体细节可移步《如何利用 RecyclerView 打造炫酷滑动卡片》,欢迎大家 fork AND star!

动画效果

开源协议

Copyright (C)2016, 汪先登

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.
Apps
About Me
GitHub: Trinea
Facebook: Dev Tools