Interface PageNavigator

  • All Implemented Interfaces:

    
    public interface PageNavigator
    
                        

    Class responsible for managing current page and page navigation history in the .

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract int getPageIndex() Gets currently displayed document page.
      abstract int getPageCount() Gets number of pages in the document.
      abstract void setPageIndex(@IntRange(from = 0) int pageIndex) Sets the pageIndex to be displayed (0 is the first one), using our default decision on animating, which is to animate the transition if the page is next/before the current page, and not animate if further away.
      abstract void setPageIndex(@IntRange(from = 0) int pageIndex, boolean animated) Sets the pageIndex to be displayed (0 is the first one).
      abstract void beginNavigation() Notifies the navigation manager that calls to setPageIndex should be added to the navigation history until endNavigation is called.
      abstract void endNavigation() Commits the page changes to the navigation history dropping everything but the very last one.
      abstract NavigationBackStack<NavigationBackStack.NavigationItem<Integer>> getNavigationHistory() Returns the navigation history owned by this manager.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • getPageIndex

        @IntRange(from = "-1") abstract int getPageIndex()

        Gets currently displayed document page.

        Returns:

        Currently displayed document page, -1 if document is null.

      • getPageCount

        @IntRange(from = "-1") abstract int getPageCount()

        Gets number of pages in the document.

        Returns:

        Number of pages in the displayed document, -1 if document is null.

      • setPageIndex

        @UiThread() abstract void setPageIndex(@IntRange(from = 0) int pageIndex)

        Sets the pageIndex to be displayed (0 is the first one), using our default decision on animating, which is to animate the transition if the page is next/before the current page, and not animate if further away. For custom animation control , use setPageIndex.

        This method will throw an exception if pageIndex < 0 || pageIndex >= pageCount (as returned by getPageCount).

        Parameters:
        pageIndex - Target page which should be displayed.
      • setPageIndex

        @UiThread() abstract void setPageIndex(@IntRange(from = 0) int pageIndex, boolean animated)

        Sets the pageIndex to be displayed (0 is the first one). If animated is set to true, the page jump will be animated. If false, the page will be shown immediately.

        This method will throw an exception if pageIndex < 0 || pageIndex >= pageCount (as returned by getPageCount).

        Parameters:
        pageIndex - Target page which should be displayed.
        animated - Set to true, if a transitioning animation should be performed.
      • endNavigation

        @UiThread() abstract void endNavigation()

        Commits the page changes to the navigation history dropping everything but the very last one.