PdfViewportState


public final class PdfViewportState


Represents the state of the viewport on which androidx.pdf.view.PdfView is overlaid.

Summary

Public constructors

PdfViewportState(
    int firstVisiblePage,
    int visiblePagesCount,
    @NonNull SparseArray<@NonNull RectF> pageBounds,
    float zoom
)

Public methods

final int

The index of the first visible page 0-based.

final @NonNull SparseArray<@NonNull RectF>

A mapping of page numbers to their bounds in view coordinates.

final int

The number of currently visible pages.

final float

The current zoom level of the PDF.

Public constructors

PdfViewportState

Added in 1.0.0-alpha19
public PdfViewportState(
    int firstVisiblePage,
    int visiblePagesCount,
    @NonNull SparseArray<@NonNull RectF> pageBounds,
    float zoom
)
Parameters
int firstVisiblePage

The index of the first visible page 0-based.

int visiblePagesCount

The number of currently visible pages.

@NonNull SparseArray<@NonNull RectF> pageBounds

A mapping of page numbers to their bounds in view coordinates.

float zoom

The current zoom level of the PDF.

Public methods

getFirstVisiblePage

Added in 1.0.0-alpha19
public final int getFirstVisiblePage()

The index of the first visible page 0-based.

getPageBounds

Added in 1.0.0-alpha19
public final @NonNull SparseArray<@NonNull RectFgetPageBounds()

A mapping of page numbers to their bounds in view coordinates.

getVisiblePagesCount

Added in 1.0.0-alpha19
public final int getVisiblePagesCount()

The number of currently visible pages.

getZoom

Added in 1.0.0-alpha19
public final float getZoom()

The current zoom level of the PDF.