Giter Club home page Giter Club logo

android-advancedrecyclerview's Introduction

Advanced RecyclerView

This RecyclerView extension library provides Google's Inbox app like swiping, Play Music app like drag-and-drop sorting and expandable item features. Works on API level 9 or later.

Download Android Arsenal


Download the example app

Get it on Google Play

Demonstration video on YouTube

Advanced

Target platforms

  • API level 9 or later (However, some animations are not supported on Gingerbread.)

Latest version

If you are using support library v23.0.x, please use v0.8.1 instead.

Getting started

This library is published on jCenter. Just add these lines to build.gradle.

dependencies {
    compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.8.6@aar'){
        transitive=true
    }
}

Migration Guide

The version 0.8.0 has fixed a lot of issues and introduced some new features. Some interface has changed and some methods/values/classes are marked as deprecated. Here is a quick guide for migrating from v0.7.x.

Swipe

The SwipeableItemAdapter interface has been changed drastically. Also, some methods and some constants are marked as deprecated because vertical swipe feature is added.

Recommended way

Implement the new SwipeableItemAdapter.onItemSwipe() method which returns SwipeResultAction objects. The SwipeResultAction class has these three overridable methods;

  • void onPerformAction()
    • => This method is called immediately after returning from the onItemSwipe() method. Can modify data set an
  • void onSlideAnimationEnd()
    • => This method is called when the item slide animation is completed.
  • void onCleanUp()
    • => This method is called after the onSlideAnimationEnd() method. Clear fields to avoid memory leak.

Easy way

Just change the interfaces which your adapter implementes as follows;

  • SwipeableItemAdapter -> LegacySwipeableItemAdapter
  • ExpandableSwipeableItemAdapter -> LegacyExpandableSwipeableItemAdapter

Drag & Drop

๐Ÿ‘‰ No special changes are required.

Expand

๐Ÿ‘‰ No special changes are required.

Usage

Please check the implementation of the simple examples.

Primary classes/interfaces

Drag & Drop related classes/interfaces

Class/Interface name Description
RecyclerViewDragDropManager Provides Drag & Drop sort operation
DraggableItemAdapter<T> Implement this interface on your RecyclerView.Adapter
DraggableItemViewHolder Implement this interface on your RecyclerView.ViewHolder
DraggableItemConstants Constant values area decleared in this interface

Swiping related classes/interfaces

Class/Interface name Description
RecyclerViewSwipeManager Provides Swipe operation ใ€€
SwipeableItemAdapter<T> Implement this interface on your RecyclerView.Adapter
SwipeableItemViewHolder Implement this interface on your RecyclerView.ViewHolder
SwipeableItemConstants Constant values area decleared in this interface

Expandable item related classes/interfaces

Class/Interface name Description
RecyclerViewExpandableItemManager Provides Expandable item function ใ€€
ExpandableItemViewHolder Implement this interface on your RecyclerView.ViewHolder
ExpandableItemAdapter<GVH, CVH> Implement this interface on your RecyclerView.Adapter
ExpandableDraggableItemAdapter<GVH, CVH> (optional) Implement this interface on your RecyclerView.Adapter to support Drag & Drop sort operation
ExpandableSwipeableItemAdapter<GVH, CVH> (optional) Implement this interface on your RecyclerView.Adapter to support Swipe operation
ExpandableItemConstants Constant values area decleared in this interface

RecyclerView decorations

Class/Interface name Description
ItemShadowDecorator Drop shadow decoration for pre-Lollipop devices
SimpleListDividerDecorator Simple list divider decoration

Misc.

Class name Description
RecyclerViewTouchActionGuardManager Suppress scrolling while item animations are running
AbstractDraggableItemViewHolder ViewHolder class which implements boilerplate code of the DraggableItemViewHolder interface
AbstractSwipeableItemViewHolder ViewHolder class which implements boilerplate code of the SwipeableItemViewHolder interface
AbstractExpandableItemViewHolder ViewHolder class which implements boilerplate code of the ExpandableItemViewHolder interface
AbstractDraggableSwipeableItemViewHolder ViewHolder class which implements boilerplate code of the DraggableItemViewHolder and the SwipeableItemViewHolder interfaces
AbstractExpandableItemAdapter<GVH, CVH> Adapter class which implements boilerplate code of the ExpandableItemAdapter interface

License

This library is licensed under the Apache Software License, Version 2.0.

See LICENSE for full of the license text.

Copyright (C) 2015 Haruki Hasegawa

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.

android-advancedrecyclerview's People

Contributors

h6ah4i avatar wakim avatar mluedke2 avatar thefex avatar barend-xebia avatar seansstewart avatar sowrabh avatar vinayak-garg avatar skyfishjy avatar

Stargazers

Piyush Poriya avatar

Watchers

James Cloos avatar Piyush Poriya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.