inboxrecyclerview / me.saket.inboxrecyclerview / InboxRecyclerView

InboxRecyclerView

open class InboxRecyclerView : ScrollSuppressibleRecyclerView, InternalPageCallbacks

A RecyclerView where items can expand and collapse to and from an ExpandablePageLayout.

Types

ExpandedItem

data class ExpandedItem : Parcelable

Constructors

<init>

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

A RecyclerView where items can expand and collapse to and from an ExpandablePageLayout.

Properties

expandablePage

var expandablePage: ExpandablePageLayout?

The expandable page to be used with this list. Setting it to null will reset the older page's state.

expandedItem

var expandedItem: InboxRecyclerView.ExpandedItem

Details about the currently expanded item.

itemExpandAnimator

var itemExpandAnimator: ItemExpandAnimator

Controls how InboxRecyclerView items are animated when the page is moving.

tintPainter

var tintPainter: TintPainter

Controls how items are dimmed when the page is expanding/collapsing.

Functions

canScrollProgrammatically

open fun canScrollProgrammatically(): Boolean

collapse

fun collapse(): Unit

dispatchTouchEvent

open fun dispatchTouchEvent(ev: MotionEvent?): Boolean

draw

open fun draw(canvas: Canvas): Unit

expandFromTop

fun expandFromTop(immediate: Boolean = false): Unit

Expand from the top, pushing all items out of the window towards the bottom.

expandItem

fun expandItem(itemId: Long, immediate: Boolean = false): Unit

onDetachedFromWindow

open fun onDetachedFromWindow(): Unit

onPageAboutToCollapse

open fun onPageAboutToCollapse(): Unit

onPageAboutToExpand

open fun onPageAboutToExpand(): Unit

onPageCollapsed

open fun onPageCollapsed(): Unit

Page is no longer visible at this point.

onPageFullyCovered

open fun onPageFullyCovered(): Unit

Called when this page has fully covered the list. This can happen in two situations:

onPagePull

open fun onPagePull(deltaY: Float): Unit

Page is being pulled. Sync the scroll with the list.

onPageRelease

open fun onPageRelease(collapseEligible: Boolean): Unit

Called when this page was released after being pulled.

onRestoreInstanceState

open fun onRestoreInstanceState(state: Parcelable): Unit

onSaveInstanceState

open fun onSaveInstanceState(): Parcelable

optimizeActivityBackgroundOverdraw

fun optimizeActivityBackgroundOverdraw(activity: Activity): Unit

Experimental: Reduce overdraw by 1 level by removing the Activity Window's background when the ExpandablePageLayout is expanded. No point in drawing it when it's not visible to the user.

setAdapter

open fun setAdapter(adapter: Adapter<*>?): Unit

swapAdapter

open fun swapAdapter(adapter: Adapter<*>?, removeAndRecycleExistingViews: Boolean): Unit

Inherited Functions

scrollBy

open fun scrollBy(x: Int, y: Int): Unit

scrollTo

open fun scrollTo(x: Int, y: Int): Unit

scrollToPosition

open fun scrollToPosition(position: Int): Unit

smoothScrollBy

open fun smoothScrollBy(dx: Int, dy: Int): Unit

smoothScrollToPosition

open fun smoothScrollToPosition(position: 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