public class

PageIndicatorLayout

extends LinearLayout
implements View.OnAttachStateChangeListener PDFViewCtrl.PageChangeListener
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.pdftron.pdf.controls.PageIndicatorLayout

Class Overview

A LinearLayout that shows page indicator. It includes current page number and total page number.

Summary

Nested Classes
interface PageIndicatorLayout.OnPDFViewVisibilityChanged Listener for PDFViewCtrl visibility change event  
Constants
int POSITION_BOTTOM_START
int POSITION_TOP_END
int POSITION_TOP_START
[Expand]
Inherited Constants
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
PageIndicatorLayout(Context context)
Class constructor
PageIndicatorLayout(Context context, AttributeSet attrs)
Class constructor
PageIndicatorLayout(Context context, AttributeSet attrs, int defStyleAttr)
Class constructor
PageIndicatorLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Class constructor for API > 21
Public Methods
int[] calculateAutoAdjustPosition()
Calculates the position of page indicator if it is going to adjust position automatically.
TextView getIndicator()
Gets page indicator text view
ProgressBar getSpinner()
Gets the loading spinner
void onPageChange(int old_page, int cur_page, PDFViewCtrl.PageChangeState state)
This is called when there is a page changes in PDFViewCtrl
void onViewAttachedToWindow(View v)
void onViewDetachedFromWindow(View v)
void setAutoAdjustPosition(boolean autoAdjust)
Sets whether to auto adjust position when there is layout changes
void setCurrentPage(int currentPage)
void setGravity(int gravity)
void setOnPdfViewCtrlVisibilityChangeListener(PageIndicatorLayout.OnPDFViewVisibilityChanged listener)
Sets PDFViewCtrl visibility change listener
void setPdfViewCtrl(PDFViewCtrl pdfViewCtrl)
Sets PDFViewCtrl
[Expand]
Inherited Methods
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.View.OnAttachStateChangeListener
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.pdftron.pdf.PDFViewCtrl.PageChangeListener

Constants

public static final int POSITION_BOTTOM_START

Constant Value: 0 (0x00000000)

public static final int POSITION_TOP_END

Constant Value: 2 (0x00000002)

public static final int POSITION_TOP_START

Constant Value: 1 (0x00000001)

Public Constructors

public PageIndicatorLayout (Context context)

Class constructor

public PageIndicatorLayout (Context context, AttributeSet attrs)

Class constructor

public PageIndicatorLayout (Context context, AttributeSet attrs, int defStyleAttr)

Class constructor

public PageIndicatorLayout (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Class constructor for API > 21

Public Methods

public int[] calculateAutoAdjustPosition ()

Calculates the position of page indicator if it is going to adjust position automatically.

Returns
  • This page indicator position

public TextView getIndicator ()

Gets page indicator text view

Returns
  • page indicator text view

public ProgressBar getSpinner ()

Gets the loading spinner

Returns
  • loading spinner

public void onPageChange (int old_page, int cur_page, PDFViewCtrl.PageChangeState state)

This is called when there is a page changes in PDFViewCtrl

Parameters
old_page the old page number
cur_page the current (new) page number
state in non-continuous page presentation modes and when the built-in page sliding is in process, this flag is used to

public void onViewAttachedToWindow (View v)

public void onViewDetachedFromWindow (View v)

public void setAutoAdjustPosition (boolean autoAdjust)

Sets whether to auto adjust position when there is layout changes

Parameters
autoAdjust true then auto adjust position, false otherwise

public void setCurrentPage (int currentPage)

public void setGravity (int gravity)

public void setOnPdfViewCtrlVisibilityChangeListener (PageIndicatorLayout.OnPDFViewVisibilityChanged listener)

Sets PDFViewCtrl visibility change listener

Parameters
listener PDFViewCtrl visibility change listener

public void setPdfViewCtrl (PDFViewCtrl pdfViewCtrl)

Sets PDFViewCtrl

Parameters
pdfViewCtrl The PDFViewCtrl