DirectionalNavigationAdapter

class DirectionalNavigationAdapter(navigator: OverflowableNavigator, tapEdges: Set<DirectionalNavigationAdapter.TapEdge> = setOf(TapEdge.Horizontal), handleTapsWhileScrolling: Boolean = false, minimumHorizontalEdgeSize: Double = 80.0, horizontalEdgeThresholdPercent: Double? = 0.3, minimumVerticalEdgeSize: Double = 80.0, verticalEdgeThresholdPercent: Double? = 0.3, animatedTransition: Boolean = false) : InputListener

Helper handling directional UI events (e.g. edge taps or arrow keys) to turn the pages of a VisualNavigator.

This takes into account the reading progression of the navigator to turn pages in the right direction.

Add it to a navigator with addInputListener(DirectionalNavigationAdapter()).

Parameters

tapEdges

: Indicates which viewport edges handle taps.

handleTapsWhileScrolling

: Indicates whether the page turns should be handled when the publication is scrollable.

minimumHorizontalEdgeSize

: The minimum horizontal edge dimension triggering page turns, in pixels.

horizontalEdgeThresholdPercent

: The percentage of the viewport dimension used to compute the horizontal edge size. When null, minimumHorizontalEdgeSize will be used instead.

minimumVerticalEdgeSize

: The minimum vertical edge dimension triggering page turns, in pixels.

verticalEdgeThresholdPercent

: The percentage of the viewport dimension used to compute the vertical edge size. When null, minimumVerticalEdgeSize will be used instead.

animatedTransition

: Indicates whether the page turns should be animated.

Constructors

Link copied to clipboard
constructor(navigator: OverflowableNavigator, tapEdges: Set<DirectionalNavigationAdapter.TapEdge> = setOf(TapEdge.Horizontal), handleTapsWhileScrolling: Boolean = false, minimumHorizontalEdgeSize: Double = 80.0, horizontalEdgeThresholdPercent: Double? = 0.3, minimumVerticalEdgeSize: Double = 80.0, verticalEdgeThresholdPercent: Double? = 0.3, animatedTransition: Boolean = false)

Types

Link copied to clipboard

Indicates which viewport edges trigger page turns on tap.

Functions

Link copied to clipboard
open fun onDrag(event: DragEvent): Boolean

Called when the user dragged the content, but nothing handled the event internally.

Link copied to clipboard
open override fun onKey(event: KeyEvent): Boolean

Called when the user pressed or released a key, but nothing handled the event internally.

Link copied to clipboard
open override fun onTap(event: TapEvent): Boolean

Called when the user tapped the content, but nothing handled the event internally (eg. by following an internal link).