java.lang.Object | ||
↳ | ViewPager | |
↳ | com.pdftron.pdf.controls.ReflowControl |
This class provides convenient methods for interacting with ReflowPagerAdapter
class
and takes care of throwing an exception if ReflowPagerAdapter
is not set up.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | ReflowControl.OnPostProcessColorListener | Callback interface to be invoked to get the processed color | |||||||||
interface | ReflowControl.OnReflowLongPressListener | Callback interface to be invoked when a single tap up gesture occurs. | |||||||||
interface | ReflowControl.OnReflowTapListener | Callback interface to be invoked when a single tap up gesture occurs. | |||||||||
interface | ReflowControl.ReflowUrlLoadedListener |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | FOLLOW_PDFVIEWCTRL | ||||||||||
int | HORIZONTAL | ||||||||||
int | VERTICAL |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ReflowControl(Context context)
Class constructor
| |||||||||||
ReflowControl(Context context, AttributeSet attrs)
Class constructor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addReflowLongPressListener(ReflowControl.OnReflowLongPressListener listener)
Adds a listener that will be invoked by
ReflowControl.OnReflowLongPressListener . | ||||||||||
void |
addReflowOnTapListener(ReflowControl.OnReflowTapListener listener)
Adds a listener that will be invoked by
ReflowControl.OnReflowTapListener . | ||||||||||
void |
cleanUp()
Cleans up.
| ||||||||||
void | clearAdapterCacheAndReset() | ||||||||||
void |
clearReflowLongPressListeners()
Remove all listeners that are notified of any callback from OnReflowLongPressListener.
| ||||||||||
void |
clearReflowOnTapListeners()
Remove all listeners that are notified of any callback from OnTapListener.
| ||||||||||
void |
enableTurnPageOnTap(boolean enabled)
Enables turn page on tap.
| ||||||||||
int |
getCurrentPage()
Gets the current page.
| ||||||||||
boolean |
getIsDoNotReflowTextOverImages()
Gets value to show text over images in reflow mode, default to false.
| ||||||||||
boolean |
getIsHideBackgroundImages()
Gets value to show background images in reflow mode, default to false.
| ||||||||||
boolean |
getIsHideImagesUnderInvisibleText()
Gets value to show images under invisible text in reflow mode, default to false.
| ||||||||||
boolean |
getIsHideImagesUnderText()
Gets value to show images under text in reflow mode, default to false.
| ||||||||||
int |
getOrientation()
Gets the paging direction
| ||||||||||
int |
getTextSizeInPercent()
Returns the text size.
| ||||||||||
boolean |
isCustomColorMode()
Checks whether reflow is in custom color mode.
| ||||||||||
boolean |
isDayMode()
Checks whether reflow is in day mode.
| ||||||||||
boolean |
isInternalLinkClicked()
Checks whether an internal link is clicked.
| ||||||||||
boolean |
isNightMode()
Checks whether reflow is in night mode.
| ||||||||||
boolean |
isReady()
Checks whether the reflow control is ready
| ||||||||||
boolean |
isRightToLeftDirection()
Checks whether right-to-left mode is enabled.
| ||||||||||
void |
notifyPagesModified()
Notifies that pages are modified
| ||||||||||
boolean | onInterceptTouchEvent(MotionEvent ev) | ||||||||||
void |
onReflowPagerLongPress(WebView webView, MotionEvent event)
Called when a long press event happens
| ||||||||||
void |
onReflowPagerSingleTapUp(WebView webView, MotionEvent event)
Called when a single tap up event happens
| ||||||||||
boolean | onTouchEvent(MotionEvent ev) | ||||||||||
void |
removeReflowLongPressListener(ReflowControl.OnReflowLongPressListener listener)
Removes a listener that was previously added via
addReflowLongPressListener(OnReflowLongPressListener) . | ||||||||||
void |
removeReflowOnTapListener(ReflowControl.OnReflowTapListener listener)
Removes a listener that was previously added via
addReflowOnTapListener(OnReflowTapListener) . | ||||||||||
void |
reset()
Resets the reflow control
| ||||||||||
void |
resetInternalLinkClicked()
Resets that an internal link is clicked.
| ||||||||||
void |
scrollPageBy(int x, int y)
Scroll the current WebView by x and y.
| ||||||||||
void |
setAnnotStyleProperties(HashMap<Integer, AnnotStyleProperty> annotStyleProperties)
Sets the AnnotStyleProperties that will be used to hide elements of the AnnotStyleDialog
| ||||||||||
void |
setCurrentPage(int pageNum)
Sets the current page.
| ||||||||||
void |
setCustomColorMode(int backgroundColorMode)
Sets reflow in custom color mode.
| ||||||||||
void |
setDayMode()
Sets reflow in day mode.
| ||||||||||
void |
setDoNotReflowTextOverImages(boolean doNotReflowTextOverImages)
Sets whether to show text over images in reflow mode, default to false.
| ||||||||||
void |
setEditingEnabled(boolean editingEnabled)
On Nougat and up, it is possible to edit text markups.
| ||||||||||
void |
setHideBackgroundImages(boolean hideBackgroundImages)
Sets whether to show background images in reflow mode, default to false.
| ||||||||||
void |
setHideImagesUnderInvisibleText(boolean hideImagesUnderInvisibleText)
Sets whether to show images under invisible text in reflow mode, default to false.
| ||||||||||
void |
setHideImagesUnderText(boolean hideImagesUnderText)
Sets whether to show images under text in reflow mode, default to false.
| ||||||||||
void |
setImageInReflowEnabled(boolean imageInReflowEnabled)
Sets whether to show images in reflow mode, default to true.
| ||||||||||
void |
setNightMode()
Sets reflow in night mode.
| ||||||||||
void |
setOnPostProcessColorListener(ReflowControl.OnPostProcessColorListener listener)
Sets the post process color listener
| ||||||||||
void |
setOrientation(int orientation)
Sets the paging direction
| ||||||||||
void |
setReflowUrlLoadedListener(ReflowControl.ReflowUrlLoadedListener listener)
Sets a ReflowUrlLoadedListener for ReflowPagerAdapterCallback
| ||||||||||
void |
setRightToLeftDirection(boolean isRtlMode)
Sets right-to-left mode.
| ||||||||||
void |
setTextSelectionMenuEnabled(boolean textSelectionMenuEnabled)
Disables text selection menu webview (long press)
| ||||||||||
void |
setTextSizeInPercent(int textSizeInPercent)
Sets the text size.
| ||||||||||
void |
setup(PDFDoc pdfDoc, ToolManager toolManager, ReflowControl.OnPostProcessColorListener listener)
Setups the reflow control
| ||||||||||
void |
setup(PDFDoc pdfDoc)
Setups the reflow control
| ||||||||||
void |
setup(PDFDoc pdfDoc, ReflowControl.OnPostProcessColorListener listener)
Setups the reflow control
| ||||||||||
void |
updateTextSize()
Update text size for current page
| ||||||||||
void |
zoomIn()
Zooms in.
| ||||||||||
void |
zoomOut()
Zooms out.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.pdftron.pdf.controls.ReflowPagerAdapter.ReflowPagerAdapterCallback
|
Class constructor
Class constructor
Adds a listener that will be invoked by ReflowControl.OnReflowLongPressListener
.
Components that add a listener should take care to remove it when finished.
Other components that take ownership of a view may call clearReflowLongPressListeners()
to remove all attached listeners.
listener | listener to add |
---|
Adds a listener that will be invoked by ReflowControl.OnReflowTapListener
.
Components that add a listener should take care to remove it when finished.
Other components that take ownership of a view may call clearReflowOnTapListeners()
to remove all attached listeners.
listener | listener to add |
---|
Cleans up.
Remove all listeners that are notified of any callback from OnReflowLongPressListener.
Remove all listeners that are notified of any callback from OnTapListener.
Enables turn page on tap.
enabled | True if should turn page on tap |
---|
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Gets the current page.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Gets value to show text over images in reflow mode, default to false.
Gets value to show background images in reflow mode, default to false.
Gets value to show images under invisible text in reflow mode, default to false.
Gets value to show images under text in reflow mode, default to false.
Gets the paging direction
Returns the text size.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Checks whether reflow is in custom color mode.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Checks whether reflow is in day mode.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Checks whether an internal link is clicked.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Checks whether reflow is in night mode.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Checks whether the reflow control is ready
Checks whether right-to-left mode is enabled.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Notifies that pages are modified
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Called when a long press event happens
event | The motion event |
---|
Called when a single tap up event happens
event | The motion event |
---|
Removes a listener that was previously added via
addReflowLongPressListener(OnReflowLongPressListener)
.
listener | listener to remove |
---|
Removes a listener that was previously added via
addReflowOnTapListener(OnReflowTapListener)
.
listener | listener to remove |
---|
Resets the reflow control
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Resets that an internal link is clicked.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Scroll the current WebView by x and y.
Sets the AnnotStyleProperties that will be used to hide elements of the AnnotStyleDialog
Sets the current page.
pageNum | The page number (starts from 1) |
---|
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Sets reflow in custom color mode.
backgroundColorMode | The background color |
---|
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Sets reflow in day mode.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Sets whether to show text over images in reflow mode, default to false.
On Nougat and up, it is possible to edit text markups. Sets whether editing text markup is enabled.
Sets whether to show background images in reflow mode, default to false.
Sets whether to show images under invisible text in reflow mode, default to false.
Sets whether to show images under text in reflow mode, default to false.
Sets whether to show images in reflow mode, default to true.
Sets reflow in night mode.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Sets the post process color listener
listener | The listener to add |
---|
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Sets the paging direction
Sets a ReflowUrlLoadedListener for ReflowPagerAdapterCallback
listener | The listener |
---|
Sets right-to-left mode.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Disables text selection menu webview (long press)
Sets the text size.
textSizeInPercent | The text size. The possible values are 5, 10, 25, 50, 75, 100, 125, 150, 200, 40, 800, 1600 |
---|
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Setups the reflow control
pdfDoc | The PDF doc |
---|---|
toolManager | The ToolManager for tracking edits |
listener | The listener for post processing colors |
Setups the reflow control
pdfDoc | The PDF doc |
---|---|
listener | The listener for post processing colors |
Update text size for current page
Zooms in.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
Zooms out.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|