Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebonk authored Jun 25, 2017
1 parent b3339db commit 72fb2e9
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,28 @@ DraggableTreeView is a custom view that mimics a Tree View directory and also im
## Download library with Jitpack.io
Add this to your build.gradle file for your app.

```java
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```

Add this to your dependencies in build.gradle for your project.

```java
dependencies {
compile 'com.github.jakebonk:DraggableTreeViewExample:1.0.0'
}
```

## Usage

DraggableTreeView is organized by a custom adapter called TreeViewAdapter, I included a Simple implementation of the adapter class called SimpleTreeViewAdapter.


```java
DraggableTreeView draggableTreeView = (DraggableTreeView)findViewById(R.id.dtv);
TreeNode root = new TreeNode(this);
TreeNode item = new TreeNode("Item 1");
Expand All @@ -50,19 +55,22 @@ Add this to your dependencies in build.gradle for your project.
root.addChild(item);
SimpleTreeViewAdapter adapter = new SimpleTreeViewAdapter(this,root);
draggableTreeView.setAdapter(adapter);
```

You can also change both the succesful placeholder as well as the bad placeholder by passing a view through the function


```java
adapter.setBadPlaceholder(view);
```
or
```java
adapter.setPlaceholder(view);
```

adapter.setPlaceholder(view);
By assigning the variable maxLevel a value you can define how many levels the tree view can drag to.

draggableTreeView.maxLevels = 4;

```java
draggableTreeView.maxLevels = 4;
```

## To-Do

Expand Down

0 comments on commit 72fb2e9

Please sign in to comment.