Skip to content

NodeScrollEvent

abstract class NodeScrollEvent<N extends Node>
Extends: NodeEvent<N>
Known subtypes: NodeScrollEvent.Pre, NodeScrollEvent.Post
Package: dev.joid.lib.ui.event.impl.node · Module: core · Source: NodeScrollEvent.java

A change of the scroll of a node on one axis, with the offset before and after, in a cancellable Pre and a Post.

Node.beforeScroll receives a NodeScrollEvent.Pre and can refuse the scroll; Node.onScroll, Node.onScrollToEnd and Node.onScrollEndReached receive a NodeScrollEvent.Post.

ReturnsSignatureSummary
AxisgetAxis()Returns the axis that scrolls: HORIZONTAL or VERTICAL.
doublegetOffset()Returns the offset after the change, in design pixels: 0D at the start of the content, down to minus the scrollable length at its end.
doublegetPrevious()Returns the offset before the change, in design pixels.
Inherited from NodeEvent (1)

getNode

Axis getAxis()

Returns the axis that scrolls: HORIZONTAL or VERTICAL.

double getOffset()

Returns the offset after the change, in design pixels: 0D at the start of the content, down to minus the scrollable length at its end. At onScrollEndReached, the offset that the content reached.

double getPrevious()

Returns the offset before the change, in design pixels.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page