All Projects → yuqirong → Cardswipelayout

yuqirong / Cardswipelayout

Licence: mit
Use RecyclerView to achieve card swipe layout , like Tantan . (模仿探探卡片滑动效果的布局)

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Cardswipelayout

Turn Layout Manager
A carousel layout manager for RecyclerView
Stars: ✭ 946 (-12.49%)
Mutual labels:  layoutmanager, recyclerview
Stacklayoutmanager
customized layoutmanager,let item pile up like stackview/类似最美有物卡片堆叠效果
Stars: ✭ 343 (-68.27%)
Mutual labels:  layoutmanager, recyclerview
SpannedGridLayoutManager
Android RecyclerView.LayoutManager that resizes and reorders views based on SpanSize
Stars: ✭ 522 (-51.71%)
Mutual labels:  recyclerview, layoutmanager
epg magic carousel
Awesome RecyclerView with custom LayoutManager
Stars: ✭ 98 (-90.93%)
Mutual labels:  recyclerview, layoutmanager
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+411.84%)
Mutual labels:  layoutmanager, recyclerview
InfiniteScrollRecyclerView
Enables the RecyclerView to Auto scroll for indefinite time.
Stars: ✭ 49 (-95.47%)
Mutual labels:  recyclerview, layoutmanager
Horizontalpicker
A simple, customizable and easy to use picker where centre view is scaled up
Stars: ✭ 337 (-68.83%)
Mutual labels:  layoutmanager, recyclerview
Carouselrecyclerview
Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager.
Stars: ✭ 107 (-90.1%)
Mutual labels:  layoutmanager, recyclerview
Awesome Recyclerview Layoutmanager
RecyclerView-LayoutManager Resources
Stars: ✭ 581 (-46.25%)
Mutual labels:  layoutmanager, recyclerview
Spannedgridlayoutmanager
Android RecyclerView.LayoutManager that resizes and reorders views based on SpanSize
Stars: ✭ 492 (-54.49%)
Mutual labels:  layoutmanager, recyclerview
CardLayoutManager
A custom layoutManager providing a Tinder-like cards effect.
Stars: ✭ 37 (-96.58%)
Mutual labels:  recyclerview, layoutmanager
Timetablelayout
TimetableLayout is a RecyclerView.LayoutManager to display the timetable for Android.
Stars: ✭ 726 (-32.84%)
Mutual labels:  layoutmanager, recyclerview
RollingLayoutManager
vrgsoft.net
Stars: ✭ 57 (-94.73%)
Mutual labels:  recyclerview, layoutmanager
SlideView
🔖 Card RecycleViewManager, to make your interface cool.Use recyclerView to add cool effects to the view.
Stars: ✭ 16 (-98.52%)
Mutual labels:  recyclerview, layoutmanager
Cardstackview
📱Tinder like swipeable card view for Android
Stars: ✭ 1,850 (+71.14%)
Mutual labels:  layoutmanager, recyclerview
Chipslayoutmanager
ANDROID. ChipsLayoutManager (SpanLayoutManager, FlowLayoutManager). A custom layout manager for RecyclerView which mimicric TextView span behaviour, flow layouts behaviour with support of amazing recyclerView features
Stars: ✭ 3,138 (+190.29%)
Mutual labels:  layoutmanager, recyclerview
Reel Search Android
Reel Search for Android is a UI/UX design for autocomplete action. It is a beautiful minimalistic addition to any use case.
Stars: ✭ 110 (-89.82%)
Mutual labels:  layoutmanager, recyclerview
Jkcardlayout
高仿即刻APP探索页卡片布局拖拽、卡片前进、回退和下拉效果,采用RecyclerView和自定义LayoutManager实现
Stars: ✭ 111 (-89.73%)
Mutual labels:  layoutmanager, recyclerview
Stackcardlayoutmanager
Stars: ✭ 376 (-65.22%)
Mutual labels:  layoutmanager, recyclerview
Gallerylayoutmanager
New way to implements ViewPager/Gallery in Android with RecycleView
Stars: ✭ 684 (-36.73%)
Mutual labels:  layoutmanager, recyclerview

CardSwipeLayout

License

Introduction

CardSwipeLayout - Use RecyclerView to achieve card swipe layout , like Tantan .

Screenshot

screenshot.gif

Blog

《玩转仿探探卡片式滑动效果》

Usage

step 1

For build.gradle :

compile 'me.yuqirong:cardswipelayout:1.0.0'

Or Maven :

<dependency>
  <groupId>me.yuqirong</groupId>
  <artifactId>cardswipelayout</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

step 2

init RecyclerView firstly :

RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.setAdapter(...);

step 3

then set CardLayoutManager for RecyclerView and CardItemTouchHelperCallback for ItemTouchHelper . In addition , don't forget set OnSwipeListener for CardItemTouchHelperCallback :

// dataList means dataSource for adapter
CardItemTouchHelperCallback cardCallback = new CardItemTouchHelperCallback(recyclerView.getAdapter(), dataList);
ItemTouchHelper touchHelper = new ItemTouchHelper(cardCallback); CardLayoutManager cardLayoutManager = new CardLayoutManager(recyclerView, touchHelper);
recyclerView.setLayoutManager(cardLayoutManager);
touchHelper.attachToRecyclerView(recyclerView);
cardCallback.setOnSwipedListener(new OnSwipeListener<T>() {

    @Override
    public void onSwiping(RecyclerView.ViewHolder viewHolder, float ratio, int direction) {
        /**
         * will callback when the card are swiping by user
         * viewHolder : thee viewHolder of swiping card
         * ratio : the ratio of swiping , you can add some animation by the ratio
         * direction : CardConfig.SWIPING_LEFT means swiping from left;CardConfig.SWIPING_RIGHT means swiping from right
         *             CardConfig.SWIPING_NONE means not left nor right
         */
    }

    @Override
    public void onSwiped(RecyclerView.ViewHolder viewHolder, T t, int direction) {
	    /**
	     *  will callback when the card swiped from screen by user
	     *  you can also clean animation from the itemview of viewHolder in this method
	     *  viewHolder : the viewHolder of swiped cards
	     *  t : the data of swiped cards from dataList
	     *  direction : CardConfig.SWIPED_LEFT means swiped from left;CardConfig.SWIPED_RIGHT means swiped from right
	     */
    }

    @Override
    public void onSwipedClear() {
        /**
         *  will callback when all cards swiped clear
         *  you can load more data 
         */
    }

});

Finally , enjoy it !!!

If you have any questions , you can leave a message in Issues.

Contact Me

License

MIT License

Copyright (c) 2017 yuqirong

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
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].