public static interface Model.Listener
Modifier and Type | Method and Description |
---|---|
void |
onAddTabButtonColorChanged(android.content.res.ColorStateList colorStateList)
The method, which is invoked, when the color of the button, which allows to add a new
tab, has been changed.
|
void |
onAddTabButtonVisibilityChanged(boolean visible)
The method, which is invoked, when it has been changed, whether the button, which allows
to add a new tab, should be shown, or not.
|
void |
onAllTabsAdded(int index,
Tab[] tabs,
int previousSelectedTabIndex,
int selectedTabIndex,
Animation animation)
The method, which is invoked, when multiple tabs have been added to the model.
|
void |
onAllTabsRemoved(Tab[] tabs,
Animation animation)
The method, which is invoked, when all tabs have been removed from the tab switcher.
|
void |
onApplyPaddingToTabsChanged(boolean applyPaddingToTabs)
The method, which is invoked, when it has been changed, whether the padding of the tab
switcher is applied to the content of its tabs, or not.
|
void |
onDecoratorChanged(TabSwitcherDecorator decorator)
The method, which is invoked, when the decorator has been changed.
|
void |
onEmptyViewChanged(android.view.View view,
long animationDuration)
The method, which is invoked, when the view, which is shown, when the tab switcher is
empty, has been changed.
|
void |
onLogLevelChanged(de.mrapp.android.util.logging.LogLevel logLevel)
The method, which is invoked, when the log level has been changed.
|
void |
onPaddingChanged(int left,
int top,
int right,
int bottom)
The method, which is invoked, when the padding has been changed.
|
void |
onSelectionChanged(int previousIndex,
int index,
Tab selectedTab,
boolean switcherHidden)
The method, which is invoked, when the currently selected tab has been changed.
|
void |
onSwitcherHidden()
The method, which is invoked, when the tab switcher has been hidden.
|
void |
onSwitcherShown()
The method, which is invoked, when the tab switcher has been shown.
|
void |
onTabAdded(int index,
Tab tab,
int previousSelectedTabIndex,
int selectedTabIndex,
boolean switcherVisibilityChanged,
Animation animation)
The method, which is invoked, when a tab has been added to the model.
|
void |
onTabBackgroundColorChanged(android.content.res.ColorStateList colorStateList)
The method, which is invoked, when the background color of a tab has been changed.
|
void |
onTabCloseButtonIconChanged(android.graphics.drawable.Drawable icon)
The method, which is invoked, when the icon of a tab's close button has been changed.
|
void |
onTabContentBackgroundColorChanged(int color)
The method, which is invoked, when the background color of a tab's content has been
changed.
|
void |
onTabIconChanged(android.graphics.drawable.Drawable icon)
The method, which is invoked, when the default icon of a tab has been changed.
|
void |
onTabProgressBarColorChanged(int color)
The method, which is invoked, when the color of a tab's progress bar has been changed.
|
void |
onTabRemoved(int index,
Tab tab,
int previousSelectedTabIndex,
int selectedTabIndex,
Animation animation)
The method, which is invoked, when a tab has been removed from the model.
|
void |
onTabTitleColorChanged(android.content.res.ColorStateList colorStateList)
The method, which is invoked, when the text color of a tab's title has been changed.
|
void |
onToolbarMenuInflated(int resourceId,
android.support.v7.widget.Toolbar.OnMenuItemClickListener listener)
The method, which is invoked, when the menu of the toolbar, which is shown, when the tab
switcher is shown, has been inflated.
|
void |
onToolbarNavigationIconChanged(android.graphics.drawable.Drawable icon,
android.view.View.OnClickListener listener)
The method, which is invoked, when the navigation icon of the toolbar, which is shown,
when the tab switcher is shown, has been changed.
|
void |
onToolbarTitleChanged(java.lang.CharSequence title)
The method, which is invoked, when the title of the toolbar, which is shown, when the tab
switcher is shown, has been changed.
|
void |
onToolbarVisibilityChanged(boolean visible)
The method, which is invoked, when it has been changed, whether the toolbars should be
shown, when the tab switcher is shown, or not.
|
void onLogLevelChanged(@NonNull de.mrapp.android.util.logging.LogLevel logLevel)
logLevel
- The log level, which has been set, as a value of the enum LogLevel. The log level
may not be nullvoid onDecoratorChanged(@NonNull TabSwitcherDecorator decorator)
decorator
- The decorator, which has been set, as an instance of the class TabSwitcherDecorator
. The decorator may not be nullvoid onSwitcherShown()
void onSwitcherHidden()
void onSelectionChanged(int previousIndex, int index, @Nullable Tab selectedTab, boolean switcherHidden)
previousIndex
- The index of the previously selected tab as an Integer
value or -1, if no
tab was previously selectedindex
- The index of the currently selected tab as an Integer
value or -1, if the
tab switcher does not contain any tabsselectedTab
- The currently selected tab as an instance of the class Tab
or null, if
the tab switcher does not contain any tabsswitcherHidden
- True, if selecting the tab caused the tab switcher to be hidden, false otherwisevoid onTabAdded(int index, @NonNull Tab tab, int previousSelectedTabIndex, int selectedTabIndex, boolean switcherVisibilityChanged, @NonNull Animation animation)
index
- The index of the tab, which has been added, as an Integer
valuetab
- The tab, which has been added, as an instance of the class Tab
. The tab
may not be nullpreviousSelectedTabIndex
- The index of the previously selected tab as an Integer
value or -1, if no
tab was selectedselectedTabIndex
- The index of the currently selected tab as an Integer
value or -1, if the
tab switcher does not contain any tabsswitcherVisibilityChanged
- True, if adding the tab caused the visibility of the tab switcher to be changed,
false otherwiseanimation
- The animation, which has been used to add the tab, as an instance of the class
Animation
. The animation may not be nullvoid onAllTabsAdded(int index, @NonNull Tab[] tabs, int previousSelectedTabIndex, int selectedTabIndex, @NonNull Animation animation)
index
- The index of the first tab, which has been added, as an Integer
valuetabs
- An array, which contains the tabs, which have been added, as an array of the type
Tab
or an empty array, if no tabs have been addedpreviousSelectedTabIndex
- The index of the previously selected tab as an Integer
value or -1, if no
tab was selectedselectedTabIndex
- The index of the currently selected tab as an Integer
value or -1, if the
tab switcher does not contain any tabsanimation
- The animation, which has been used to add the tabs, as an instance of the class
Animation
. The animation may not be nullvoid onTabRemoved(int index, @NonNull Tab tab, int previousSelectedTabIndex, int selectedTabIndex, @NonNull Animation animation)
index
- The index of the tab, which has been removed, as an Integer
valuetab
- The tab, which has been removed, as an instance of the class Tab
. The tab
may not be nullpreviousSelectedTabIndex
- The index of the previously selected tab as an Integer
value or -1, if no
tab was selectedselectedTabIndex
- The index of the currently selected tab as an Integer
value or -1, if the
tab switcher does not contain any tabsanimation
- The animation, which has been used to remove the tab, as an instance of the class
Animation
. The animation may not be nullvoid onAllTabsRemoved(@NonNull Tab[] tabs, @NonNull Animation animation)
void onPaddingChanged(int left, int top, int right, int bottom)
left
- The left padding, which has been set, in pixels as an Integer
valuetop
- The top padding, which has been set, in pixels as an Integer
valueright
- The right padding, which has been set, in pixels as an Integer
valuebottom
- The bottom padding, which has been set, in pixels as an Integer
valuevoid onApplyPaddingToTabsChanged(boolean applyPaddingToTabs)
applyPaddingToTabs
- True, if the padding of the tab switcher is applied to the content of its tabs,
false otherwisevoid onTabIconChanged(@Nullable android.graphics.drawable.Drawable icon)
icon
- The icon, which has been set, as an instance of the class Drawable
or
null, if no icon is setvoid onTabBackgroundColorChanged(@Nullable android.content.res.ColorStateList colorStateList)
colorStateList
- The color state list, which has been set, as an instance of the class ColorStateList
or null, if the default color should be usedvoid onTabContentBackgroundColorChanged(int color)
color
- The color, which has been set, as an Integer
value or -1, if the default
color should be usedvoid onTabTitleColorChanged(@Nullable android.content.res.ColorStateList colorStateList)
colorStateList
- The color state list, which has been set, as an instance of the class ColorStateList
or null, if the default color should be usedvoid onTabCloseButtonIconChanged(@Nullable android.graphics.drawable.Drawable icon)
icon
- The icon, which has been set, as an instance of the class Drawable
or
null, if the default icon should be usedvoid onTabProgressBarColorChanged(int color)
color
- The color, which has been set, as an Integer
value or -1, if the default
color should be usedvoid onAddTabButtonVisibilityChanged(boolean visible)
visible
- True, if the button, which allows to add a new tab, should be shown, false
otherwisevoid onAddTabButtonColorChanged(@Nullable android.content.res.ColorStateList colorStateList)
colorStateList
- The color, which has been set, as an instance of the class ColorStateList
or null, if the default color should be usedvoid onToolbarVisibilityChanged(boolean visible)
visible
- True, if the toolbars should be shown, when the tab switcher is shown, false
otherwisevoid onToolbarTitleChanged(@Nullable java.lang.CharSequence title)
title
- The title, which has been set, as an instance of the type CharSequence
or
null, if no title is setvoid onToolbarNavigationIconChanged(@Nullable android.graphics.drawable.Drawable icon, @Nullable android.view.View.OnClickListener listener)
icon
- The navigation icon, which has been set, as an instance of the class Drawable
or null, if no navigation icon is 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 notifiedvoid onToolbarMenuInflated(@MenuRes int resourceId, @Nullable android.support.v7.widget.Toolbar.OnMenuItemClickListener listener)
resourceId
- The resource id of the menu, which has been inflated, as an Integer
value. The resource id must correspond to a valid menu resourcelistener
- The listener, which has been registered to be notified, when an item of the menu
has been clicked, as an instance of the type OnMenuItemClickListener or null, if
no listener should be notifiedvoid onEmptyViewChanged(@Nullable android.view.View view, long animationDuration)
view
- The view, which has been 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 used