Package 

Interface DecorableNavigator

  • All Implemented Interfaces:
    org.readium.r2.navigator.Navigator

    
    public interface DecorableNavigator
     implements Navigator
                        

    A navigator able to render arbitrary decorations over a publication.

    • Method Detail

      • applyDecorations

         abstract Unit applyDecorations(List<Decoration> decorations, String group)

        Declares the current state of the decorations in the given decoration group.

        The Navigator will decide when to actually render each decoration efficiently. Your only responsibility is to submit the updated list of decorations when there are changes. Name each decoration group as you see fit. A good practice is to use the name of the feature requiring decorations, e.g. annotation, search, tts, etc.

      • supportsDecorationStyle

         abstract <T extends Decoration.Style> Boolean supportsDecorationStyle(KClass<T> style)

        Indicates whether the Navigator supports the given decoration style class.

        You should check whether the Navigator supports drawing the decoration styles required by a particular feature before enabling it. For example, underlining an audiobook does not make sense, so an Audiobook Navigator would not support the underline decoration style.

      • getCurrentLocator

         abstract StateFlow<Locator> getCurrentLocator()

        Current position in the publication. Can be used to save a bookmark to the current position.