Package 

Class DefaultTocHandler

  • All Implemented Interfaces:
    com.hyntix.pdf.viewer.toc.TocHandler

    
    public final class DefaultTocHandler
     implements TocHandler
                        

    A minimal TOC handler implementation. Provides basic functionality without styling - app should customize appearance.

    This is a simple vertical list of bookmarks. For more advanced UIs (sidesheets, bottom sheets, etc.), implement TocHandler directly.

    • Method Summary

      Modifier and Type Method Description
      final View getView() Get the view to add to your layout.
      Unit updateToc(List<PdfBookmark> bookmarks) Update the TOC with the given bookmarks.
      Unit show() Show the TOC UI
      Unit hide() Hide the TOC UI
      Boolean isVisible()
      Unit onBookmarkSelected(Function1<Integer, Unit> callback) Set the callback for when a bookmark is selected.
      • Methods inherited from class com.hyntix.pdf.viewer.toc.DefaultTocHandler

        toggle
      • Methods inherited from class java.lang.Object

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

      • DefaultTocHandler

        DefaultTocHandler(Context context)
    • Method Detail

      • getView

         final View getView()

        Get the view to add to your layout. Add this view to your activity/fragment layout.

      • updateToc

         Unit updateToc(List<PdfBookmark> bookmarks)

        Update the TOC with the given bookmarks. Called when the PDF document is loaded.

        Parameters:
        bookmarks - List of bookmarks from the PDF
      • onBookmarkSelected

         Unit onBookmarkSelected(Function1<Integer, Unit> callback)

        Set the callback for when a bookmark is selected. The callback receives the page index to navigate to.

        Parameters:
        callback - Function that receives the target page index (0-indexed)