Skip to content

Commit

Permalink
Merge branch 'feature/component' into 'develop'
Browse files Browse the repository at this point in the history
callback added



See merge request !3
  • Loading branch information
Irina Galata committed Nov 25, 2016
2 parents bed6c16 + bf83069 commit 9426d6b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.yalantis.jellytoolbar.listener

/**
* Created by irinagalata on 11/25/16.
*/
interface JellyListener {

fun onToolbarExpandingStarted()

fun onToolbarCollapsingStarted()

fun onToolbarExpanded()

fun onToolbarCollapsed()

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
import com.yalantis.jellytoolbar.Constant
import com.yalantis.jellytoolbar.R
import com.yalantis.jellytoolbar.listener.JellyListener
import kotlinx.android.synthetic.main.jelly_toolbar.view.*

/**
Expand Down Expand Up @@ -42,6 +44,7 @@ class JellyToolbar : FrameLayout, JellyWidget {
set(value) {
value?.let { jellyView.endColor = value }
}
var jellyListener: JellyListener? = null

private var mIsExpanded = false

Expand Down Expand Up @@ -86,6 +89,8 @@ class JellyToolbar : FrameLayout, JellyWidget {
jellyView.collapse()
contentLayout.collapse()
mIsExpanded = false
jellyListener?.onToolbarCollapsingStarted()
postDelayed({ jellyListener?.onToolbarCollapsed() }, Constant.ANIMATION_DURATION)
}

override fun expand() {
Expand All @@ -94,6 +99,8 @@ class JellyToolbar : FrameLayout, JellyWidget {
jellyView.expand()
contentLayout.expand()
mIsExpanded = true
jellyListener?.onToolbarExpandingStarted()
postDelayed({ jellyListener?.onToolbarExpanded() }, Constant.ANIMATION_DURATION)
}

}

0 comments on commit 9426d6b

Please sign in to comment.