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. |
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 |
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.
| ||||||||||
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 |
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 |
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 |
setRightToLeftDirection(boolean isRtlMode)
Sets right-to-left mode.
| ||||||||||
void |
setTextSizeInPercent(int textSizeInPercent)
Sets the text size.
| ||||||||||
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
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 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) .
|
---|
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 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 right-to-left mode.
PDFNetException | if ReflowControl has not been set up.
See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener) .
|
---|
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 |
---|---|
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) .
|
---|