pczhu / android-advancedrecyclerview-master

包含侧滑,删除,嵌套等功能的ListView

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Android Arsenal


Download the example app

Get it on Google Play

Demonstration video on YouTube

Advanced

NOTE: This library does not contain Snackbar. The above example app uses third-party library. (thx. Snackbar developed by William Mora ).


Target platforms

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

Latest version

  • Version 0.7.4 (Aug 1, 2015)

Getting started

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

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

This library is provided as the AAR format. The source jar file won't be downloaded automatically (due to the current Gradle and Anndroid Studio limitation), so javadoc comments are not displayed on IDE.

Here is a workaround thanks to the superb AARLinkSources Gradle plugin !

buildscript {
    repositories {
        maven { url 'https://raw.github.com/xujiaao/mvn-repository/master/releases' }
    }

    dependencies {
        classpath 'com.github.xujiaao:aarLinkSources:1.0.0'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'aar-link-sources'

android {
    ...
}

dependencies {
    compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.7.4@aar'){
        transitive=true
    }
    aarLinkSources 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.7.4:sources@jar'
}

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

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

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

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.

About

包含侧滑,删除,嵌套等功能的ListView

License:Apache License 2.0


Languages

Language:Java 100.0%