Class VerticalScrollBar

  • All Implemented Interfaces:
    android.graphics.drawable.Drawable.Callback , android.view.KeyEvent.Callback , android.view.ViewManager , android.view.ViewParent , android.view.accessibility.AccessibilityEventSource , com.pspdfkit.listeners.scrolling.DocumentScrollListener

    
    public class VerticalScrollBar
    extends ViewGroup implements DocumentScrollListener
                        

    Provides a vertical scroll indicator that can be dragged to change pages.

    • Constructor Detail

      • VerticalScrollBar

        VerticalScrollBar(Context context)
    • Method Detail

      • awakenScrollBar

         final void awakenScrollBar()

        Manually shows the scroll indicator, hiding it after some time.

      • setDocument

         final void setDocument(@NonNull() PdfDocument document)

        Sets the document that provides page count for this scrollbar.

        Parameters:
        document - A PdfDocument providing the page count for this view.
      • onScrollStateChanged

         final void onScrollStateChanged(@NonNull() ScrollState state)

        Called whenever the current scroll state of the document view has changed.

        Parameters:
        state - The new scroll state.
      • onDocumentScrolled

         final void onDocumentScrolled(int currX, int currY, int maxX, int maxY, int extendX, int extendY)

        Called whenever the document in the fragment scrolled. Values are expressed in an arbitrary unit and may change with every call. Also maxX and maxY are not guaranteed to remain the same between two calls.

        Parameters:
        currX - Current scroll amount X.
        currY - Current scroll amount Y.
        maxX - Maximum scroll amount of the X dimension.
        maxY - Maximum scroll amount of the Y dimension.
        extendX - Extend of the visible content in the X dimension.
        extendY - Extend of the visible content in the Y dimension.
      • setAutoHide

         void setAutoHide(boolean enable)

        This controls if the scrollbar can auto hide or stay visible all the time.

        Parameters:
        enable - boolean to enable/disable auto hide.