Skip to content

Commit

Permalink
Merge pull request #10 from Semper-Viventem/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Semper-Viventem authored Jul 27, 2018
2 parents f692008 + bcad856 commit c030ad5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 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
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ru.semper_viventem.backdropview.ui.common

import android.content.Context
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
Expand All @@ -22,10 +21,10 @@ abstract class Screen : Fragment {
return inflater.inflate(layoutId, container, false)
}

override fun onStart() {
super.onStart()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

onInitView(view!!)
onInitView(view)
}

abstract fun onInitView(view: View)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class TextScreen : Screen() {

override fun onInitView(view: View) {

view.image.load("http://mariakucherenko.com/wp-content/uploads/2011/08/20110814_%D0%BA%D0%BE%D1%82.jpg")
view.image.load("https://habrastorage.org/webt/r9/p8/fi/r9p8figkbszo_cyhdg-6nad4mp0.png")
}
}

0 comments on commit c030ad5

Please sign in to comment.