public class TabletTabRecyclerAdapter extends AbstractTabRecyclerAdapter
TabSwitcher
, when using the tablet layout.Constructor and Description |
---|
TabletTabRecyclerAdapter(TabSwitcher tabSwitcher,
TabSwitcherModel model,
TabSwitcherStyle style)
Creates a new view recycler adapter, which allows to inflate the views, which are used to
visualize the tabs of a
TabSwitcher . |
Modifier and Type | Method and Description |
---|---|
protected Layout |
getLayout()
The method, which is invoked on implementing subclasses in order to retrieve the layout,
which is used by the tab switcher.
|
int |
getViewType(AbstractItem 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.
|
protected AbstractTabViewHolder |
onCreateTabViewHolder()
The method, which is invoked on implementing subclasses in order to create the view holder,
which should be associated with an inflated view.
|
protected android.view.View |
onInflateTabView(android.view.LayoutInflater inflater,
android.view.ViewGroup parent,
AbstractTabViewHolder viewHolder)
The method, which is invoked on implementing subclasses in order to inflate the view, which
is used to visualize tabs.
|
android.view.View |
onInflateView(android.view.LayoutInflater inflater,
android.view.ViewGroup parent,
AbstractItem item,
int viewType,
java.lang.Integer... params) |
void |
onRemoveView(android.view.View view,
AbstractItem item) |
protected void |
onShowTabView(android.view.View view,
TabItem tabItem,
java.lang.Integer... params)
The method, which is invoked on implementing subclasses in order to adapt the appearance of a
view, which is used to visualize a tab.
|
void |
onShowView(android.content.Context context,
android.view.View view,
AbstractItem item,
boolean inflated,
java.lang.Integer... params) |
void |
onTabBackgroundColorChanged(android.content.res.ColorStateList colorStateList)
The method, which is invoked, when the background color of a tab has been changed.
|
getModel, getStyle, getTabItem, getTabSwitcher, getViewRecyclerOrThrowException, onAdaptBackgroundColor, onAddTabButtonVisibilityChanged, onAllTabsAdded, onAllTabsRemoved, onApplyPaddingToTabsChanged, onBackgroundColorChanged, onCloseableChanged, onCloseButtonIconChanged, onContentBackgroundColorChanged, onDecoratorChanged, onEmptyViewChanged, onIconChanged, onLogLevelChanged, onPaddingChanged, onProgressBarColorChanged, onProgressBarVisibilityChanged, onSelectionChanged, onSwitcherHidden, onSwitcherShown, onTabAdded, onTabCloseButtonIconChanged, onTabContentBackgroundColorChanged, onTabIconChanged, onTabProgressBarColorChanged, onTabRemoved, onTabTitleColorChanged, onTitleChanged, onTitleTextColorChanged, onToolbarMenuInflated, onToolbarNavigationIconChanged, onToolbarTitleChanged, onToolbarVisibilityChanged, setViewRecycler
public TabletTabRecyclerAdapter(@NonNull TabSwitcher tabSwitcher, @NonNull TabSwitcherModel model, @NonNull TabSwitcherStyle style)
TabSwitcher
.tabSwitcher
- The tab switcher as an instance of the class TabSwitcher
. The tab switcher
may not be nullmodel
- The model, which belongs to the tab switcher, as an instance of the class TabSwitcherModel
. The model 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 nullpublic final void onTabBackgroundColorChanged(@Nullable android.content.res.ColorStateList colorStateList)
Model.Listener
onTabBackgroundColorChanged
in interface Model.Listener
onTabBackgroundColorChanged
in class AbstractTabRecyclerAdapter
colorStateList
- 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 onAddTabButtonColorChanged(@Nullable android.content.res.ColorStateList colorStateList)
Model.Listener
onAddTabButtonColorChanged
in interface Model.Listener
onAddTabButtonColorChanged
in class AbstractTabRecyclerAdapter
colorStateList
- The color, which has been set, as an instance of the class ColorStateList
or null, if the default color should be usedpublic final int getViewTypeCount()
getViewTypeCount
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<AbstractItem,java.lang.Integer>
public final int getViewType(@NonNull AbstractItem item)
getViewType
in class AbstractTabRecyclerAdapter
@NonNull public final android.view.View onInflateView(@NonNull android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup parent, @NonNull AbstractItem item, int viewType, @NonNull java.lang.Integer... params)
onInflateView
in class AbstractTabRecyclerAdapter
public final void onShowView(@NonNull android.content.Context context, @NonNull android.view.View view, @NonNull AbstractItem item, boolean inflated, @NonNull java.lang.Integer... params)
onShowView
in class AbstractTabRecyclerAdapter
@CallSuper public final void onRemoveView(@NonNull android.view.View view, @NonNull AbstractItem item)
onRemoveView
in class AbstractTabRecyclerAdapter
@NonNull protected final android.view.View onInflateTabView(@NonNull android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup parent, @NonNull AbstractTabViewHolder viewHolder)
AbstractTabRecyclerAdapter
onInflateTabView
in class AbstractTabRecyclerAdapter
inflater
- The layout inflater, which should be used, as an instance of the class LayoutInflater
. The layout inflater may not be nullparent
- The parent of the view, which should be inflated, as an instance of the class ViewGroup
or null, if no parent is availableviewHolder
- The view holder, which should hold references to the child views of the view, which
should be inflated, as an instance of the class AbstractTabViewHolder
. The
view holder may not be nullView
. The view
may not be nullprotected final void onShowTabView(@NonNull android.view.View view, @NonNull TabItem tabItem, @NonNull java.lang.Integer... params)
AbstractTabRecyclerAdapter
onShowTabView
in class AbstractTabRecyclerAdapter
view
- The view, which is used to visualize the tab, as an instance of the class View
. The view may not be nulltabItem
- The tab item, which corresponds to the tab, which is visualized by the given view, as
an instance of the class TabItem
. The tab item may not be nullparams
- An array, which may contain optional parameters, as an array of the generic type
ParamType or an empty array, if no optional parameters are available@NonNull protected final AbstractTabViewHolder onCreateTabViewHolder()
AbstractTabRecyclerAdapter
onCreateTabViewHolder
in class AbstractTabRecyclerAdapter
AbstractTabViewHolder
. The view holder may not be null@NonNull protected final Layout getLayout()
AbstractTabRecyclerAdapter
getLayout
in class AbstractTabRecyclerAdapter
Layout
.
The layout may not be null