public class

PdfTabBar

extends LinearLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.pspdfkit.ui.tabs.PdfTabBar

Class Overview

View showing horizontal list with document tabs.

Summary

Nested Classes
interface PdfTabBar.OnTabClickedListener Listener for clicks on tabs and their close buttons. 
interface PdfTabBar.OnTabsChangedListener Listener for changes to tabs list. 
[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
PdfTabBar(Context context)
PdfTabBar(Context context, AttributeSet attrs)
PdfTabBar(Context context, AttributeSet attrs, int defStyleAttr)
Public Methods
void addOnTabClickedListener(PdfTabBar.OnTabClickedListener listener)
Registers PdfTabBar.OnTabClickedListener to get notified about clicks on tabs in this tab bar.
void addOnTabsChangedListener(PdfTabBar.OnTabsChangedListener listener)
Registers PdfTabBar.OnTabsChangedListener to get notified when tabs list changes.
void bindToDocumentCoordinator(DocumentCoordinator documentCoordinator)
Binds the tab bar to the DocumentCoordinator.
int getSize()
Returns number of tabs in the tab bar.
PdfTabBarItem getTabBarItem(DocumentDescriptor documentDescriptor)
Searches tabs for tab that corresponds to the given document descriptor.
List<PdfTabBarItem> getTabs()
Returns list of tabs in the tab bar.
void removeOnTabClickedListener(PdfTabBar.OnTabClickedListener listener)
Removes a previously registered PdfTabBar.OnTabClickedListener.
void removeOnTabsChangedListener(PdfTabBar.OnTabsChangedListener listener)
Removes a previously registered PdfTabBar.OnTabsChangedListener.
void setCloseMode(PdfTabBarCloseMode closeMode)
Sets the tab close mode which determines how the user is able to close documents.
void unbindDocumentCoordinator()
Unbinds the tab bar from the DocumentCoordinator.
[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.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public PdfTabBar (Context context)

public PdfTabBar (Context context, AttributeSet attrs)

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

Public Methods

public void addOnTabClickedListener (PdfTabBar.OnTabClickedListener listener)

Registers PdfTabBar.OnTabClickedListener to get notified about clicks on tabs in this tab bar. If the listener has been registered previously, this method will be a no-op.

Parameters
listener Listener to register. Must be non-null.

public void addOnTabsChangedListener (PdfTabBar.OnTabsChangedListener listener)

Registers PdfTabBar.OnTabsChangedListener to get notified when tabs list changes. If the listener has been registered previously, this method will be a no-op.

Parameters
listener Listener to register. Must be non-null.

public void bindToDocumentCoordinator (DocumentCoordinator documentCoordinator)

Binds the tab bar to the DocumentCoordinator. Document coordinator is used to manage loaded documents and to switch between them.

Parameters
documentCoordinator Document coordinator to bind to.

public int getSize ()

Returns number of tabs in the tab bar.

Returns
  • Number of tabs in the tab bar.

public PdfTabBarItem getTabBarItem (DocumentDescriptor documentDescriptor)

Searches tabs for tab that corresponds to the given document descriptor.

Parameters
documentDescriptor Descriptor to search for.
Returns
  • Tab corresponding to the given document descriptor or null if not found.

public List<PdfTabBarItem> getTabs ()

Returns list of tabs in the tab bar.

Returns
  • List of tab bar items that are currently added to the tab bar.

public void removeOnTabClickedListener (PdfTabBar.OnTabClickedListener listener)

Removes a previously registered PdfTabBar.OnTabClickedListener. If the listener hasn't been registered previously, this method will be a no-op.

Parameters
listener Listener to unregister. Must be non-null.

public void removeOnTabsChangedListener (PdfTabBar.OnTabsChangedListener listener)

Removes a previously registered PdfTabBar.OnTabsChangedListener. If the listener hasn't been registered previously, this method will be a no-op.

Parameters
listener Listener to unregister. Must be non-null.

public void setCloseMode (PdfTabBarCloseMode closeMode)

Sets the tab close mode which determines how the user is able to close documents. Defaults to showing tab close button on selected tab only.

Parameters
closeMode Close mode to set.

public void unbindDocumentCoordinator ()

Unbinds the tab bar from the DocumentCoordinator.