inboxrecyclerview / me.saket.inboxrecyclerview.page / ExpandablePageLayout

ExpandablePageLayout

open class ExpandablePageLayout : BaseExpandablePageLayout, PullToCollapseListener.OnPullListener

An expandable / collapsible layout for use with a InboxRecyclerView.

Types

PageState

enum class PageState

Constructors

<init>

ExpandablePageLayout(context: Context, attrs: AttributeSet? = null)

An expandable / collapsible layout for use with a InboxRecyclerView.

Properties

currentState

lateinit var currentState: ExpandablePageLayout.PageState

isCollapsed

val isCollapsed: Boolean

isCollapsedOrCollapsing

val isCollapsedOrCollapsing: Boolean

isCollapsing

val isCollapsing: Boolean

isExpanded

val isExpanded: Boolean

isExpandedOrExpanding

val isExpandedOrExpanding: Boolean

isExpanding

val isExpanding: Boolean

isExpandingOrCollapsing

val isExpandingOrCollapsing: Boolean

pullToCollapseEnabled

var pullToCollapseEnabled: Boolean

pullToCollapseInterceptor

var pullToCollapseInterceptor: OnPullToCollapseInterceptor?

pullToCollapseListener

val pullToCollapseListener: PullToCollapseListener

pullToCollapseThresholdDistance

var pullToCollapseThresholdDistance: Int

Minimum Y-distance the page has to be pulled before it's eligible for collapse.

Inherited Properties

animationDurationMillis

var animationDurationMillis: Long

animationInterpolator

var animationInterpolator: TimeInterpolator

Functions

addOnPullListener

fun addOnPullListener(listener: PullToCollapseListener.OnPullListener): Unit

Listener that gets called when this page is being pulled.

addStateChangeCallbacks

fun addStateChangeCallbacks(callbacks: PageStateChangeCallbacks): Unit

dispatchTouchEvent

open fun dispatchTouchEvent(ev: MotionEvent): Boolean

draw

open fun draw(canvas: Canvas): Unit

drawChild

open fun drawChild(canvas: Canvas, child: View, drawingTime: Long): Boolean

hasOverlappingRendering

open fun hasOverlappingRendering(): Boolean

locationOnScreen

fun locationOnScreen(): IntArray

onAttachedToWindow

open fun onAttachedToWindow(): Unit

onDetachedFromWindow

open fun onDetachedFromWindow(): Unit

onInterceptTouchEvent

open fun onInterceptTouchEvent(event: MotionEvent): Boolean

onPageAboutToCollapse

open fun onPageAboutToCollapse(collapseAnimDuration: Long): Unit

onPageAboutToExpand

open fun onPageAboutToExpand(expandAnimDuration: Long): Unit

onPageCollapsed

open fun onPageCollapsed(): Unit

Page is totally invisible to the user when this is called.

onPageExpanded

open fun onPageExpanded(): Unit

onPull

open fun onPull(deltaY: Float, currentTranslationY: Float, upwardPull: Boolean, deltaUpwardPull: Boolean, collapseEligible: Boolean): Unit

Called when the user is pulling down / up the expandable page or the list.

onRelease

open fun onRelease(collapseEligible: Boolean): Unit

Called when the user's finger is lifted.

onSizeChanged

open fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int): Unit

onTouchEvent

open fun onTouchEvent(event: MotionEvent): Boolean

pushParentToolbarOnExpand

fun pushParentToolbarOnExpand(toolbar: View): Unit

Push toolbar out of the screen during expansion when this page reaches the bottom of the toolbar. When this page is collapsing or being pulled downwards. the toolbar will be animated back to its position.

removeOnPullListener

fun removeOnPullListener(pullListener: PullToCollapseListener.OnPullListener): Unit

removeStateChangeCallbacks

fun removeStateChangeCallbacks(callbacks: PageStateChangeCallbacks): Unit

setNestedExpandablePage

fun setNestedExpandablePage(nestedPage: ExpandablePageLayout): Unit

Experimental: To be used when another ExpandablePageLayout is shown inside this page. This page will avoid all draw calls while the nested page is open to minimize overdraw.

Inherited Functions

animateDimensions

fun animateDimensions(toWidth: Int, toHeight: Int): Unit

resetClipping

fun resetClipping(): Unit

Immediately reset the clipping so that this layout is fully visible.

setClippedDimensions

fun setClippedDimensions(newClippedWidth: Int, newClippedHeight: Int): Unit

Extension Functions

executeOnMeasure

fun View.executeOnMeasure(listener: () -> Unit): Unit

Execute a runnable when a view's dimensions get measured and is laid out on the screen.

executeOnNextLayout

fun View.executeOnNextLayout(listener: () -> Unit): Unit

Execute a runnable when the next global layout happens for a View. Example usage includes waiting for a list to draw its children just after you have updated its adapter's data-set.

globalVisibleRect

fun View.globalVisibleRect(): RectF

locationOnScreen

fun View.locationOnScreen(loc: IntArray): Rect

Inheritors

StandaloneExpandablePageLayout

class StandaloneExpandablePageLayout : ExpandablePageLayout

Standalone because this page can live without an InboxRecyclerView.