All Projects → JerryChan123 → Reswipecard

JerryChan123 / Reswipecard

Licence: apache-2.0
a light lib for swipe the cards implemented by RecyclerView

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Reswipecard

Stacklayout
Android 层叠卡片控件,仿"探探app"
Stars: ✭ 437 (+90%)
Mutual labels:  swipe, card
Recyclerviewhelper
📃 [Android Library] Giving powers to RecyclerView
Stars: ✭ 643 (+179.57%)
Mutual labels:  swipe, recyclerview
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 (+103.91%)
Mutual labels:  swipe, recyclerview
React Native Card Stack Swiper
Tinder like react-native card stack swiper
Stars: ✭ 315 (+36.96%)
Mutual labels:  swipe, card
Fullrecyclerview
This is a compilation of different kinds and actions in recyclerView
Stars: ✭ 127 (-44.78%)
Mutual labels:  swipe, recyclerview
Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+1426.96%)
Mutual labels:  swipe, recyclerview
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+2305.65%)
Mutual labels:  swipe, recyclerview
PullSeparateRecyclerView
No description or website provided.
Stars: ✭ 29 (-87.39%)
Mutual labels:  recyclerview, card
React Swipe Card
Tinder style swipe cards
Stars: ✭ 120 (-47.83%)
Mutual labels:  swipe, card
Swipemenulayout
🔥一个零耦合的侧滑菜单,支持RecyclerView、ListView、GridView等不同条目布局,支持菜单在左或在右,可选滑动阻塞,是否禁用等功能
Stars: ✭ 120 (-47.83%)
Mutual labels:  swipe, recyclerview
Cardslideview
一行代码实现ViewPager卡片效果,比ViewPager2更强大,底层同样是RecyclerView
Stars: ✭ 301 (+30.87%)
Mutual labels:  recyclerview, card
Android Swipecards View
Android library to implement cards stack view with swipe to remove feature
Stars: ✭ 162 (-29.57%)
Mutual labels:  swipe, card
Recyclerviewevent
RecyclerView onItemClick、onItemLongClick、drag、swipe、divider、reuse disorder RecyclerView 梳理:点击&长按事件、分割线、拖曳排序、滑动删除、优雅解决 EditText 和 CheckBox 复用错乱问题
Stars: ✭ 265 (+15.22%)
Mutual labels:  swipe, recyclerview
Stacklayoutmanager
customized layoutmanager,let item pile up like stackview/类似最美有物卡片堆叠效果
Stars: ✭ 343 (+49.13%)
Mutual labels:  recyclerview, card
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 (-78.7%)
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 (+2148.7%)
Mutual labels:  swipe, recyclerview
swipeablerecyclerview
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.
Stars: ✭ 16 (-93.04%)
Mutual labels:  recyclerview, swipe
XamarinItemTouchHelper
Basic example of using ItemTouchHelper to add drag & drop and swipe-to-dismiss to RecyclerView for Xamarin
Stars: ✭ 35 (-84.78%)
Mutual labels:  recyclerview, swipe
React Native Deck Swiper
tinder like react-native deck swiper
Stars: ✭ 1,261 (+448.26%)
Mutual labels:  swipe, card
Swipeablecards
Stars: ✭ 136 (-40.87%)
Mutual labels:  swipe, recyclerview

ReSwipeCard

This project is no longer maintained, feel free to pull request if you have some fixs.

plz start the project if u feel nice xD

version log

1.0.1 :fix some bugs

ReSwipeCard is based on CardSwipeLayout

中文说明

Introduction:

  • Solve the conflict between scroll and click

  • support for defining directions to slide

  • support for defining directions to slide out

  • support for defining durations to slide out

  • support for looping the card or not

  • support for defining the way to stack the cards

  • support for defining the numbers of the stacked card

  • support for sliding card automatically

below is the demo of this projec ,you could install the app-debug.apk to see on the mobile:

gif


How to use:

//don't use RecyclerView on your project
dependencies {
    compile ('lin.jerrylin0322.reswipecard:reswipecard:1.0.1')
}
//already use RecyclerView on your project
dependencies {
    compile ('lin.jerrylin0322.reswipecard:reswipecard:1.0.1') {
                exclude module:'recyclerview-v7' }
}

maven:

<dependency>
  <groupId>lin.jerrylin0322.reswipecard</groupId>
  <artifactId>reswipecard</artifactId>
  <version>1.0.1</version>
  <type>pom</type>
</dependency>

