From 83f7d552ad5464cce15f1cbfa603759e70e9236b Mon Sep 17 00:00:00 2001 From: Semper-Viventem <kostyaxxx8@gmail.com> Date: Fri, 27 Jul 2018 17:27:28 +0300 Subject: [PATCH 1/4] Update REDME --- README.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5a7d2d7..206642b 100644 --- a/README.md +++ b/README.md @@ -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 { ... @@ -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 @@ -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 @@ -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 + } + }) } ... From 4ab6305baa0074bde5b2f09c6eb649836b0fd80a Mon Sep 17 00:00:00 2001 From: Semper-Viventem <kostyaxxx8@gmail.com> Date: Fri, 27 Jul 2018 17:28:25 +0300 Subject: [PATCH 2/4] Update REDME --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 206642b..e27a199 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ This library makes it easy to implement a [Backdrop](https://material.io/design/ ## Download -####JCenter (Recommended): +###JCenter (Recommended): + **For support library:** ```groovy dependencies { @@ -28,7 +29,7 @@ dependencies { } ``` *or* -####JitPack: +###JitPack: ```groovy repositories { ... From 807347e4fb92f7bead40c97cfea2fb388c518500 Mon Sep 17 00:00:00 2001 From: Semper-Viventem <kostyaxxx8@gmail.com> Date: Fri, 27 Jul 2018 17:30:06 +0300 Subject: [PATCH 3/4] Update REDME --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e27a199..0fe02b2 100644 --- a/README.md +++ b/README.md @@ -14,22 +14,21 @@ This library makes it easy to implement a [Backdrop](https://material.io/design/ ## Download -###JCenter (Recommended): +**JCenter (Recommended):** -**For support library:** +*For support library:* ```groovy dependencies { implementation 'ru.semper-viventem.backdrop:backdrop:0.1.2' } ``` -**For Android X:** +*For Android X:* ```groovy dependencies { implementation 'ru.semper-viventem.backdrop:backdrop:0.1.2_x' } ``` -*or* -###JitPack: +**JitPack:** ```groovy repositories { ... @@ -40,7 +39,6 @@ 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 From bcad856ba86b1e2982538e7478f896f5271c7ccd Mon Sep 17 00:00:00 2001 From: Semper-Viventem <kostyaxxx8@gmail.com> Date: Fri, 27 Jul 2018 17:42:46 +0300 Subject: [PATCH 4/4] Update image and base screen --- .../ru/semper_viventem/backdropview/ui/common/Screen.kt | 7 +++---- .../ru/semper_viventem/backdropview/ui/text/TextScreen.kt | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sample/src/main/kotlin/ru/semper_viventem/backdropview/ui/common/Screen.kt b/sample/src/main/kotlin/ru/semper_viventem/backdropview/ui/common/Screen.kt index 5f7b67f..b201c92 100644 --- a/sample/src/main/kotlin/ru/semper_viventem/backdropview/ui/common/Screen.kt +++ b/sample/src/main/kotlin/ru/semper_viventem/backdropview/ui/common/Screen.kt @@ -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 @@ -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) diff --git a/sample/src/main/kotlin/ru/semper_viventem/backdropview/ui/text/TextScreen.kt b/sample/src/main/kotlin/ru/semper_viventem/backdropview/ui/text/TextScreen.kt index 0f5863b..3dc9bcc 100644 --- a/sample/src/main/kotlin/ru/semper_viventem/backdropview/ui/text/TextScreen.kt +++ b/sample/src/main/kotlin/ru/semper_viventem/backdropview/ui/text/TextScreen.kt @@ -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") } } \ No newline at end of file