public abstract class TabSwitcherDecorator
extends de.mrapp.android.util.view.AbstractViewHolderAdapter
TabSwitcher
.Constructor and Description |
---|
TabSwitcherDecorator() |
Modifier and Type | Method and Description |
---|---|
void |
applyDecorator(android.content.Context context,
TabSwitcher tabSwitcher,
android.view.View view,
Tab tab,
int index,
android.os.Bundle savedInstanceState)
The method, which is invoked by a
TabSwitcher to apply the decorator. |
int |
getViewType(Tab tab,
int index)
Returns the view type, which corresponds to a specific tab.
|
int |
getViewTypeCount()
Returns the number of view types, which are used by the decorator.
|
android.view.View |
inflateView(android.view.LayoutInflater inflater,
android.view.ViewGroup parent,
Tab tab,
int index)
The method, which is invoked by a
TabSwitcher to inflate the view, which should be
used to visualize a specific tab. |
abstract android.view.View |
onInflateView(android.view.LayoutInflater inflater,
android.view.ViewGroup parent,
int viewType)
The method which is invoked, when a view, which is used to visualize a tab, should be
inflated.
|
void |
onSaveInstanceState(android.view.View view,
Tab tab,
int index,
int viewType,
android.os.Bundle outState)
The method, which is invoked, when the view, which is used to visualize a tab, is removed.
|
abstract void |
onShowTab(android.content.Context context,
TabSwitcher tabSwitcher,
android.view.View view,
Tab tab,
int index,
int viewType,
android.os.Bundle savedInstanceState)
The method which is invoked, when the view, which is used to visualize a tab, should be
shown, respectively when it should be refreshed.
|
android.os.Bundle |
saveInstanceState(android.view.View view,
Tab tab,
int index)
The method, which is invoked by a
TabSwitcher to save the current state of a tab. |
@NonNull public abstract android.view.View onInflateView(@NonNull android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup parent, int viewType)
inflater
- The inflater, which should be used to inflate the view, as an instance of the class
LayoutInflater
. The inflater may not be nullparent
- The parent view of the view, which should be inflated, as an instance of the class
ViewGroup
or null, if no parent view is availableviewType
- The view type of the tab, which should be visualized, as an Integer
valueView
. The view
may not be nullpublic abstract void onShowTab(@NonNull android.content.Context context, @NonNull TabSwitcher tabSwitcher, @NonNull android.view.View view, @NonNull Tab tab, int index, int viewType, @Nullable android.os.Bundle savedInstanceState)
context
- The context, the tab switcher belongs to, as an instance of the class Context
. The context may not be nulltabSwitcher
- The tab switcher, whose tabs are visualized by the decorator, as an instance of the
type TabSwitcher
. The tab switcher may not be nullview
- The view, which is used to visualize the tab, as an instance of the class View
. The view may not be nulltab
- The tab, which should be visualized, as an instance of the class Tab
. The tab
may not be nullindex
- The index of the tab, which should be visualized, as an Integer
valueviewType
- The view type of the tab, which should be visualized, as an Integer
valuesavedInstanceState
- The bundle, which has previously been used to save the state of the view as an
instance of the class Bundle
or null, if no saved state is availablepublic void onSaveInstanceState(@NonNull android.view.View view, @NonNull Tab tab, int index, int viewType, @NonNull android.os.Bundle outState)
view
- The view, which is used to visualize the tab, as an instance of the class View
tab
- The tab, whose state should be saved, as an instance of the class Tab
. The
tab may not be nullindex
- The index of the tab, whose state should be saved, as an Integer
valueviewType
- The view type of the tab, whose state should be saved, as an Integer
valueoutState
- The bundle, the state of the tab should be saved to, as an instance of the class
Bundle
. The bundle may not be nullpublic int getViewType(@NonNull Tab tab, int index)
onInflateView
-method, a distinct view type must be
returned.tab
- The tab, whose view type should be returned, as an instance of the class Tab
.
The tab may not be nullindex
- The index of the tab, whose view type should be returned, as an Integer
valueInteger
valuepublic int getViewTypeCount()
Integer
value. The number of view types must correspond to the number of distinct values, which are
returned by the getViewType
-method@NonNull public final android.view.View inflateView(@NonNull android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup parent, @NonNull Tab tab, int index)
TabSwitcher
to inflate the view, which should be
used to visualize a specific tab.inflater
- The inflater, which should be used to inflate the view, as an instance of the class
LayoutInflater
. The inflater may not be nullparent
- The parent view of the view, which should be inflated, as an instance of the class
ViewGroup
or null, if no parent view is availabletab
- The tab, which should be visualized, as an instance of the class Tab
. The tab
may not be nullindex
- The index of the tab, which should be visualized, as an Integer
valueView
. The view
may not be nullpublic final void applyDecorator(@NonNull android.content.Context context, @NonNull TabSwitcher tabSwitcher, @NonNull android.view.View view, @NonNull Tab tab, int index, @Nullable android.os.Bundle savedInstanceState)
TabSwitcher
to apply the decorator. It initializes
the view holder pattern, which is provided by the decorator and then delegates the method
call to the decorator's custom implementation of the method onShowTab(...):void
.context
- The context, the tab switcher belongs to, as an instance of the class Context
. The context may not be nulltabSwitcher
- The tab switcher, whose tabs are visualized by the decorator, as an instance of the
class TabSwitcher
. The tab switcher may not be nullview
- The view, which is used to visualize the tab, as an instance of the class View
. The view may not be nulltab
- The tab, which should be visualized, as an instance of the class Tab
. The tab
may not be nullindex
- The index of the tab, which should be visualized, as an Integer
valuesavedInstanceState
- The bundle, which has previously been used to save the state of the view as an
instance of the class Bundle
or null, if no saved state is available@NonNull public final android.os.Bundle saveInstanceState(@NonNull android.view.View view, @NonNull Tab tab, int index)
TabSwitcher
to save the current state of a tab. It
initializes the view holder pattern, which is provided by the decorator and then delegates
the method call to the decorator's custom implementation of the method
onSaveInstanceState(...):void
.view
- The view, which is used to visualize the tab, as an instance of the class View
tab
- The tab, whose state should be saved, as an instance of the class Tab
. The
tab may not be nullindex
- The index of the tab, whose state should be saved, as an Integer
valueBundle
. The bundle may not be null