Class PdfTextSelectionPopupToolbar

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      PdfTextSelectionPopupToolbar(PdfFragment pdfFragment) Creates a new text selection popup toolbar that will be displayed in the specified fragment.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • PdfTextSelectionPopupToolbar

        PdfTextSelectionPopupToolbar(PdfFragment pdfFragment)
        Creates a new text selection popup toolbar that will be displayed in the specified fragment.
        Parameters:
        pdfFragment - Fragment on which the toolbar will be displayed.
    • Method Detail

      • getController

        @Nullable() TextSelectionController getController()

        Gets the text selection controller that is currently set on the toolbar (if any).

        Returns:

        Currently set text selection controller, or null if it doesn't exist.

      • bindController

         void bindController(@NonNull() TextSelectionController textSelectionController)

        Bind text selection controller to the toolbar. Text selection controller can be obtained via . When bound to the toolbar, the toolbar will automatically show items that are enabled or disabled, and introduce the business logic for handling each of the clicked menu item actions.

        Parameters:
        textSelectionController - Controller to be bound to the toolbar.
      • getViewId

         int getViewId()

        Returns the id of the content view for this toolbar.

        Returns:

        Toolbar's content view ID.

      • unbindController

         void unbindController()

        Unbinds a currently bound controller (if any).

      • showForSelectedText

         void showForSelectedText()

        Displays the text selection toolbar over the selected text. This method is no-op if called before the text controller had been set via bindController.

      • dismiss

         void dismiss()

        Hides/dismisses the popup toolbar.

      • onItemClicked

         boolean onItemClicked(@NonNull() PopupToolbarMenuItem popupToolbarMenuItem)

        Called when the menu item has been clicked. When overriding this method, make sure you call `super()` so that the OnPopupToolbarItemClickedListener is invoked correctly.

        Parameters:
        popupToolbarMenuItem - Item that was clicked.
        Returns:

        true to interrupt the callback, false to let it go through and allow the default menu item click handling.