Git Product home page Git Product logo

multilevelexpandableindentablelistview's Introduction

MultiLevelExpandableIndentableListView

This component is an adapter that can handle hierarchical data (e.g. comments) in a RecyclerView, so that the user can collapse and expand elements inside the hierarchy.

Here's a video of the SampleApp demo

Screenshot of the demo

How to import the library in your probject

There are three ways to import the library. The easiest way is this:

  1. Clone the repository

    $ git clone https://github.com/defacto133/MultiLevelExpandableIndentableListView.git

  2. Add these two lines to your settings.gradle file

    include ':multilevelexpindlistview'

    project(':multilevelexpindlistview').projectDir = new File('<path-to-cloned-repo>/MultiLevelExpandableIndentableListView/multilevelexpindlistview')

An alternative way is this :

  1. Clone the repository

    $ git clone https://github.com/defacto133/MultiLevelExpandableIndentableListView.git

  2. In Android Studio open the Module Settings (press F4)

  3. Click on the top left green cross to add a new module

  4. Select "Import Existing Project"

  5. As Source Directory select the directory where you cloned the repository

  6. The module :multilevelexpindlistview contains the library so you have to import this. The module :sampleapp is optional and it's a simple example of how to use the library.

  7. Click Finish

  8. Now in the Modules listing you see a new library module multilevelexpindlistview (and a project module sampleapp if you decided to import that too). In the Modules listing select your project module (usually is called app) and click on Dependencies.

  9. Click on the top right green cross and select Module dependency

  10. Select :multilevelexpindlistview

If you just want to import the aar file:

  1. Clone the repository

    $ git clone https://github.com/defacto133/MultiLevelExpandableIndentableListView.git

  2. cd to the direcotry created

    $ cd MultiLevelExpandableIndentableListView/

  3. Set a variable with the path to the Android SDK

    $ export ANDROID_HOME=<path-to-andoid-sdk>

  4. Build the project

    $ ./gradlew build

    This will make multilevelexpindlistview-release.aar in

    <path-to-cloned-repo>/MultiLevelExpandableIndentableListView/multilevelexpindlistview/build/outputs/aar/

  5. In Android Studio open the Module Settings (press F4)

  6. Click on the top left green arrow to add an new module

  7. Select "Import .JAR or .AAR Package" and select the .aar file from step 4

  8. Now in the Modules listing you see a new module multilevelexpindlistview. In the Modules listing select your project module (usually is called app) and click on Dependencies.

  9. Click on the top right green cross and select Module dependency

  10. Select :multilevelexpindlistview

Usage

You should extend the abstract class MultiLevelExpIndListAdapter (see MyAdapter.java in sampleapp for an example) and then associate your adapter with a RecyclerViw. The data that you pass to your MultiLevelExpIndListAdapter should implement the interface MultiLevelExpIndListAdapter.ExpIndData (see MyComment.java in sampleapp for an example).

multilevelexpandableindentablelistview's People

Contributors

defacto133 avatar

Watchers

James Cloos avatar  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.