Class PdfTabBar
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.view.KeyEvent.Callback
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
public class PdfTabBar extends LinearLayout
View showing horizontal list with document tabs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
PdfTabBar.OnTabClickedListener
Listener for clicks on tabs and their close buttons.
public interface
PdfTabBar.OnTabsChangedListener
Listener for changes to tabs list.
-
Constructor Summary
Constructors Constructor Description PdfTabBar(Context context)
PdfTabBar(Context context, AttributeSet attrs)
PdfTabBar(Context context, AttributeSet attrs, int defStyleAttr)
-
Method Summary
Modifier and Type Method Description void
bindToDocumentCoordinator(@NonNull() DocumentCoordinator documentCoordinator)
Binds the tab bar to the DocumentCoordinator. void
unbindDocumentCoordinator()
Unbinds the tab bar from the DocumentCoordinator. int
getSize()
Returns number of tabs in the tab bar. List<PdfTabBarItem>
getTabs()
Returns list of tabs in the tab bar. PdfTabBarItem
getTabBarItem(@Nullable() DocumentDescriptor documentDescriptor)
Searches tabs for tab that corresponds to the given document descriptor. void
addOnTabsChangedListener(@NonNull() PdfTabBar.OnTabsChangedListener listener)
Registers OnTabsChangedListener to get notified when tabs list changes. void
removeOnTabsChangedListener(@NonNull() PdfTabBar.OnTabsChangedListener listener)
Removes a previously registered OnTabsChangedListener. void
addOnTabClickedListener(@NonNull() PdfTabBar.OnTabClickedListener listener)
Registers OnTabClickedListener to get notified about clicks on tabs in this tab bar. void
removeOnTabClickedListener(@NonNull() PdfTabBar.OnTabClickedListener listener)
Removes a previously registered OnTabClickedListener. void
setCloseMode(@NonNull() PdfTabBarCloseMode closeMode)
Sets the tab close mode which determines how the user is able to close documents. -
-
Constructor Detail
-
PdfTabBar
PdfTabBar(Context context)
-
PdfTabBar
PdfTabBar(Context context, AttributeSet attrs)
-
PdfTabBar
PdfTabBar(Context context, AttributeSet attrs, int defStyleAttr)
-
-
Method Detail
-
bindToDocumentCoordinator
void bindToDocumentCoordinator(@NonNull() 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.
-
unbindDocumentCoordinator
void unbindDocumentCoordinator()
Unbinds the tab bar from the DocumentCoordinator.
-
getSize
int getSize()
Returns number of tabs in the tab bar.
- Returns:
Number of tabs in the tab bar.
-
getTabs
@NonNull() 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.
-
getTabBarItem
@Nullable() PdfTabBarItem getTabBarItem(@Nullable() 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.
-
addOnTabsChangedListener
void addOnTabsChangedListener(@NonNull() PdfTabBar.OnTabsChangedListener listener)
Registers 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.
-
removeOnTabsChangedListener
void removeOnTabsChangedListener(@NonNull() PdfTabBar.OnTabsChangedListener listener)
Removes a previously registered OnTabsChangedListener. If the listener hasn't been registered previously, this method will be a no-op.
- Parameters:
listener
- Listener to unregister.
-
addOnTabClickedListener
void addOnTabClickedListener(@NonNull() PdfTabBar.OnTabClickedListener listener)
Registers 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.
-
removeOnTabClickedListener
void removeOnTabClickedListener(@NonNull() PdfTabBar.OnTabClickedListener listener)
Removes a previously registered OnTabClickedListener. If the listener hasn't been registered previously, this method will be a no-op.
- Parameters:
listener
- Listener to unregister.
-
setCloseMode
void setCloseMode(@NonNull() 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.
-
-
-
-