Skip to content

Commit

Permalink
Bottom/Top sheet stateChanged support implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
TayfunCesur committed Jul 1, 2019
1 parent 976d59f commit c445d9a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class WavedActivity : AppCompatActivity() {
view = bottom_sheet,
type = CurvedBottomSheet.Type.WAVE,
callback = object : Callback {
override fun onStateChanged(p0: View, state: Int) {

}

override fun onSlide(p0: View, p1: Float) {
contentLayout.alpha = p1
dolphinLayout.alpha = 1 - p1
Expand Down
4 changes: 2 additions & 2 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 4
versionName "1.1"
versionCode 5
versionName "1.2"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import android.view.View

interface Callback {
fun onSlide(p0: View, p1: Float)
fun onStateChanged(p0: View, state: Int)
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ class CurvedBottomSheet(
}

override fun onStateChanged(p0: View, p1: Int) {

callback?.onStateChanged(p0, p1)
}
})
} else {
topSheetBehavior = TopSheetBehavior.from(view)
topSheetBehavior.setTopSheetCallback(object : TopSheetBehavior.TopSheetCallback() {
override fun onStateChanged(bottomSheet: View, newState: Int) {

callback?.onStateChanged(bottomSheet, newState)
}

override fun onSlide(bottomSheet: View, slideOffset: Float, isOpening: Boolean?) {
Expand Down

0 comments on commit c445d9a

Please sign in to comment.