public class TabletContentRecyclerAdapterWrapper extends <any> implements Restorable, Tab.Callback, Model.Listener
ContentRecyclerAdapter, which allows to inflate the
views, which are used to visualize the content views of the tabs of a TabSwitcher. The
wrapper enables to adapt the views for use with the tablet layout.| Constructor and Description |
|---|
TabletContentRecyclerAdapterWrapper(TabSwitcher tabSwitcher,
TabSwitcherStyle style,
<any> viewRecycler,
ContentRecyclerAdapter encapsulatedAdapter)
Creates a new wrapper, which encapsulates a
ContentRecyclerAdapter, which allows to
inflate the views, which are used to visualize the content views of the tabs of a TabSwitcher. |
| Modifier and Type | Method and Description |
|---|---|
int |
getViewType(Tab item) |
int |
getViewTypeCount() |
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 |
onBackgroundColorChanged(Tab tab)
The method, which is invoked, when the tab's background color has been changed.
|
void |
onCloseableChanged(Tab tab)
The method, which is invoked, when it has been changed, whether the tab is closeable, or
not.
|
void |
onCloseButtonIconChanged(Tab tab)
The method, which is invoked, when the icon of the tab's close button has been changed.
|
void |
onContentBackgroundColorChanged(Tab tab)
The method, which is invoked, when the background color of the tab's content has been
changed.
|
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 |
onIconChanged(Tab tab)
The method, which is invoked, when the tab's icon has been changed.
|
android.view.View |
onInflateView(android.view.LayoutInflater inflater,
android.view.ViewGroup parent,
Tab item,
int viewType,
java.lang.Void... params) |
void |
onLogLevelChanged(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 |
onProgressBarColorChanged(Tab tab)
The method, which is invoked, when the color of the tab's progress bar has been changed.
|
void |
onProgressBarVisibilityChanged(Tab tab)
The method, which is invoked, when the visibility of the tab's progress bar has been
changed.
|
void |
onRemoveView(android.view.View view,
Tab item) |
void |
onSelectionChanged(int previousIndex,
int index,
Tab selectedTab,
boolean switcherHidden)
The method, which is invoked, when the currently selected tab has been changed.
|
void |
onShowView(android.content.Context context,
android.view.View view,
Tab item,
boolean inflated,
java.lang.Void... params) |
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 |
onTitleChanged(Tab tab)
The method, which is invoked, when the tab's title has been changed.
|
void |
onTitleTextColorChanged(Tab tab)
The method, which is invoked, when the text color of the tab's title has been changed.
|
void |
onToolbarMenuInflated(int resourceId,
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 |
restoreInstanceState(android.os.Bundle savedInstanceState)
Restores a previously saved state.
|
void |
saveInstanceState(android.os.Bundle outState)
Saves the current state.
|
public TabletContentRecyclerAdapterWrapper(TabSwitcher tabSwitcher, TabSwitcherStyle style, <any> viewRecycler, ContentRecyclerAdapter encapsulatedAdapter)
ContentRecyclerAdapter, which allows to
inflate the views, which are used to visualize the content views of the tabs of a TabSwitcher.tabSwitcher - The tab switcher, the recycler adapter belongs to, as an instance of the class TabSwitcher. The tab switcher may not be nullstyle - The style, which allows to retrieve style attributes of the tab switcher, as an
instance of the class TabSwitcherStyle. The style may not be nullviewRecycler - The view recycler, the adapter is attached to, as an instance of the class
AttachedViewRecycler. The view recycler may not be nullencapsulatedAdapter - The view recycler adapter, which should be encapsulated, as an instance of the class
ContentRecyclerAdapter. The recycler adapter may not be nullpublic final android.view.View onInflateView(android.view.LayoutInflater inflater,
android.view.ViewGroup parent,
Tab item,
int viewType,
java.lang.Void... params)
public final void onShowView(android.content.Context context,
android.view.View view,
Tab item,
boolean inflated,
java.lang.Void... params)
public final void onRemoveView(android.view.View view,
Tab item)
public final int getViewTypeCount()
public final int getViewType(Tab item)
public 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 availablepublic final void onTitleChanged(Tab tab)
Tab.CallbackonTitleChanged in interface Tab.Callbacktab - The observed tab as an instance of the class Tab. The tab may not be
nullpublic final void onIconChanged(Tab tab)
Tab.CallbackonIconChanged in interface Tab.Callbacktab - The observed tab as an instance of the class Tab. The tab may not be
nullpublic final void onCloseableChanged(Tab tab)
Tab.CallbackonCloseableChanged in interface Tab.Callbacktab - The observed tab as an instance of the class Tab. The tab may not be
nullpublic final void onCloseButtonIconChanged(Tab tab)
Tab.CallbackonCloseButtonIconChanged in interface Tab.Callbacktab - The observed tab as an instance of the class Tab. The tab may not be
nullpublic final void onBackgroundColorChanged(Tab tab)
Tab.CallbackonBackgroundColorChanged in interface Tab.Callbacktab - The observed tab as an instance of the class Tab. The tab may not be
nullpublic final void onContentBackgroundColorChanged(Tab tab)
Tab.CallbackonContentBackgroundColorChanged in interface Tab.Callbacktab - The observed tab as an instance of the class Tab. The tab may not be
nullpublic final void onTitleTextColorChanged(Tab tab)
Tab.CallbackonTitleTextColorChanged in interface Tab.Callbacktab - The observed tab as an instance of the class Tab. The tab may not be
nullpublic final void onProgressBarVisibilityChanged(Tab tab)
Tab.CallbackonProgressBarVisibilityChanged in interface Tab.Callbacktab - The observed tab as an instance of the class Tab. The tab may not be
nullpublic final void onProgressBarColorChanged(Tab tab)
Tab.CallbackonProgressBarColorChanged in interface Tab.Callbacktab - The observed tab as an instance of the class Tab. The tab may not be
nullpublic final void onLogLevelChanged(LogLevel logLevel)
Model.ListeneronLogLevelChanged in interface Model.ListenerlogLevel - The log level, which has been set, as a value of the enum LogLevel. The log level
may not be nullpublic final void onDecoratorChanged(TabSwitcherDecorator decorator)
Model.ListeneronDecoratorChanged in interface Model.Listenerdecorator - The decorator, which has been set, as an instance of the class TabSwitcherDecorator. The decorator may not be nullpublic final void onSwitcherShown()
Model.ListeneronSwitcherShown in interface Model.Listenerpublic final void onSwitcherHidden()
Model.ListeneronSwitcherHidden in interface Model.Listenerpublic final void onSelectionChanged(int previousIndex,
int index,
Tab selectedTab,
boolean switcherHidden)
Model.ListeneronSelectionChanged in interface Model.ListenerpreviousIndex - 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 otherwisepublic final void onTabAdded(int index,
Tab tab,
int previousSelectedTabIndex,
int selectedTabIndex,
boolean switcherVisibilityChanged,
Animation animation)
Model.ListeneronTabAdded in interface Model.Listenerindex - 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 nullpublic final void onAllTabsAdded(int index,
Tab[] tabs,
int previousSelectedTabIndex,
int selectedTabIndex,
Animation animation)
Model.ListeneronAllTabsAdded in interface Model.Listenerindex - 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 nullpublic final void onTabRemoved(int index,
Tab tab,
int previousSelectedTabIndex,
int selectedTabIndex,
Animation animation)
Model.ListeneronTabRemoved in interface Model.Listenerindex - 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 nullpublic final void onAllTabsRemoved(Tab[] tabs, Animation animation)
Model.ListeneronAllTabsRemoved in interface Model.Listenertabs - An array, which contains the tabs, which have been removed, as an array of the
type Tab or an empty array, if no tabs have been removedanimation - The animation, which has been used to remove the tabs, as an instance of the
class Animation. The animation may not be nullpublic final void onPaddingChanged(int left,
int top,
int right,
int bottom)
Model.ListeneronPaddingChanged in interface Model.Listenerleft - 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 valuepublic final void onTabIconChanged(android.graphics.drawable.Drawable icon)
Model.ListeneronTabIconChanged in interface Model.Listenericon - The icon, which has been set, as an instance of the class Drawable or
null, if no icon is setpublic final void onTabBackgroundColorChanged(android.content.res.ColorStateList colorStateList)
Model.ListeneronTabBackgroundColorChanged in interface Model.ListenercolorStateList - The color state list, which has been set, as an instance of the class ColorStateList or null, if the default color should be usedpublic final void onTabContentBackgroundColorChanged(int color)
Model.ListeneronTabContentBackgroundColorChanged in interface Model.Listenercolor - The color, which has been set, as an Integer value or -1, if the default
color should be usedpublic final void onTabTitleColorChanged(android.content.res.ColorStateList colorStateList)
Model.ListeneronTabTitleColorChanged in interface Model.ListenercolorStateList - The color state list, which has been set, as an instance of the class ColorStateList or null, if the default color should be usedpublic final void onTabCloseButtonIconChanged(android.graphics.drawable.Drawable icon)
Model.ListeneronTabCloseButtonIconChanged in interface Model.Listenericon - The icon, which has been set, as an instance of the class Drawable or
null, if the default icon should be usedpublic final void onTabProgressBarColorChanged(int color)
Model.ListeneronTabProgressBarColorChanged in interface Model.Listenercolor - The color, which has been set, as an Integer value or -1, if the default
color should be usedpublic final void onAddTabButtonVisibilityChanged(boolean visible)
Model.ListeneronAddTabButtonVisibilityChanged in interface Model.Listenervisible - True, if the button, which allows to add a new tab, should be shown, false
otherwisepublic final void onAddTabButtonColorChanged(android.content.res.ColorStateList colorStateList)
Model.ListeneronAddTabButtonColorChanged in interface Model.ListenercolorStateList - The color, which has been set, as an instance of the class ColorStateList
or null, if the default color should be usedpublic final void onToolbarVisibilityChanged(boolean visible)
Model.ListeneronToolbarVisibilityChanged in interface Model.Listenervisible - True, if the toolbars should be shown, when the tab switcher is shown, false
otherwisepublic final void onToolbarTitleChanged(java.lang.CharSequence title)
Model.ListeneronToolbarTitleChanged in interface Model.Listenertitle - The title, which has been set, as an instance of the type CharSequence or
null, if no title is setpublic final void onToolbarNavigationIconChanged(android.graphics.drawable.Drawable icon,
android.view.View.OnClickListener listener)
Model.ListeneronToolbarNavigationIconChanged in interface Model.Listenericon - 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 notifiedpublic final void onToolbarMenuInflated(int resourceId,
Toolbar.OnMenuItemClickListener listener)
Model.ListeneronToolbarMenuInflated in interface Model.ListenerresourceId - 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 notifiedpublic final void onEmptyViewChanged(android.view.View view,
long animationDuration)
Model.ListeneronEmptyViewChanged in interface Model.Listenerview - 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