in Java:

 CardSetting setting=new CardSetting();
        setting.setSwipeListener(new OnSwipeCardListener<CardBean>() {
            @Override
            public void onSwiping(RecyclerView.ViewHolder viewHolder, float dx, float dy, int direction) {
                switch (direction) {
                    case ReItemTouchHelper.DOWN:
                        Log.e("aaa", "swiping direction=down");
                        break;
                    case ReItemTouchHelper.UP:
                        Log.e("aaa", "swiping direction=up");
                        break;
                    case ReItemTouchHelper.LEFT:
                        Log.e("aaa", "swiping direction=left");
                        break;
                    case ReItemTouchHelper.RIGHT:
                        Log.e("aaa", "swiping direction=right");
                        break;
                }
            }

            @Override
            public void onSwipedOut(RecyclerView.ViewHolder viewHolder, CardBean o, int direction) {
                switch (direction) {
                    case ReItemTouchHelper.DOWN:
                        Toast.makeText(NormalActivity.this, "swipe down out", Toast.LENGTH_SHORT).show();
                        break;
                    case ReItemTouchHelper.UP:
                        Toast.makeText(NormalActivity.this, "swipe up out ", Toast.LENGTH_SHORT).show();
                        break;
                    case ReItemTouchHelper.LEFT:
                        Toast.makeText(NormalActivity.this, "swipe left out", Toast.LENGTH_SHORT).show();
                        break;
                    case ReItemTouchHelper.RIGHT:
                        Toast.makeText(NormalActivity.this, "swipe right out", Toast.LENGTH_SHORT).show();
                        break;
                }
            }

            @Override
            public void onSwipedClear() {
                Toast.makeText(NormalActivity.this, "cards are consumed", Toast.LENGTH_SHORT).show();
            }
        });
        CardTouchHelperCallback helperCallback = new CardTouchHelperCallback(mRecyclerView, list,setting);
        mReItemTouchHelper = new ReItemTouchHelper(helperCallback);
        CardLayoutManager layoutManager = new CardLayoutManager(mReItemTouchHelper, setting);
        mRecyclerView.setLayoutManager(layoutManager);
        CardAdapter cardAdapter = new CardAdapter(list);
 		mRecyclerView.setAdapter(cardAdapter);

You need to use SwipeTouchLayout as the root node in your adapter's xml item:

<?xml version="1.0" encoding="utf-8"?>
<com.lin.cardlib.SwipeTouchLayout xmlns:android="http://schemas.android.com/apk/res/android"
                                  xmlns:app="http://schemas.android.com/apk/res-auto"
                                  android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:paddingBottom="30dp">

  ...

</com.lin.cardlib.SwipeTouchLayout>

CardSetting

All parameters are defined onCardSetting.

The direction for sliding:

public int getSwipeDirection() {
        return ReItemTouchHelper.LEFT | ReItemTouchHelper.RIGHT
                | ReItemTouchHelper.UP |ReItemTouchHelper.DOWN;
    }

If you don't need the left slide,just remove from the above,and the effect is like below:

gif

The direction for sliding out:

    public int couldSwipeOutDirection() {
        return ReItemTouchHelper.LEFT | ReItemTouchHelper.RIGHT
                | ReItemTouchHelper.UP |ReItemTouchHelper.DOWN;
    }

If you don't need the top slide out,just remove from the above,and the effect is like below:

gif

The way to stack the cards:

CardConfig.java
public int getStackDirection() {
        return  ReItemTouchHelper.DOWN;
    }

All ways to stack the cards:

Alt text

Whether needs to loop thr card

 public boolean isLoopCard() {
        return true;
    }

The example for not looping the card:

gif

Sliding out the card automatically:

//direction=ReItemTouchHelper.LEFT or ReItemTouchHelper.RIGHT .etc
mReItemTouchHelper.swipeManually(direction);

The degressive scale value for every card(first card is 1f,second card is 0.9f ...)

    public float getCardScale() {
        return DEFAULT_SCALE;
    }

The count for show cards:

  public int getShowCount() {
        return DEFAULT_SHOW_ITEM;
    }

Max rotate value when sliding card:

   public float getCardRotateDegree() {
        return DEFAULT_ROTATE_DEGREE;
    }

The offset value for every card(first card is 0,second card is DEFAULT_TRANSLATE_Y,third card is DEFAULT_TRANSLATE_Y*2 ...)

 public int getCardTranslateDistance() {
        return DEFAULT_TRANSLATE_Y;
    }

Need to open the haveware acceleration:

    public boolean enableHardWare() {
        return true;
    }

The duration for sliding out:

    public int getSwipeOutAnimDuration() {
        return 400;
    }

Decide the Distance for notifing the card to slided out,default is the RecyclerView's width'*0.3f:

    public float getSwipeThreshold() {
        return 0.3f;
    }

If you have any problem ,talk to me through Issues


License

 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.
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].