public class TabSwitcherModel extends java.lang.Object implements Model, Restorable
TabSwitcher.Model.Listener| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
REFERENCE_TAB_INDEX_EXTRA
The name of the extra, which is used to store the index of the tab, which is used as a
reference, when restoring the positions of tabs, within a bundle.
|
static java.lang.String |
REFERENCE_TAB_POSITION_EXTRA
The name of the extra, which is used to store the position of the tab, which is used as a
reference, when restoring the positions of tabs, within a bundle.
|
| Constructor and Description |
|---|
TabSwitcherModel(TabSwitcher tabSwitcher)
Creates a new model of a
TabSwitcher. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAllTabs(java.util.Collection<? extends Tab> tabs)
Adds all tabs, which are contained by a collection, to the tab switcher.
|
void |
addAllTabs(java.util.Collection<? extends Tab> tabs,
int index)
Adds all tabs, which are contained by a collection, to the tab switcher, starting at a
specific index.
|
void |
addAllTabs(java.util.Collection<? extends Tab> tabs,
int index,
Animation animation)
Adds all tabs, which are contained by a collection, to the tab switcher, starting at a
specific index.
|
void |
addAllTabs(Tab[] tabs)
Adds all tabs, which are contained by an array, to the tab switcher.
|
void |
addAllTabs(Tab[] tabs,
int index)
Adds all tabs, which are contained by an array, to the tab switcher, starting at a specific
index.
|
void |
addAllTabs(Tab[] tabs,
int index,
Animation animation)
Adds all tabs, which are contained by an array, to the tab switcher, starting at a
specific index.
|
void |
addCloseTabListener(TabCloseListener listener)
Adds a new listener, which should be notified, when a tab is about to be closed by clicking
its close button.
|
void |
addListener(Model.Listener listener)
Adds a new listener, which should be notified about the model's events.
|
void |
addTab(Tab tab)
Adds a new tab to the tab switcher.
|
void |
addTab(Tab tab,
int index)
Adds a new tab to the tab switcher at a specific index.
|
void |
addTab(Tab tab,
int index,
Animation animation)
Adds a new tab to the tab switcher at a specific index.
|
void |
addTabPreviewListener(TabPreviewListener listener)
Adds a new listener, which should be notified, when the preview of a tab is about to be
loaded.
|
boolean |
areToolbarsShown()
Returns, whether the toolbars are shown, when the tab switcher is shown, or not.
|
void |
clear()
Removes all tabs from the tab switcher.
|
void |
clear(Animation animation)
Removes all tabs from the tab switcher.
|
android.content.res.ColorStateList |
getAddTabButtonColor()
Returns the color of the button, which allows to add a new tab.
|
AddTabButtonListener |
getAddTabButtonListener()
Returns the listener, which is notified, when the button, which allows to add a new tab, has
been clicked.
|
ContentRecyclerAdapter |
getContentRecyclerAdapter()
Returns the adapter, which allows to inflate the views, which are associated with tabs.
|
android.content.Context |
getContext()
Returns the context, which is used by the tab switcher.
|
int |
getCount()
Returns the number of tabs, which are contained by the tab switcher.
|
TabSwitcherDecorator |
getDecorator()
Returns the decorator, which allows to inflate the views, which correspond to the tabs of the
tab switcher.
|
android.view.View |
getEmptyView()
Returns the view, which is shown, when the tab switcher is empty.
|
long |
getEmptyViewAnimationDuration()
Returns the duration of the fade animation, which should be used to show or hide the view,
which is shown, when the tab switcher is empty.
|
LogLevel |
getLogLevel()
Returns the log level, which is used for logging.
|
int |
getPaddingBottom()
Returns the bottom padding of the tab switcher.
|
int |
getPaddingEnd()
Returns the end padding of the tab switcher.
|
int |
getPaddingLeft()
Returns the left padding of the tab switcher.
|
int |
getPaddingRight()
Returns the right padding of the tab switcher.
|
int |
getPaddingStart()
Returns the start padding of the tab switcher.
|
int |
getPaddingTop()
Returns the top padding of the tab switcher.
|
int |
getReferenceTabIndex()
Returns the index of the tab, which is used as a reference, when restoring the positions of
tabs.
|
float |
getReferenceTabPosition()
Returns the position of the tab, which is used as a reference, when restoring the positions
of tabs.
|
Tab |
getSelectedTab()
Returns the currently selected tab.
|
int |
getSelectedTabIndex()
Returns the index of the currently selected tab.
|
Tab |
getTab(int index)
Returns the tab at a specific index.
|
android.content.res.ColorStateList |
getTabBackgroundColor()
Returns the default background color of a tab.
|
android.graphics.drawable.Drawable |
getTabCloseButtonIcon()
Returns the default icon of a tab's close button.
|
java.util.Set<TabCloseListener> |
getTabCloseListeners()
Returns the listeners, which should be notified, when a tab is about to be closed by clicking
its close button.
|
int |
getTabContentBackgroundColor()
Returns the default background color of a tab's content.
|
android.graphics.drawable.Drawable |
getTabIcon()
Returns the default icon of a tab.
|
java.util.Set<TabPreviewListener> |
getTabPreviewListeners()
Returns the listeners, which should be notified, when the previews of tabs are about to be
loaded.
|
int |
getTabProgressBarColor()
Returns the color of a tab's progress bar.
|
android.content.res.ColorStateList |
getTabTitleTextColor()
Returns the default text color of a tab's title.
|
int |
getToolbarMenuId()
Returns the resource id of the menu of the toolbar, which is shown, when the tab switcher is
shown.
|
OnMenuItemClickListener |
getToolbarMenuItemListener()
Returns the listener, which is notified, when an item of the menu of the toolbar, which is
shown, when the tab switcher is shown, has been clicked.
|
android.graphics.drawable.Drawable |
getToolbarNavigationIcon()
Returns the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
|
android.view.View.OnClickListener |
getToolbarNavigationIconListener()
Returns the listener, which is notified, when the navigation icon of the toolbar, which is
shown, when the tab switcher is shown, has been clicked.
|
java.lang.CharSequence |
getToolbarTitle()
Returns the title of the toolbar, which is shown, when the tab switcher is shown.
|
void |
hideSwitcher()
Hides the tab switcher by using an animation, if it is currently shown.
|
int |
indexOf(Tab tab)
Returns the index of a specific tab.
|
void |
inflateToolbarMenu(int resourceId,
OnMenuItemClickListener listener)
Inflates the menu of the toolbar, which is shown, when the tab switcher is shown.
|
boolean |
isAddTabButtonShown()
Returns, whether a button, which allows to add a new tab, is shown.
|
boolean |
isEmpty()
Returns, whether the tab switcher is empty, or not.
|
boolean |
isSwitcherShown()
Returns, whether the tab switcher is currently shown.
|
java.util.Iterator<Tab> |
iterator() |
void |
removeCloseTabListener(TabCloseListener listener)
Removes a specific listener, which should not be notified, when a tab is about to be closed
by clicking its close button, anymore.
|
void |
removeListener(Model.Listener listener)
Removes a specific listener, which should not be notified about the model's events, anymore.
|
void |
removeTab(Tab tab)
Removes a specific tab from the tab switcher.
|
void |
removeTab(Tab tab,
Animation animation)
Removes a specific tab from the tab switcher.
|
void |
removeTabPreviewListener(TabPreviewListener listener)
Removes a specific listener, which should not be notified, when the preview of a tab is about
to be loaded.
|
void |
restoreInstanceState(android.os.Bundle savedInstanceState)
Restores a previously saved state.
|
void |
saveInstanceState(android.os.Bundle outState)
Saves the current state.
|
void |
selectTab(int index)
Selects the tab as a specific index.
|
void |
selectTab(Tab tab)
Selects a specific tab.
|
void |
setAddTabButtonColor(android.content.res.ColorStateList colorStateList)
Sets the color of the button, which allows to add a new tab.
|
void |
setAddTabButtonColor(int color)
Sets the color of the button, which allows to add a new tab.
|
void |
setDecorator(TabSwitcherDecorator decorator)
Sets the decorator, which allows to inflate the views, which correspond to the tabs of the
tab switcher.
|
void |
setEmptyView(int resourceId)
Sets the view, which should be shown, when the tab switcher is empty.
|
void |
setEmptyView(int resourceId,
long animationDuration)
Sets the view, which should be shown, when the tab switcher is empty.
|
void |
setEmptyView(android.view.View view)
Sets the view, which should be shown, when the tab switcher is empty.
|
void |
setEmptyView(android.view.View view,
long animationDuration)
Sets the view, which should be shown, when the tab switcher is empty.
|
void |
setLogLevel(LogLevel logLevel)
Sets the log level, which should be used for logging.
|
void |
setPadding(int left,
int top,
int right,
int bottom)
Sets the padding of the tab switcher.
|
void |
setReferenceTabIndex(int referenceTabIndex)
Sets the index of the tab, which should be used as a reference, when restoring the positions
of tabs.
|
void |
setReferenceTabPosition(float referenceTabPosition)
Sets the position of the tab, which should be used as a reference, when restoring the
positions of tabs.
|
void |
setTabBackgroundColor(android.content.res.ColorStateList colorStateList)
Sets the default background color of a tab.
|
void |
setTabBackgroundColor(int color)
Sets the default background color of a tab.
|
void |
setTabCloseButtonIcon(android.graphics.Bitmap icon)
Sets the default icon of a tab's close button.
|
void |
setTabCloseButtonIcon(int resourceId)
Sets the default icon of a tab's close button.
|
void |
setTabContentBackgroundColor(int color)
Sets the default background color of a tab's content.
|
void |
setTabIcon(android.graphics.Bitmap icon)
Sets the default icon of a tab.
|
void |
setTabIcon(int resourceId)
Sets the default icon of a tab.
|
void |
setTabProgressBarColor(int color)
Sets the color of a tab's progress bar.
|
void |
setTabTitleTextColor(android.content.res.ColorStateList colorStateList)
Sets the default text color of a tab's title.
|
void |
setTabTitleTextColor(int color)
Sets the default text color of a tab's title.
|
void |
setToolbarNavigationIcon(android.graphics.drawable.Drawable icon,
android.view.View.OnClickListener listener)
Sets the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
|
void |
setToolbarNavigationIcon(int resourceId,
android.view.View.OnClickListener listener)
Sets the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
|
void |
setToolbarTitle(java.lang.CharSequence title)
Sets the title of the toolbar, which is shown, when the tab switcher is shown.
|
void |
setToolbarTitle(int resourceId)
Sets the title of the toolbar, which is shown, when the tab switcher is shown.
|
void |
showAddTabButton(AddTabButtonListener listener)
Sets, whether a button, which allows to add a new tab, should be shown.
|
void |
showSwitcher()
Shows the tab switcher by using an animation, if it is not already shown.
|
void |
showToolbars(boolean show)
Sets, whether the toolbars should be shown, when the tab switcher is shown, or not.
|
void |
toggleSwitcherVisibility()
Toggles the visibility of the tab switcher by using an animation, i.e.
|
public static final java.lang.String REFERENCE_TAB_INDEX_EXTRA
public static final java.lang.String REFERENCE_TAB_POSITION_EXTRA
public TabSwitcherModel(TabSwitcher tabSwitcher)
TabSwitcher.tabSwitcher - The tab switcher, the model belongs to, as an instance of the class ViewGroup. The parent may not be nullpublic final void addListener(Model.Listener listener)
listener - The listener, which should be added, as an instance of the type Listener. The
listener may not be nullpublic final void removeListener(Model.Listener listener)
listener - The listener, which should be removed, as an instance of the type Listener.
The listener may not be nullpublic final int getReferenceTabIndex()
Integer value or -1, if the positions of tabs should not be restoredpublic final void setReferenceTabIndex(int referenceTabIndex)
referenceTabIndex - The index, which should be set, as an Integer value or -1, if the positions
of tabs should not be restoredpublic final float getReferenceTabPosition()
Float value or -1, if the positions
of tabs should not be restoredpublic final void setReferenceTabPosition(float referenceTabPosition)
referenceTabPosition - The position, which should be set, in relation to the available space as a Float value or -1, if the position of tabs should not be restoredpublic final AddTabButtonListener getAddTabButtonListener()
AddTabButtonListener or null, if the button
is not shownpublic final android.view.View.OnClickListener getToolbarNavigationIconListener()
View.OnClickListener or null, if no listener should be notifiedpublic final int getToolbarMenuId()
Integer value. The resource id must correspond to a valid menu resourcepublic final OnMenuItemClickListener getToolbarMenuItemListener()
public final long getEmptyViewAnimationDuration()
Long valuepublic final java.util.Set<TabCloseListener> getTabCloseListeners()
Set or an empty
set, if no listeners should be notifiedpublic final java.util.Set<TabPreviewListener> getTabPreviewListeners()
Set or an empty set, if no
listeners should be notifiedpublic final ContentRecyclerAdapter getContentRecyclerAdapter()
ContentRecyclerAdapterpublic final android.content.Context getContext()
ModelgetContext in interface ModelContext. The context may not be nullpublic final void setDecorator(TabSwitcherDecorator decorator)
ModelsetDecorator in interface Modeldecorator - The decorator, which should be set, as an instance of the class TabSwitcherDecorator. The decorator may not be nullpublic final TabSwitcherDecorator getDecorator()
ModelgetDecorator in interface ModelTabSwitcherDecorator or null, if no
decorator has been setpublic final LogLevel getLogLevel()
ModelgetLogLevel in interface Modelpublic final void setLogLevel(LogLevel logLevel)
ModelsetLogLevel in interface ModellogLevel - The log level, which should be set, as a value of the enum LogLevel. The log level
may not be nullpublic final boolean isEmpty()
Modelpublic final int getCount()
Modelpublic final Tab getTab(int index)
ModelgetTab in interface Modelindex - The index of the tab, which should be returned, as an Integer value. The
index must be at least 0 and at maximum getCount() - 1, otherwise a
IndexOutOfBoundsException will be thrownTab. The tab may not be nullpublic final int indexOf(Tab tab)
Modelpublic final void addTab(Tab tab)
ModelSwipeAnimation with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM is used. If
an animation is currently running, the tab will be added once all previously started
animations have been finished.public final void addTab(Tab tab, int index)
ModelSwipeAnimation with
direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM is used. If an animation is currently
running, the tab will be added once all previously started animations have been finished.addTab in interface Modeltab - The tab, which should be added, as an instance of the class Tab. The tab may
not be nullindex - The index, the tab should be added at, as an Integer value. The index must be
at least 0 and at maximum getCount(), otherwise an IndexOutOfBoundsException will be thrownpublic final void addTab(Tab tab, int index, Animation animation)
ModeladdTab in interface Modeltab - The tab, which should be added, as an instance of the class Tab. The tab may
not be nullindex - The index, the tab should be added at, as an Integer value. The index must be
at least 0 and at maximum getCount(), otherwise an IndexOutOfBoundsException will be thrownanimation - The animation, which should be used to add the tab, as an instance of the class
Animation. The animation may not be nullpublic final void addAllTabs(java.util.Collection<? extends Tab> tabs)
ModelSwipeAnimation with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM is used. If an animation is currently running, the tabs will
be added once all previously started animations have been finished.addAllTabs in interface Modeltabs - A collection, which contains the tabs, which should be added, as an instance of the
type Collection or an empty collection, if no tabs should be addedpublic final void addAllTabs(java.util.Collection<? extends Tab> tabs, int index)
ModelSwipeAnimation with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM is used. If an animation is currently running, the tabs will
be added once all previously started animations have been finished.addAllTabs in interface Modeltabs - A collection, which contains the tabs, which should be added, as an instance of the
type Collection or an empty collection, if no tabs should be addedindex - The index, the first tab should be started at, as an Integer value. The index
must be at least 0 and at maximum getCount(), otherwise an IndexOutOfBoundsException will be thrownpublic final void addAllTabs(java.util.Collection<? extends Tab> tabs, int index, Animation animation)
ModeladdAllTabs in interface Modeltabs - A collection, which contains the tabs, which should be added, as an instance of the
type Collection or an empty collection, if no tabs should be addedindex - The index, the first tab should be started at, as an Integer value. The index
must be at least 0 and at maximum getCount(), otherwise an IndexOutOfBoundsException will be thrownanimation - The animation, which should be used to add the tabs, as an instance of the class
Animation. The animation may not be nullpublic final void addAllTabs(Tab[] tabs)
ModelSwipeAnimation with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM is used. If an animation is currently running, the tabs will
be added once all previously started animations have been finished.addAllTabs in interface Modeltabs - An array, which contains the tabs, which should be added, as an array of the type
Tab or an empty array, if no tabs should be addedpublic final void addAllTabs(Tab[] tabs, int index)
ModelSwipeAnimation with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM is used. If an animation is currently running, the tabs will
be added once all previously started animations have been finished.addAllTabs in interface Modeltabs - An array, which contains the tabs, which should be added, as an array of the type
Tab or an empty array, if no tabs should be addedindex - The index, the first tab should be started at, as an Integer value. The index
must be at least 0 and at maximum getCount(), otherwise an IndexOutOfBoundsException will be thrownpublic final void addAllTabs(Tab[] tabs, int index, Animation animation)
ModeladdAllTabs in interface Modeltabs - An array, which contains the tabs, which should be added, as an array of the type
Tab or an empty array, if no tabs should be addedindex - The index, the first tab should be started at, as an Integer value. The index
must be at least 0 and at maximum getCount(), otherwise an IndexOutOfBoundsException will be thrownanimation - The animation, which should be used to add the tabs, as an instance of the class
Animation. The animation may not be nullpublic final void removeTab(Tab tab)
ModelSwipeAnimation with direction
SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM is used. If an animation is currently running, the tab
will be removed once all previously started animations have been finished.public final void removeTab(Tab tab, Animation animation)
Modelpublic final void clear()
ModelSwipeAnimation with direction
SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM is used. If an animation is currently running, the
tabs will be removed once all previously started animations have been finished.public final void clear(Animation animation)
Modelpublic final boolean isSwitcherShown()
ModelisSwitcherShown in interface Modelpublic final void showSwitcher()
ModelshowSwitcher in interface Modelpublic final void hideSwitcher()
ModelhideSwitcher in interface Modelpublic final void toggleSwitcherVisibility()
ModeltoggleSwitcherVisibility in interface Modelpublic final Tab getSelectedTab()
ModelgetSelectedTab in interface ModelTab or null, if no tab
is currently selectedpublic final int getSelectedTabIndex()
ModelgetSelectedTabIndex in interface ModelInteger value or -1, if no tab
is currently selectedpublic final void selectTab(Tab tab)
Modelpublic final void selectTab(int index)
Modelpublic final java.util.Iterator<Tab> iterator()
iterator in interface java.lang.Iterable<Tab>public final void setPadding(int left,
int top,
int right,
int bottom)
ModelsetPadding in interface Modelleft - The left padding, which should be set, in pixels as an Integer valuetop - The top padding, which should be set, in pixels as an Integer valueright - The right padding, which should be set, in pixels as an Integer valuebottom - The bottom padding, which should be set, in pixels as an Integer valuepublic final int getPaddingLeft()
ModelgetPaddingLeft in interface ModelInteger valuepublic final int getPaddingTop()
ModelgetPaddingTop in interface ModelInteger valuepublic final int getPaddingRight()
ModelgetPaddingRight in interface ModelInteger valuepublic final int getPaddingBottom()
ModelgetPaddingBottom in interface ModelInteger valuepublic final int getPaddingStart()
ModelgetPaddingStart in interface ModelInteger valuepublic final int getPaddingEnd()
ModelgetPaddingEnd in interface ModelInteger valuepublic final android.graphics.drawable.Drawable getTabIcon()
ModelgetTabIcon in interface ModelDrawable or null, if no
icon is setpublic final void setTabIcon(int resourceId)
ModelsetTabIcon in interface ModelresourceId - The resource id of the icon, which should be set, as an Integer value. The
resource id must correspond to a valid drawable resourcepublic final void setTabIcon(android.graphics.Bitmap icon)
ModelsetTabIcon in interface Modelicon - The icon, which should be set, as an instance of the class Bitmap or null, if
no icon should be setpublic final android.content.res.ColorStateList getTabBackgroundColor()
ModelgetTabBackgroundColor in interface ModelColorStateList or null, if the default color is usedpublic final void setTabBackgroundColor(int color)
ModelsetTabBackgroundColor in interface Modelcolor - The color, which should be set, as an Integer value or -1, if the default
color should be usedpublic final void setTabBackgroundColor(android.content.res.ColorStateList colorStateList)
ModelsetTabBackgroundColor in interface ModelcolorStateList - The color, which should be set, as an instance of the class ColorStateList or
null, if the default color should be usedpublic final int getTabContentBackgroundColor()
ModelgetTabContentBackgroundColor in interface ModelInteger valuepublic final void setTabContentBackgroundColor(int color)
ModelsetTabContentBackgroundColor in interface Modelcolor - The color, which should be set, as an Integer value or -1, if the default
color should be usedpublic final android.content.res.ColorStateList getTabTitleTextColor()
ModelgetTabTitleTextColor in interface ModelColorStateList or null, if the default color is usedpublic final void setTabTitleTextColor(int color)
ModelsetTabTitleTextColor in interface Modelcolor - The color, which should be set, as an Integer value or -1, if the default
color should be usedpublic final void setTabTitleTextColor(android.content.res.ColorStateList colorStateList)
ModelsetTabTitleTextColor in interface ModelcolorStateList - The color state list, which should be set, as an instance of the class ColorStateList or null, if the default color should be usedpublic final android.graphics.drawable.Drawable getTabCloseButtonIcon()
ModelgetTabCloseButtonIcon in interface ModelDrawable
or null, if the default icon is usedpublic final int getTabProgressBarColor()
ModelgetTabProgressBarColor in interface ModelInteger value or -1, if the default
color is usedpublic final void setTabProgressBarColor(int color)
ModelsetTabProgressBarColor in interface Modelcolor - The color, which should be set, as an Integer value or -1, if the default
color should be usedpublic final void setTabCloseButtonIcon(int resourceId)
ModelsetTabCloseButtonIcon in interface ModelresourceId - The resource id of the icon, which should be set, as an Integer value. The
resource id must correspond to a valid drawable resourcepublic final void setTabCloseButtonIcon(android.graphics.Bitmap icon)
ModelsetTabCloseButtonIcon in interface Modelicon - The icon, which should be set, as an instance of the class Bitmap or null, if
the default icon should be usedpublic final boolean isAddTabButtonShown()
ModelisAddTabButtonShown in interface Modelpublic final void showAddTabButton(AddTabButtonListener listener)
ModelshowAddTabButton in interface Modellistener - The listener, which should be notified, when the button has been clicked, as an
instance of the type AddTabButtonListener or null, if the button should not
be shownpublic final android.content.res.ColorStateList getAddTabButtonColor()
ModelgetAddTabButtonColor in interface ModelColorStateList or null, if the default color is usedpublic final void setAddTabButtonColor(int color)
ModelsetAddTabButtonColor in interface Modelcolor - The color, which should be set, as an Integer value or -1, if the default
color should be usedpublic final void setAddTabButtonColor(android.content.res.ColorStateList colorStateList)
ModelsetAddTabButtonColor in interface ModelcolorStateList - The color, which should be set, as an instance of the class ColorStateList or
null, if the default color should be usedpublic final boolean areToolbarsShown()
ModelareToolbarsShown in interface Modelpublic final void showToolbars(boolean show)
ModelshowToolbars in interface Modelshow - True, if the toolbars should be shown, false otherwisepublic final java.lang.CharSequence getToolbarTitle()
ModelgetToolbarTitle in interface ModelCharSequence or null, if no title is setpublic void setToolbarTitle(int resourceId)
ModelsetToolbarTitle in interface ModelresourceId - The resource id of the title, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcepublic final void setToolbarTitle(java.lang.CharSequence title)
ModelsetToolbarTitle in interface Modeltitle - The title, which should be set, as an instance of the type CharSequence or
null, if no title should be setpublic final android.graphics.drawable.Drawable getToolbarNavigationIcon()
ModelgetToolbarNavigationIcon in interface ModelDrawable or null, if no icon is setpublic final void setToolbarNavigationIcon(int resourceId,
android.view.View.OnClickListener listener)
ModelsetToolbarNavigationIcon in interface ModelresourceId - The resource id of the icon, which should be set, as an Integer value. The
resource id must correspond to a valid drawable resourcelistener - The listener, which should be notified, when the navigation item has been clicked, as
an instance of the type View.OnClickListener or null, if no listener should be
notifiedpublic final void setToolbarNavigationIcon(android.graphics.drawable.Drawable icon,
android.view.View.OnClickListener listener)
ModelsetToolbarNavigationIcon in interface Modelicon - The icon, which should be set, as an instance of the class Drawable or null,
if no icon should be setlistener - The listener, which should be notified, when the navigation item has been clicked, as
an instance of the type View.OnClickListener or null, if no listener should be
notifiedpublic final void inflateToolbarMenu(int resourceId,
OnMenuItemClickListener listener)
ModelinflateToolbarMenu in interface ModelresourceId - The resource id of the menu, which should be inflated, as an Integer value.
The resource id must correspond to a valid menu resourcelistener - The listener, which should be notified, when an menu item has been clicked, as an
instance of the type OnMenuItemClickListener or null, if no listener should be
notifiedpublic final android.view.View getEmptyView()
ModelgetEmptyView in interface ModelView or null, if no view is shownpublic final void setEmptyView(android.view.View view)
ModelsetEmptyView in interface Modelview - The view, which should be set, as an instance of the class View or null, if
no view should be shown, when the tab switcher is emptypublic final void setEmptyView(android.view.View view,
long animationDuration)
ModelsetEmptyView in interface Modelview - The view, which should be set, as an instance of the class View or null, if
no view should be shown, when the tab switcher is emptyanimationDuration - The duration of the fade animation, which is used to show or hide the view, in
milliseconds as a Long value. The duration must be at least 0 or -1, if the
default duration should be usedpublic final void setEmptyView(int resourceId)
ModelsetEmptyView in interface ModelresourceId - The resource id of the view, which should be set, as an Integer value. The
resource id must correspond to a valid layout resourcepublic final void setEmptyView(int resourceId,
long animationDuration)
ModelsetEmptyView in interface ModelresourceId - The resource id of the view, which should be set, as an Integer value. The
resource id must correspond to a valid layout resourceanimationDuration - The duration of the fade animation, which is used to show or hide the view, in
milliseconds as a Long value. The duration must be at least 0 or -1, if the
default duration should be usedpublic final void addCloseTabListener(TabCloseListener listener)
ModeladdCloseTabListener in interface Modellistener - The listener, which should be added, as an instance of the type TabCloseListener. The listener may not be nullpublic final void removeCloseTabListener(TabCloseListener listener)
ModelremoveCloseTabListener in interface Modellistener - The listener, which should be removed, as an instance of the type TabCloseListener. The listener may not be nullpublic final void addTabPreviewListener(TabPreviewListener listener)
ModeladdTabPreviewListener in interface Modellistener - The listener, which should be added, as an instance of the type TabPreviewListener. The listener may not be nullpublic final void removeTabPreviewListener(TabPreviewListener listener)
ModelremoveTabPreviewListener in interface Modellistener - The listener, which should be removed, as an instance of the type TabPreviewListener. The listener may not be nullpublic final void saveInstanceState(android.os.Bundle outState)
RestorablesaveInstanceState in interface RestorableoutState - The bundle, which should be used to store the saved state, as an instance of the
class Bundle. The bundle may not be nullpublic final void restoreInstanceState(android.os.Bundle savedInstanceState)
RestorablerestoreInstanceState in interface RestorablesavedInstanceState - The saved state as an instance of the class Bundle or null, if no saved state
is available