Skip to content

Commit

Permalink
Merge branch 'master' into feature/androidx
Browse files Browse the repository at this point in the history
  • Loading branch information
Semper-Viventem committed Jul 27, 2018
2 parents 141d717 + 807347e commit bdd7941
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@ This library makes it easy to implement a [Backdrop](https://material.io/design/


## Download

**JCenter (Recommended):**

*For support library:*
```groovy
dependencies {
implementation 'ru.semper-viventem.backdrop:backdrop:0.1.2'
}
```
*or*

*For Android X:*
```groovy
dependencies {
implementation 'ru.semper-viventem.backdrop:backdrop:0.1.2_x'
}
```
**JitPack:**
```groovy
repositories {
Expand Down Expand Up @@ -88,7 +93,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 +106,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 bdd7941

Please sign in to comment.