Skip to content

Commit

Permalink
Update REDME
Browse files Browse the repository at this point in the history
  • Loading branch information
Semper-Viventem committed Jul 27, 2018
1 parent b4723dc commit 83f7d55
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 @@ -14,16 +14,21 @@ This library makes it easy to implement a [Backdrop](https://material.io/design/


## Download

**JCenter (Recommended):**
####JCenter (Recommended):
**For support library:**
```groovy
dependencies {
implementation 'ru.semper-viventem.backdrop:backdrop:0.1.2'
}
```
**For Android X:**
```groovy
dependencies {
implementation 'ru.semper-viventem.backdrop:backdrop:0.1.2_x'
}
```
*or*

**JitPack:**
####JitPack:
```groovy
repositories {
...
Expand All @@ -34,6 +39,7 @@ dependencies {
implementation 'com.github.Semper-Viventem:BackdropView:0.1.2'
}
```
**Android X:**

## How to use it?
You need to add a layout Toolbar, back container and foreground container
Expand Down Expand Up @@ -88,7 +94,8 @@ fun <T : CoordinatorLayout.Behavior<*>> View.findBehavior(): T = layoutParams.ru

```kotlin
...
val backdropBehavior = foregroundContainer.findBehavior() // find behavior

val backdropBehavior: BackdropBehavior = foregroundContainer.findBehavior() // find behavior

with(backdropBehavior) {
attacheBackContainer(R.id.backContainer) // set back container
Expand All @@ -100,9 +107,10 @@ with(backdropBehavior) {

// add listener
addOnDropListener(object : BackdropBehavior.OnDropListener {
// TODO: do anyging
}
})
override fun onDrop(dropState: BackdropBehavior.DropState, fromUser: Boolean) {
// TODO: handle listener
}
})
}

...
Expand Down

0 comments on commit 83f7d55

Please sign in to comment.