public class PhoneTabRecyclerAdapter extends AbstractTabRecyclerAdapter implements de.mrapp.android.util.multithreading.AbstractDataBinder.Listener<android.graphics.Bitmap,Tab,android.widget.ImageView,TabItem>
TabSwitcher
, when using the smartphone layout.Constructor and Description |
---|
PhoneTabRecyclerAdapter(TabSwitcher tabSwitcher,
TabSwitcherModel model,
TabSwitcherStyle style,
de.mrapp.android.util.view.ViewRecycler<Tab,java.lang.Void> tabViewRecycler)
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 |
---|---|
void |
clearCachedPreviews()
Removes all previously rendered previews from the cache.
|
protected Layout |
getLayout()
The method, which is invoked on implementing subclasses in order to retrieve the layout,
which is used by the tab switcher.
|
protected void |
onAdaptBackgroundColor(int color,
TabItem tabItem)
The method, which is invoked on implementing subclasses, when the background color of a tab
has been changed.
|
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 |
onCanceled(de.mrapp.android.util.multithreading.AbstractDataBinder<android.graphics.Bitmap,Tab,android.widget.ImageView,TabItem> dataBinder) |
void |
onContentBackgroundColorChanged(Tab tab)
The method, which is invoked, when the background color of the tab's content 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.
|
void |
onFinished(de.mrapp.android.util.multithreading.AbstractDataBinder<android.graphics.Bitmap,Tab,android.widget.ImageView,TabItem> dataBinder,
Tab key,
android.graphics.Bitmap data,
android.widget.ImageView view,
TabItem... params) |
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.
|
boolean |
onLoadData(de.mrapp.android.util.multithreading.AbstractDataBinder<android.graphics.Bitmap,Tab,android.widget.ImageView,TabItem> dataBinder,
Tab key,
TabItem... params) |
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 |
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 |
onTabContentBackgroundColorChanged(int color)
The method, which is invoked, when the background color of a tab's content has been
changed.
|
getModel, getStyle, getTabItem, getTabSwitcher, getViewRecyclerOrThrowException, getViewType, onAddTabButtonColorChanged, onAddTabButtonVisibilityChanged, onAllTabsAdded, onAllTabsRemoved, onBackgroundColorChanged, onCloseableChanged, onCloseButtonIconChanged, onDecoratorChanged, onEmptyViewChanged, onIconChanged, onInflateView, onProgressBarColorChanged, onProgressBarVisibilityChanged, onSelectionChanged, onShowView, onSwitcherHidden, onSwitcherShown, onTabAdded, onTabBackgroundColorChanged, onTabCloseButtonIconChanged, onTabIconChanged, onTabProgressBarColorChanged, onTabRemoved, onTabTitleColorChanged, onTitleChanged, onTitleTextColorChanged, onToolbarMenuInflated, onToolbarNavigationIconChanged, onToolbarTitleChanged, onToolbarVisibilityChanged, setViewRecycler
public PhoneTabRecyclerAdapter(@NonNull TabSwitcher tabSwitcher, @NonNull TabSwitcherModel model, @NonNull TabSwitcherStyle style, @NonNull de.mrapp.android.util.view.ViewRecycler<Tab,java.lang.Void> tabViewRecycler)
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 nulltabViewRecycler
- The view recycler, which allows to inflate the views, which are associated with tabs,
as an instance of the class ViewRecycler. The view recycler may not be nullpublic final void clearCachedPreviews()
protected final void onAdaptBackgroundColor(int color, @NonNull TabItem tabItem)
AbstractTabRecyclerAdapter
onAdaptBackgroundColor
in class AbstractTabRecyclerAdapter
color
- The color, which has been set, as an Integer
valuetabItem
- The tab item, which corresponds to the tab, whose background color has been changed,
as an instance of the class TabItem
. The tab item may not be null@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 nullpublic final void onRemoveView(@NonNull android.view.View view, @NonNull AbstractItem item)
onRemoveView
in class AbstractTabRecyclerAdapter
public final void onLogLevelChanged(@NonNull de.mrapp.android.util.logging.LogLevel logLevel)
Model.Listener
onLogLevelChanged
in interface Model.Listener
onLogLevelChanged
in class AbstractTabRecyclerAdapter
logLevel
- The log level, which has been set, as a value of the enum LogLevel. The log level
may not be nullpublic final void onPaddingChanged(int left, int top, int right, int bottom)
Model.Listener
onPaddingChanged
in interface Model.Listener
onPaddingChanged
in class AbstractTabRecyclerAdapter
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
valuepublic final void onApplyPaddingToTabsChanged(boolean applyPaddingToTabs)
Model.Listener
onApplyPaddingToTabsChanged
in interface Model.Listener
onApplyPaddingToTabsChanged
in class AbstractTabRecyclerAdapter
applyPaddingToTabs
- True, if the padding of the tab switcher is applied to the content of its tabs,
false otherwisepublic final void onTabContentBackgroundColorChanged(int color)
Model.Listener
onTabContentBackgroundColorChanged
in interface Model.Listener
onTabContentBackgroundColorChanged
in class AbstractTabRecyclerAdapter
color
- The color, which has been set, as an Integer
value or -1, if the default
color should be usedpublic final void onContentBackgroundColorChanged(@NonNull Tab tab)
Tab.Callback
onContentBackgroundColorChanged
in interface Tab.Callback
onContentBackgroundColorChanged
in class AbstractTabRecyclerAdapter
tab
- The observed tab as an instance of the class Tab
. The tab may not be
nullpublic final boolean onLoadData(@NonNull de.mrapp.android.util.multithreading.AbstractDataBinder<android.graphics.Bitmap,Tab,android.widget.ImageView,TabItem> dataBinder, @NonNull Tab key, @NonNull TabItem... params)
public final void onFinished(@NonNull de.mrapp.android.util.multithreading.AbstractDataBinder<android.graphics.Bitmap,Tab,android.widget.ImageView,TabItem> dataBinder, @NonNull Tab key, @Nullable android.graphics.Bitmap data, @NonNull android.widget.ImageView view, @NonNull TabItem... params)