-
- 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.
-
-
Constructor Summary
Constructors Constructor Description DefaultTocHandler(Context context)
-
Method Summary
Modifier and Type Method Description final ViewgetView()Get the view to add to your layout. UnitupdateToc(List<PdfBookmark> bookmarks)Update the TOC with the given bookmarks. Unitshow()Show the TOC UI Unithide()Hide the TOC UI BooleanisVisible()UnitonBookmarkSelected(Function1<Integer, Unit> callback)Set the callback for when a bookmark is selected. -
-
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)
-
-
-
-