public class

CustomFragmentTabLayout

extends TabLayout
java.lang.Object
   ↳ TabLayout
     ↳ com.pdftron.pdf.controls.CustomFragmentTabLayout
Known Direct Subclasses

Class Overview

This class implements TabLayout where each tab is attached with a fragment

Summary

Nested Classes
interface CustomFragmentTabLayout.OnTabModificationListener<T extends Tab>  
Public Constructors
CustomFragmentTabLayout(Context context)
Class constructor
CustomFragmentTabLayout(Context context, AttributeSet attrs)
Class constructor
CustomFragmentTabLayout(Context context, AttributeSet attrs, int defStyleAttr)
Class constructor
Public Methods
void addTab(Tab tab, Class<?> _class, Bundle args)
Adds a new tab.
Fragment getCurrentFragment()
Returns the current fragment.
String getCurrentTabTag()
Returns the tag name of the current fragment.
Fragment getFragmentByTag(String tag)
Returns a fragment that has the specified tag name.
ArrayList<Fragment> getLiveFragments()
Returns fragments that are alive.
Tab getTabByTag(String tag)
Returns the tab that has the specified tag name.
void removeAllFragments()
Remove all fragments.
void replaceTag(Tab tab, String newTag)
Replaces the tag name of an existing tab.
static void setDebug(boolean debug)
void setOnTabModificationListener(OnTabModificationListener listener)
void setup(Context context, FragmentManager manager, int containerId)
Setups the class.
void startFragment(String tag)
Start the fragment that has the specified tag name.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CustomFragmentTabLayout (Context context)

Class constructor

public CustomFragmentTabLayout (Context context, AttributeSet attrs)

Class constructor

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

Class constructor

Public Methods

public void addTab (Tab tab, Class<?> _class, Bundle args)

Adds a new tab.

Parameters
tab The tab
_class The class of fragment that should be attached to this tab
args The arguments that should be passed to the fragment

public Fragment getCurrentFragment ()

Returns the current fragment.

Returns
  • the current fragment

public String getCurrentTabTag ()

Returns the tag name of the current fragment.

Returns
  • The tag name of the current fragment

public Fragment getFragmentByTag (String tag)

Returns a fragment that has the specified tag name.

Parameters
tag The tag name of the fragment
Returns
  • A fragment that has the specified tag name

public ArrayList<Fragment> getLiveFragments ()

Returns fragments that are alive.

Returns
  • a list of live fragments

public Tab getTabByTag (String tag)

Returns the tab that has the specified tag name.

Parameters
tag The tag name of the tab
Returns
  • The tab that has the specified tag name

public void removeAllFragments ()

Remove all fragments.

public void replaceTag (Tab tab, String newTag)

Replaces the tag name of an existing tab.

Parameters
tab The tab
newTag the new tag name

public static void setDebug (boolean debug)

public void setOnTabModificationListener (OnTabModificationListener listener)

public void setup (Context context, FragmentManager manager, int containerId)

Setups the class.

Parameters
context The context
manager The fragment manager
containerId The container ID

public void startFragment (String tag)

Start the fragment that has the specified tag name.

Parameters
tag The tag name of the fragment