Package 

Class DirectionalNavigationAdapter

  • All Implemented Interfaces:
    org.readium.r2.navigator.input.InputListener

    
    public final class DirectionalNavigationAdapter
     implements 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()).

    • Method Summary

      Modifier and Type Method Description
      Boolean onTap(TapEvent event) Called when the user tapped the content, but nothing handled the event internally (eg.
      Boolean onKey(KeyEvent event) Called when the user pressed or released a key, but nothing handled the event internally.
      • Methods inherited from class org.readium.r2.navigator.util.DirectionalNavigationAdapter

        onDrag
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DirectionalNavigationAdapter

        DirectionalNavigationAdapter(OverflowableNavigator navigator, Set<DirectionalNavigationAdapter.TapEdge> tapEdges, Boolean handleTapsWhileScrolling, Double minimumHorizontalEdgeSize, Double horizontalEdgeThresholdPercent, Double minimumVerticalEdgeSize, Double verticalEdgeThresholdPercent, Boolean animatedTransition)
        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.
        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.
        animatedTransition - : Indicates whether the page turns should be animated.
    • Method Detail

      • onTap

         Boolean onTap(TapEvent event)

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

      • onKey

         Boolean onKey(KeyEvent event)

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