fAns1k/android-advancedrecyclerview


RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.fAns1k:android-advancedrecyclerview:0.10.6'
	}
	dependencies {
		implementation("com.github.fAns1k:android-advancedrecyclerview:0.10.6")
	}
	<dependency>
	    <groupId>com.github.fAns1k</groupId>
	    <artifactId>android-advancedrecyclerview</artifactId>
	    <version>0.10.6</version>
	</dependency>

                            
    libraryDependencies += "com.github.fAns1k" % "android-advancedrecyclerview" % "0.10.6"
        
        

                            
    :dependencies [[com.github.fAns1k/android-advancedrecyclerview "0.10.6"]]
        
        

Readme


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 Method Count

Download the example app

<a href="https://play.google.com/store/apps/details?id=com.h6ah4i.android.example.advrecyclerview"> <img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" width="165" height="64" /> </a>

Demonstration video on YouTube

<a href="http://www.youtube.com/watch?feature=player_embedded&v=S7cSwMArjUQ" target="_blank"> <img src="http://img.youtube.com/vi/S7cSwMArjUQ/0.jpg" alt="Advanced" width="480" height="360" border="10" /> </a>

Target platforms

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

Latest version

Recent Breaking Change Info

  • v0.10.4: OnGroupExpandListener and OnGroupCollapseListener takes payload parameter. (related: issue #350)

Getting started

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

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

Usage

Please check the implementation of the simple examples.

Drag & Drop related examples

Expandable item related examples

Swipeable related examples

Headers and Footers examples

WrapperAdapter examples

Hybrid examples

Primary classes/interfaces

WrapperAdapter related classes/interfaces

| Class/Interface name | Description | |---------------------------------------|----------------------------------------------------------| | WrapperAdapter<VH> | Adds several methods to RecyclerView.Adapter to manage with wrapped adapters | | ItemIdComposer | Utility class for handling packed item IDs | | ItemViewTypeComposer | Utility class for handling packed item view types | | SimpleWrapperAdapter<VH> | Base implementation of WrapperAdapter which wraps one adapter |

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 | | DraggableItemAnimator

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 | | SwipeDismissItemAnimator

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 |

Other examples

|

iOS Mail app like swipe action

<img src="images/other_example_ios_mail.png" width="200" />

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.