Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Documentation and Make Demo easier to run #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
74 changes: 17 additions & 57 deletions README.md
@@ -1,71 +1,31 @@
# 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](http://img.youtube.com/vi/vZoNEck1uJk/0.jpg)](http://youtu.be/vZoNEck1uJk)

### 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
### How to import the library in your project

If you just want to import the aar file:
Add the following dependency to `build.gradle`

1. Clone the repository
```
dependencies {
compile 'com.github.defacto133:MultiLevelExpandableIndentableListView:-SNAPSHOT'
}
```

`$ 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/
### Usage

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
You should extend the abstract class `MultiLevelExpIndListAdapter` (see `MyAdapter.java` in `sampleapp` for an example) and then associate your adapter with a `RecyclerView`.

### Usage
```
public class MyAdapter extends MultiLevelExpIndListAdapter {
```

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).

```
public class MyComment extends MultiLevelExpIndListAdapter.ExpIndData
```
1 change: 0 additions & 1 deletion multilevelexpindlistview/build.gradle
Expand Up @@ -5,7 +5,6 @@ android {
buildToolsVersion "20.0.0"

defaultConfig {
applicationId "com.oissela.software.multilevelexpindlistview"
minSdkVersion 11
targetSdkVersion 21
versionCode 1
Expand Down
2 changes: 1 addition & 1 deletion sampleapp/build.gradle
Expand Up @@ -13,7 +13,7 @@ android {
}
buildTypes {
release {
runProguard false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Expand Down