public class

ReflowControl

extends ViewPager
implements ReflowPagerAdapter.ReflowPagerAdapterCallback
java.lang.Object
   ↳ ViewPager
     ↳ com.pdftron.pdf.controls.ReflowControl

Class Overview

This class provides convenient methods for interacting with ReflowPagerAdapter class and takes care of throwing an exception if ReflowPagerAdapter is not set up.

Summary

Nested Classes
interface ReflowControl.OnPostProcessColorListener Callback interface to be invoked to get the processed color  
interface ReflowControl.OnReflowTapListener Callback interface to be invoked when a single tap up gesture occurs. 
Constants
int HORIZONTAL
int VERTICAL
Public Constructors
ReflowControl(Context context)
Class constructor
ReflowControl(Context context, AttributeSet attrs)
Class constructor
Public Methods
void addReflowOnTapListener(ReflowControl.OnReflowTapListener listener)
Adds a listener that will be invoked by ReflowControl.OnReflowTapListener.
void cleanUp()
Cleans up.
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 onReflowPagerSingleTapUp(MotionEvent event)
Handles when a single tap up event happens
boolean onTouchEvent(MotionEvent ev)
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 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
From class java.lang.Object
From interface com.pdftron.pdf.controls.ReflowPagerAdapter.ReflowPagerAdapterCallback

Constants

public static final int HORIZONTAL

Constant Value: 0 (0x00000000)

public static final int VERTICAL

Constant Value: 1 (0x00000001)

Public Constructors

public ReflowControl (Context context)

Class constructor

public ReflowControl (Context context, AttributeSet attrs)

Class constructor

Public Methods

public void addReflowOnTapListener (ReflowControl.OnReflowTapListener listener)

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.

Parameters
listener listener to add

public void cleanUp ()

Cleans up.

public void clearReflowOnTapListeners ()

Remove all listeners that are notified of any callback from OnTapListener.

public void enableTurnPageOnTap (boolean enabled)

Enables turn page on tap.

Parameters
enabled True if should turn page on tap
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public int getCurrentPage ()

Gets the current page.

Returns
  • The page number
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public int getOrientation ()

Gets the paging direction

public int getTextSizeInPercent ()

Returns the text size.

Returns
  • The text size ranging from 0 to 100
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public boolean isCustomColorMode ()

Checks whether reflow is in custom color mode.

Returns
  • True if reflow is in custom color mode
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public boolean isDayMode ()

Checks whether reflow is in day mode.

Returns
  • True if reflow is in day mode
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public boolean isInternalLinkClicked ()

Checks whether an internal link is clicked.

Returns
  • True if an internal link is clicked
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public boolean isNightMode ()

Checks whether reflow is in night mode.

Returns
  • True if reflow is in night mode
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public boolean isReady ()

Checks whether the reflow control is ready

Returns
  • True if the reflow control is ready

public boolean isRightToLeftDirection ()

Checks whether right-to-left mode is enabled.

Returns
  • True if right-to-left mode is enabled
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public void notifyPagesModified ()

Notifies that pages are modified

Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public boolean onInterceptTouchEvent (MotionEvent ev)

public void onReflowPagerSingleTapUp (MotionEvent event)

Handles when a single tap up event happens

Parameters
event The motion event

public boolean onTouchEvent (MotionEvent ev)

public void removeReflowOnTapListener (ReflowControl.OnReflowTapListener listener)

Removes a listener that was previously added via addReflowOnTapListener(OnReflowTapListener).

Parameters
listener listener to remove

public void reset ()

Resets the reflow control

Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public void resetInternalLinkClicked ()

Resets that an internal link is clicked.

Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public void setCurrentPage (int pageNum)

Sets the current page.

Parameters
pageNum The page number (starts from 1)
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public void setCustomColorMode (int backgroundColorMode)

Sets reflow in custom color mode.

Parameters
backgroundColorMode The background color
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public void setDayMode ()

Sets reflow in day mode.

Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public void setNightMode ()

Sets reflow in night mode.

Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public void setOnPostProcessColorListener (ReflowControl.OnPostProcessColorListener listener)

Sets the post process color listener

Parameters
listener The listener to add
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public void setOrientation (int orientation)

Sets the paging direction

public void setRightToLeftDirection (boolean isRtlMode)

Sets right-to-left mode.

Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public void setTextSizeInPercent (int textSizeInPercent)

Sets the text size.

Parameters
textSizeInPercent The text size. The possible values are 5, 10, 25, 50, 75, 100, 125, 150, 200, 40, 800, 1600
Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public void setup (PDFDoc pdfDoc)

Setups the reflow control

Parameters
pdfDoc The PDF doc

public void setup (PDFDoc pdfDoc, ReflowControl.OnPostProcessColorListener listener)

Setups the reflow control

Parameters
pdfDoc The PDF doc
listener The listener for post processing colors

public void updateTextSize ()

Update text size for current page

public void zoomIn ()

Zooms in.

Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).

public void zoomOut ()

Zooms out.

Throws
PDFNetException if ReflowControl has not been set up. See setup(PDFDoc) and setup(PDFDoc, OnPostProcessColorListener).