epoxy-adapter / com.airbnb.epoxy / EpoxyVisibilityItem

EpoxyVisibilityItem

class EpoxyVisibilityItem

This class represent an item in a android.view.ViewGroup and it is being reused with multiple model via the update method. There is 1:1 relationship between an EpoxyVisibilityItem and a child within the android.view.ViewGroup.

It contains the logic to compute the visibility state of an item. It will also invoke the visibility callbacks on com.airbnb.epoxy.EpoxyViewHolder

This class should remain non-public and is intended to be used by EpoxyVisibilityTracker only.

Constructors

<init>

EpoxyVisibilityItem(adapterPosition: Int? = null)

This class represent an item in a android.view.ViewGroup and it is being reused with multiple model via the update method. There is 1:1 relationship between an EpoxyVisibilityItem and a child within the android.view.ViewGroup.

Properties

adapterPosition

var adapterPosition: Int

Functions

handleChanged

fun handleChanged(epoxyHolder: EpoxyViewHolder, visibilityChangedEnabled: Boolean): Boolean

handleFocus

fun handleFocus(epoxyHolder: EpoxyViewHolder, detachEvent: Boolean): Unit

handleFullImpressionVisible

fun handleFullImpressionVisible(epoxyHolder: EpoxyViewHolder, detachEvent: Boolean): Unit

handlePartialImpressionVisible

fun handlePartialImpressionVisible(epoxyHolder: EpoxyViewHolder, detachEvent: Boolean, thresholdPercentage: Int): Unit

handleVisible

fun handleVisible(epoxyHolder: EpoxyViewHolder, detachEvent: Boolean): Unit

reset

fun reset(newAdapterPosition: Int): Unit

shiftBy

fun shiftBy(offsetPosition: Int): Unit

update

fun update(view: View, parent: ViewGroup, detachEvent: Boolean): Boolean

Update the visibility item according the current layout.