Google is committed to advancing racial equity for Black communities. See how.

PointerEventPass

enum class PointerEventPass
kotlin.Any
   ↳ kotlin.Enum<androidx.compose.ui.input.pointer.PointerEventPass>
   ↳ androidx.compose.ui.input.pointer.PointerEventPass

The enumeration of passes where PointerInputChange traverses up and down the UI tree.

PointerInputChanges traverse throw the hierarchy in the following passes:

  1. Initial: Down the tree from ancestor to descendant.
  2. Main: Up the tree from descendant to ancestor.
  3. Final: Down the tree from ancestor to descendant.

These passes serve the following purposes:

  1. Initial: Allows ancestors to consume aspects of PointerInputChange before descendants. This is where, for example, a scroller may block buttons from getting tapped by other fingers once scrolling has started.
  2. Main: The primary pass where gesture filters should react to and consume aspects of PointerInputChanges. This is the primary path where descendants will interact with PointerInputChanges before parents. This allows for buttons to respond to a tap before a container of the bottom to respond to a tap.
  3. Final: This pass is where children can learn what aspects of PointerInputChanges were consumed by parents during the Main pass. For example, this is how a button determines that it should no longer respond to fingers lifting off of it because a parent scroller has consumed movement in a PointerInputChange.

Summary

Enum values

Enum values

Final

enum val Final : PointerEventPass

Initial

enum val Initial : PointerEventPass

Main

enum val Main : PointerEventPass