All Projects → chetdeva → swipeablerecyclerview

chetdeva / swipeablerecyclerview

Licence: MIT license
SwipeableRecyclerView provides a wrapper class SwipeItemTouchHelperCallback which can be used to add Dragging capability to your RecyclerView items. You can make use of DataBinding to bind it via XML.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to swipeablerecyclerview

Recyclerviewevent
RecyclerView onItemClick、onItemLongClick、drag、swipe、divider、reuse disorder RecyclerView 梳理:点击&长按事件、分割线、拖曳排序、滑动删除、优雅解决 EditText 和 CheckBox 复用错乱问题
Stars: ✭ 265 (+1556.25%)
Mutual labels:  recyclerview, swipe
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+34481.25%)
Mutual labels:  recyclerview, swipe
Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+21850%)
Mutual labels:  recyclerview, swipe
android-recyclerview-binding
RecyclerView + Data Binding + LiveData Sample
Stars: ✭ 45 (+181.25%)
Mutual labels:  recyclerview, data-binding
Swipeablecards
Stars: ✭ 136 (+750%)
Mutual labels:  recyclerview, swipe
FancyAdapters
A collection of customizable RecyclerView Adapters for Android, that provide various functionality like item selection, contextual action mode controls, drag&drop and swiping, among other.
Stars: ✭ 49 (+206.25%)
Mutual labels:  recyclerview, swipe
Android Advancedrecyclerview
RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)
Stars: ✭ 5,172 (+32225%)
Mutual labels:  recyclerview, swipe
movie-booking
An example for booking movie seat, combined of Android Data Binding, State Design Pattern and Multibinding + Autofactory. iOS version is: https://github.com/lizhiquan/MovieBooking
Stars: ✭ 80 (+400%)
Mutual labels:  recyclerview, data-binding
Fullrecyclerview
This is a compilation of different kinds and actions in recyclerView
Stars: ✭ 127 (+693.75%)
Mutual labels:  recyclerview, swipe
Swipemenulayout
🔥一个零耦合的侧滑菜单,支持RecyclerView、ListView、GridView等不同条目布局,支持菜单在左或在右,可选滑动阻塞,是否禁用等功能
Stars: ✭ 120 (+650%)
Mutual labels:  recyclerview, swipe
XamarinItemTouchHelper
Basic example of using ItemTouchHelper to add drag & drop and swipe-to-dismiss to RecyclerView for Xamarin
Stars: ✭ 35 (+118.75%)
Mutual labels:  recyclerview, swipe
MetalRecyclerPagerView
RecyclerView implementation for Android which makes it look and feel like ViewPager with item margins support (mutliple views effect).
Stars: ✭ 26 (+62.5%)
Mutual labels:  recyclerview, swipe
Dragdropswiperecyclerview
Kotlin Android library that extends RecyclerView to support gestures like drag & drop and swipe, among others. It works with vertical, horizontal and grid lists.
Stars: ✭ 469 (+2831.25%)
Mutual labels:  recyclerview, swipe
Recyclerviewhelper
📃 [Android Library] Giving powers to RecyclerView
Stars: ✭ 643 (+3918.75%)
Mutual labels:  recyclerview, swipe
Placeholderview
This library provides advance views for lists and stacks. Some of the views are build on top of RecyclerView and others are written in their own. Annotations are compiled by annotation processor to generate bind classes. DOCS -->
Stars: ✭ 2,104 (+13050%)
Mutual labels:  recyclerview, swipe
Reswipecard
a light lib for swipe the cards implemented by RecyclerView
Stars: ✭ 230 (+1337.5%)
Mutual labels:  recyclerview, swipe
iron-swipeable-pages
[Polymer 1.x] Element that enables switching between different pages by swiping gesture.
Stars: ✭ 51 (+218.75%)
Mutual labels:  swipe
Modular2Recycler
Modular²Recycler is a RecyclerView.Adapter that is modular squared.
Stars: ✭ 72 (+350%)
Mutual labels:  recyclerview
FastWaiMai
仿写美团外卖电商项目
Stars: ✭ 123 (+668.75%)
Mutual labels:  recyclerview
BaseRecyclerViewAdapter
RecyclerView通用适配器
Stars: ✭ 14 (-12.5%)
Mutual labels:  recyclerview

Swipeable RecyclerView

SwipeableRecyclerView provides a wrapper class SwipeItemTouchHelperCallback extends ItemTouchHelper.Callback which can be used to add Swiping capability to your RecyclerView items. You can make use of DataBinding to bind it via XML.

How to Use

ItemTouchHelper.Callback swipeCallback = new SwipeItemTouchHelperCallback
        .Builder(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT)
        .bgColorSwipeLeft(bgColorSwipeLeft)
        .bgColorSwipeRight(bgColorSwipeRight)
        .drawableSwipeLeft(drawableSwipeLeft)
        .drawableSwipeRight(drawableSwipeRight)
        .setSwipeEnabled(swipeEnabled)
        .onItemSwipeLeftListener(onItemSwipeLeft)
        .onItemSwipeRightListener(onItemSwipeRight)
        .build();

ItemTouchHelper itemTouchHelper = new ItemTouchHelper(swipeCallback);
itemTouchHelper.attachToRecyclerView(recyclerView);

How to Bind

In your Gradle

dataBinding {
    enabled = true
}

In your BindingAdapter

/**
 * Bind ItemTouchHelper.SimpleCallback with RecyclerView
 *
 * @param recyclerView      	RecyclerView to bind to SwipeItemTouchHelperCallback
 * @param swipeEnabled      	enable/disable swipe
 * @param drawableSwipeLeft     drawable shown when swiped left
 * @param drawableSwipeRight    drawable shown when swiped right
 * @param bgColorSwipeLeft  	background color when swiped left
 * @param bgColorSwipeRight 	background color when swiped right
 * @param onItemSwipeLeft   	OnItemSwipeListener for swiped left
 * @param onItemSwipeRight  	OnItemSwipeListener for swiped right
 */
@android.databinding.BindingAdapter(value = {"swipeEnabled", "drawableSwipeLeft", "drawableSwipeRight", "bgColorSwipeLeft", "bgColorSwipeRight", "onItemSwipeLeft", "onItemSwipeRight"}, requireAll = false)
public static void setItemSwipeToRecyclerView(RecyclerView recyclerView, boolean swipeEnabled, Drawable drawableSwipeLeft, Drawable drawableSwipeRight, int bgColorSwipeLeft, int bgColorSwipeRight,
                                              SwipeItemTouchHelperCallback.OnItemSwipeListener onItemSwipeLeft, SwipeItemTouchHelperCallback.OnItemSwipeListener onItemSwipeRight) {

    ... // attach RecyclerView to SwipeItemTouchHelperCallback as above
}

In your XML file

<android.support.v7.widget.RecyclerView
    android:id="@+id/rv"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white"
    bind:bgColorSwipeLeft="@{@color/app_green}"
    bind:bgColorSwipeRight="@{@color/app_red}"
    bind:drawableSwipeLeft="@{@drawable/ic_check_white_24dp}"
    bind:drawableSwipeRight="@{@drawable/ic_close_white_24dp}"
    bind:onItemSwipeLeft="@{(position) -> handler.onItemSwipedLeft(position)}"
    bind:onItemSwipeRight="@{(position) -> handler.onItemSwipedRight(position)}"
    bind:swipeEnabled="@{true}"/>

Library used

Add Android Support Design dependency to your gradle file.

dependencies {
    compile 'com.android.support:design:{latest_version}'
}

Reference

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].