public class CPDFContinueLayoutManager extends CPDFLayoutManager
This layout manager is used when pages are placed in one scrollable content area instead of
being snapped page by page. It supports single-page and double-page display, cover-page mode,
vertical and horizontal reading directions, and different formulas for portrait and landscape
screen orientation. The manager only calculates geometry; it does not draw pages or mutate the
ReaderView directly.
All calculated page rectangles are stored in pageLocations. The content bounds are
stored in contentWidth and contentHeight and are later consumed by
ReaderView for scrolling, hit testing, and page visibility calculations.
| Constructor and Description |
|---|
CPDFContinueLayoutManager()
Creates a continuous layout manager without binding it to a reader view.
|
CPDFContinueLayoutManager(ReaderView readerView)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getContentHeight()
Returns the total content height calculated by the last
refresh() call. |
float |
getContentWidth()
Returns the total content width calculated by the last
refresh() call. |
android.graphics.RectF |
getPageLocationRect(int pageNum)
Returns the calculated page rectangle for the given page index.
|
void |
refresh()
Recalculates all page rectangles and total content bounds.
|
CPDFLayoutManager |
setPageSizes(java.util.List<android.graphics.RectF> pageSizes)
Sets source PDF page sizes used by legacy call sites.
|
CPDFLayoutManager |
setScale(float scale)
Sets the zoom scale used by subsequent layout calculations.
|
CPDFLayoutManager |
setScreenVertical(boolean screenVertical)
Sets whether the current screen is treated as portrait for legacy call sites.
|
getPageSpacing, getReaderHeight, getReaderWidth, setPageSpacingpublic CPDFContinueLayoutManager()
The layout inputs should be supplied through CPDFLayoutConfig before
refresh() is called.
@Deprecated public CPDFContinueLayoutManager(ReaderView readerView)
The reader view argument is intentionally ignored. New code should use
CPDFContinueLayoutManager() and pass all layout inputs through
CPDFLayoutConfig.
readerView - ignored legacy reader view referencepublic CPDFLayoutManager setScale(float scale)
scale - zoom multiplier applied to source page sizespublic android.graphics.RectF getPageLocationRect(int pageNum)
The rectangle is expressed in the continuous content coordinate system, not in screen coordinates. An empty rectangle is returned for invalid indexes or before layout is ready.
pageNum - zero-based page indexpublic float getContentWidth()
refresh() call.public float getContentHeight()
refresh() call.public CPDFLayoutManager setPageSizes(java.util.List<android.graphics.RectF> pageSizes)
When CPDFLayoutConfig is provided, config page sizes take precedence during
refresh().
pageSizes - original PDF page sizespublic CPDFLayoutManager setScreenVertical(boolean screenVertical)
When CPDFLayoutConfig is provided, config orientation takes precedence during
refresh().
screenVertical - true when the reader screen should use portrait formulaspublic void refresh()
The method first copies values from CPDFLayoutConfig into local fields, then
dispatches to a layout branch based on screen orientation, reading direction, double-page
mode, cover-page mode, and same-width mode. It updates pageLocations,
contentWidth, contentHeight, and the inherited CPDFLayoutResult.