public abstract class AbstractTabSwitcherLayout extends java.lang.Object implements TabSwitcherLayout, android.view.ViewTreeObserver.OnGlobalLayoutListener, Model.Listener, TouchEventDispatcher.Callback, AbstractDragTabsEventHandler.Callback, SwipeGestureEventHandler.Callback, PullDownGestureEventHandler.Callback
TabSwitcher
.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractTabSwitcherLayout.AnimationListenerWrapper
A animation listener, which increases the number of running animations, when the observed
animation is started, and decreases the number of accordingly, when the animation is
finished.
|
static interface |
AbstractTabSwitcherLayout.Callback
Defines the interface, a class, which should be notified about the events of a tab switcher
layout, must implement.
|
protected class |
AbstractTabSwitcherLayout.InitialItemIterator
An iterator, which allows to iterate the items, which correspond to the child views of a
TabSwitcher . |
protected class |
AbstractTabSwitcherLayout.InitialItemIteratorBuilder
A builder, which allows to configure and create instances of the class
AbstractTabSwitcherLayout.InitialItemIterator . |
static class |
AbstractTabSwitcherLayout.LayoutListenerWrapper
A layout listener, which unregisters itself from the observed view, when invoked.
|
Constructor and Description |
---|
AbstractTabSwitcherLayout(TabSwitcher tabSwitcher,
TabSwitcherModel model,
Arithmetics arithmetics,
TabSwitcherStyle style,
TouchEventDispatcher touchEventDispatcher)
Creates a new layout, which implements the functionality of a
TabSwitcher . |
Modifier and Type | Method and Description |
---|---|
protected float |
calculateAttachedPosition(int count)
Calculates and returns the position on the dragging axis, where the distance between an item
and its predecessor should have reached the maximum.
|
protected float |
calculateMaxEndPosition(int index)
The method, which is invoked on implementing subclasses in order to retrieve the maximum
position of a specific item, when dragging towards the end.
|
protected float |
calculateMinStartPosition(int index)
The method, which is invoked on implementing subclasses in order to retrieve the minimum
position of a specific item, when dragging towards the start.
|
protected abstract android.support.v4.util.Pair<java.lang.Float,State> |
calculatePositionAndStateWhenStackedAtEnd(int index)
The method, which is invoked on implementing subclasses in order to retrieve the position and
state of a specific item, when stacked at the end.
|
protected android.support.v4.util.Pair<java.lang.Float,State> |
calculatePositionAndStateWhenStackedAtStart(int count,
int index,
AbstractItem predecessor)
Calculates and returns the position and state of a specific item, when stacked at the start.
|
protected abstract android.support.v4.util.Pair<java.lang.Float,State> |
calculatePositionAndStateWhenStackedAtStart(int count,
int index,
State predecessorState)
The method, which is invoked on implementing subclasses in order to retrieve the position and
state of a specific item, when stacked at the start.
|
protected abstract float |
calculatePredecessorPosition(AbstractItem item,
AbstractItem successor)
Calculates the position of an item in relation to the position of its successor.
|
protected abstract float |
calculateSuccessorPosition(AbstractItem item,
AbstractItem predecessor)
Calculates the position of an item in relation to the position of its predecessor.
|
protected android.support.v4.util.Pair<java.lang.Float,State> |
clipPosition(int index,
float position,
AbstractItem predecessor)
Clips the position of a specific item.
|
protected android.support.v4.util.Pair<java.lang.Float,State> |
clipPosition(int index,
float position,
State predecessorState)
Clips the position of a specific item.
|
android.support.v4.util.Pair<java.lang.Integer,java.lang.Float> |
detachLayout(boolean tabsOnly)
Detaches the layout.
|
protected Arithmetics |
getArithmetics()
Returns the arithmetics, which are used by the layout.
|
protected abstract de.mrapp.android.util.view.AbstractViewRecycler<Tab,java.lang.Void> |
getContentViewRecycler()
The method, which is invoked on implementing subclasses in order to retrieve the view
recycler, which allows to recycle the views, which are associated with tabs.
|
protected android.content.Context |
getContext()
Returns the context, which is used by the layout.
|
abstract AbstractDragTabsEventHandler<?> |
getDragHandler()
The method, which is invoked on implementing subclasses in order to retrieve the drag
handler, which is used by the layout.
|
protected int |
getFirstVisibleIndex()
Returns the index of the first visible tab.
|
protected int |
getItemCount()
Returns the number of child views, which are contained by the tab switcher.
|
protected de.mrapp.android.util.logging.Logger |
getLogger()
Returns the logger, which is used for logging.
|
protected TabSwitcherModel |
getModel()
Returns the model of the tab switcher, the layout belongs to.
|
protected abstract int |
getStackedTabCount()
The method, which is invoked on implementing subclasses in order to retrieve the number of
tabs, which are contained by a stack.
|
protected int |
getStackedTabSpacing()
Returns the space between tabs, which are part of a stack.
|
protected TabSwitcherStyle |
getStyle()
Returns the style, which allows to retrieve style attributes of the tab switcher.
|
protected abstract AbstractTabRecyclerAdapter |
getTabRecyclerAdapter()
The method, which is invoked on implementing subclasses in order to retrieve the adapter of
the view recycler, which allows to inflate the views, which are used to visualize the tabs.
|
protected TabSwitcher |
getTabSwitcher()
Returns the tab switcher, the layout belongs to.
|
protected abstract de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,java.lang.Integer> |
getTabViewRecycler()
The method, which is invoked on implementing subclasses in order to retrieve the view
recycler, which allows to inflate the views, which are used to visualize the tabs.
|
android.view.Menu |
getToolbarMenu()
Returns the menu of the toolbar, which is shown, when the tab switcher is shown.
|
protected abstract void |
inflateAndUpdateView(AbstractItem item,
boolean dragging,
android.view.ViewTreeObserver.OnGlobalLayoutListener listener)
The method, which is invoked on implementing subclasses in order to inflate and update the
view, which is used to visualize a specific item.
|
void |
inflateLayout(boolean tabsOnly)
Inflates the layout.
|
protected void |
inflateOrRemoveView(AbstractItem item,
boolean dragging)
Inflates or removes the view, which is used to visualize a specific item, depending on the
item's current state.
|
protected void |
inflateView(AbstractItem item,
android.view.ViewTreeObserver.OnGlobalLayoutListener listener,
java.lang.Integer... params)
Inflates the view, which is used to visualize a specific item.
|
boolean |
isAnimationRunning()
Returns, whether an animation is currently running, or not.
|
protected boolean |
isOvershootingAtEnd(AbstractDragTabsEventHandler.DragState dragState,
AbstractItemIterator iterator)
The method, which is invoked on implementing subclasses in order to retrieve, whether the
items are overshooting at the end.
|
protected boolean |
isOvershootingAtStart()
The method, which is invoked on implementing subclasses in order to retrieve, whether the
items are overshooting at the start.
|
protected boolean |
isStackedAtStart(int index)
Returns, whether a hidden tab at a specific index, is part of the stack, which is located at
the start, or not.
|
void |
onAddedEventHandler(TouchEventDispatcher dispatcher,
AbstractTouchEventHandler eventHandler)
The method, which is invoked, when an event handler has been added.
|
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 |
onCancelFling()
The method, which is invoked, when a fling has been cancelled.
|
void |
onClick(AbstractItem item)
The method, which is invoked, when a view has been clicked.
|
protected de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void> |
onCreateContentRecyclerAdapter()
The method, which is invoked on implementing subclasses in order to create the view recycler
adapter, which allows to inflate the views, which are associated with tabs.
|
void |
onDecoratorChanged(TabSwitcherDecorator decorator)
The method, which is invoked, when the decorator has been changed.
|
protected abstract android.support.v4.util.Pair<java.lang.Integer,java.lang.Float> |
onDetachLayout(boolean tabsOnly)
The method, which is invoked on implementing subclasses in order to detach the layout.
|
AbstractDragTabsEventHandler.DragState |
onDrag(AbstractDragTabsEventHandler.DragState dragState,
float dragDistance)
The method, which is invoked in order to calculate the positions of all tabs, depending
on the current drag distance.
|
void |
onFling(float distance,
long duration)
The method, which is invoked, when a fling has been triggered.
|
protected abstract void |
onInflateLayout(android.view.LayoutInflater inflater,
boolean tabsOnly)
The method, which is invoked on implementing subclasses in order to inflate the layout.
|
void |
onLogLevelChanged(de.mrapp.android.util.logging.LogLevel logLevel)
The method, which is invoked, when the log level has been changed.
|
void |
onPressEnded(AbstractItem item)
The method, which is invoked, when pressing a view has been ended.
|
void |
onPressStarted(AbstractItem item)
The method, which is invoked, when pressing a view has been started.
|
void |
onPulledDown()
The method, which is notified, when the currently selected tab has been pulled down.
|
void |
onRemovedEventHandler(TouchEventDispatcher dispatcher,
AbstractTouchEventHandler eventHandler)
The method, which is invoked, when an event handler has been removed.
|
void |
onRevertEndOvershoot()
The method, which is invoked, when an overshoot at the end should be reverted.
|
void |
onRevertStartOvershoot()
The method, which is invoked, when an overshoot at the start should be reverted.
|
void |
onSwipe(TabItem tabItem,
float distance)
The method, which is invoked, when a tab is swiped.
|
void |
onSwipeEnded(TabItem tabItem,
boolean remove,
float velocity)
The method, which is invoked, when swiping a tab ended.
|
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 |
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 |
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.
|
protected void |
secondLayoutPass(AbstractItemIterator.AbstractBuilder builder)
The method, which is called when dragging after the positions and states of all tabs have
been calculated.
|
void |
setCallback(AbstractTabSwitcherLayout.Callback callback)
Sets the callback, which should be notified about the layout's events.
|
protected void |
setFirstVisibleIndex(int firstVisibleIndex)
Sets the index of the first visible tab.
|
protected void |
updateView(AbstractItem item,
boolean dragging)
Updates the view, which is used to visualize a specific item.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTabContainer, getToolbars
onGlobalLayout
onAllTabsAdded, onAllTabsRemoved, onApplyPaddingToTabsChanged, onEmptyViewChanged, onPaddingChanged, onSelectionChanged, onTabAdded, onTabRemoved
onSwitchingBetweenTabs, onSwitchingBetweenTabsEnded
public AbstractTabSwitcherLayout(@NonNull TabSwitcher tabSwitcher, @NonNull TabSwitcherModel model, @NonNull Arithmetics arithmetics, @NonNull TabSwitcherStyle style, @NonNull TouchEventDispatcher touchEventDispatcher)
TabSwitcher
.tabSwitcher
- The tab switcher, the layout belongs to, as an instance of the class TabSwitcher
. The tab switcher may not be nullmodel
- The model of the tab switcher, the layout belongs to, as an instance of the class
TabSwitcherModel
. The model may not be nullarithmetics
- The arithmetics, which should be used by the layout, as an instance of the type
Arithmetics
. The arithmetics 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 nulltouchEventDispatcher
- The dispatcher, which is used to dispatch touch events to event handlers, as an
instance of the class TouchEventDispatcher
. The dispatcher may not be null@NonNull protected final TabSwitcher getTabSwitcher()
TabSwitcher
. The tab switcher may not be null@NonNull protected final TabSwitcherModel getModel()
TabSwitcherModel
. The model may not be null@NonNull protected final Arithmetics getArithmetics()
Arithmetics
. The arithmetics may not be null@NonNull protected final TabSwitcherStyle getStyle()
TabSwitcherStyle
. The style may not be nullprotected final int getStackedTabSpacing()
Integer
value@NonNull protected final de.mrapp.android.util.logging.Logger getLogger()
@NonNull protected final android.content.Context getContext()
Context
. The context may not be nullprotected final int getFirstVisibleIndex()
Integer
value or -1, if no tabs is
visibleprotected final void setFirstVisibleIndex(int firstVisibleIndex)
firstVisibleIndex
- The index, which should be set, as an Integer
value or -1, if no tab is
visibleprotected final int getItemCount()
Integer
valueprotected final boolean isStackedAtStart(int index)
index
- The index of the hidden tab, as an Integer
value@NonNull protected final android.support.v4.util.Pair<java.lang.Float,State> clipPosition(int index, float position, @Nullable AbstractItem predecessor)
index
- The index of the item, whose position should be clipped, as an Integer
valueposition
- The position, which should be clipped, in pixels as a Float
valuepredecessor
- The predecessor of the given item as an instance of the class AbstractItem
or
null, if the item does not have a predecessorprotected final android.support.v4.util.Pair<java.lang.Float,State> clipPosition(int index, float position, @Nullable State predecessorState)
index
- The index of the item, whose position should be clipped, as an Integer
valueposition
- The position, which should be clipped, in pixels as a Float
valuepredecessorState
- The state of the predecessor of the given item as a value of the enum State
or null, if the item does not have a predecessor@NonNull protected final android.support.v4.util.Pair<java.lang.Float,State> calculatePositionAndStateWhenStackedAtStart(int count, int index, @Nullable AbstractItem predecessor)
count
- The total number of items, which are currently contained by the tab switcher, as an
Integer
valueindex
- The index of the item, whose position and state should be returned, as an Integer
valuepredecessor
- The predecessor of the given item as an instance of the class AbstractItem
or
null, if the item does not have a predecessorprotected final void inflateOrRemoveView(@NonNull AbstractItem item, boolean dragging)
item
- The item, whose view should be inflated or removed, as an instance of the class
AbstractItem
. The item may not be nulldragging
- True, if the item is currently being dragged, false otherwiseprotected final void inflateView(@NonNull AbstractItem item, @Nullable android.view.ViewTreeObserver.OnGlobalLayoutListener listener, @NonNull java.lang.Integer... params)
item
- The item, whose view should be inflated, as an instance of the class AbstractItem
. The item may not be nulllistener
- The layout listener, which should be notified, when the view has been inflated, as an
instance of the type ViewTreeObserver.OnGlobalLayoutListener
or null, if no listener should be
notifiedparams
- An array, which contains optional parameters, which should be passed to the view
recycler, which is used to inflate the view, as an Integer
array or null, if
no optional parameters should be used@CallSuper protected void updateView(@NonNull AbstractItem item, boolean dragging)
item
- The item, whose view should be updated, as an instance of the class AbstractItem
. The item may not be nulldragging
- True, if the item is currently being dragged, false otherwiseprotected float calculateAttachedPosition(int count)
count
- The total number of items, which are contained by the tab switcher, as an Integer
valueFloat
value or -1,
if no attached position is usedpublic abstract AbstractDragTabsEventHandler<?> getDragHandler()
AbstractDragTabsEventHandler
or null, if the drag handler has not been initialized yetprotected abstract void onInflateLayout(@NonNull android.view.LayoutInflater inflater, boolean tabsOnly)
inflater
- The layout inflater, which should be used, as an instance of the class LayoutInflater
. The layout inflater may not be nulltabsOnly
- True, if only the tabs should be inflated, false otherwise@Nullable protected abstract android.support.v4.util.Pair<java.lang.Integer,java.lang.Float> onDetachLayout(boolean tabsOnly)
tabsOnly
- True, if only the tabs should be detached, false otherwiseprotected abstract de.mrapp.android.util.view.AbstractViewRecycler<Tab,java.lang.Void> getContentViewRecycler()
protected abstract de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,java.lang.Integer> getTabViewRecycler()
protected abstract AbstractTabRecyclerAdapter getTabRecyclerAdapter()
AbstractTabRecyclerAdapter
or
null, if the view recycler has not been initialized yetprotected abstract void inflateAndUpdateView(@NonNull AbstractItem item, boolean dragging, @Nullable android.view.ViewTreeObserver.OnGlobalLayoutListener listener)
item
- The item, whose view should be inflated, as an instance of the class AbstractItem
. The item may not be nulldragging
- True, if the view is currently being dragged, false otherwiselistener
- The layout listener, which should be notified, when the view has been inflated, as an
instance of the type ViewTreeObserver.OnGlobalLayoutListener
or null, if no listener should be
notifiedprotected abstract int getStackedTabCount()
Integer
value@NonNull protected abstract android.support.v4.util.Pair<java.lang.Float,State> calculatePositionAndStateWhenStackedAtStart(int count, int index, @Nullable State predecessorState)
count
- The total number of items, which are currently contained by the tab switcher, as an
Integer
valueindex
- The index of the item, whose position and state should be returned, as an Integer
valuepredecessorState
- The state of the predecessor of the given item as a value of the enum State
or null, if the item does not have a predecessor@NonNull protected abstract android.support.v4.util.Pair<java.lang.Float,State> calculatePositionAndStateWhenStackedAtEnd(int index)
index
- The index of the item, whose position and state should be returned, as an Integer
valueprotected abstract float calculateSuccessorPosition(@NonNull AbstractItem item, @NonNull AbstractItem predecessor)
item
- The item, whose position should be calculated, as an instance of the class AbstractItem
. The item may not be nullpredecessor
- The predecessor as an instance of the class AbstractItem
. The predecessor may
not be nullFloat
valueprotected abstract float calculatePredecessorPosition(@NonNull AbstractItem item, @NonNull AbstractItem successor)
item
- The item, whose position should be calculated, as an instance of the class AbstractItem
. The item may not be nullsuccessor
- The successor as an instance of the class AbstractItem
. The successor may not
be nullFloat
valueprotected float calculateMinStartPosition(int index)
index
- The index of the item, whose position should be calculated, as an Integer
valueFloat
value or -1, if no
minimum position is availableprotected float calculateMaxEndPosition(int index)
index
- The index of the item, whose position should be calculated, as an Integer
valueFloat
value or -1, if no
maximum position is availableprotected boolean isOvershootingAtStart()
protected boolean isOvershootingAtEnd(@NonNull AbstractDragTabsEventHandler.DragState dragState, @NonNull AbstractItemIterator iterator)
dragState
- The current drag state as an instance of the enum AbstractDragTabsEventHandler.DragState
. The drag state
may not be nulliterator
- An iterator, which allows to iterate the items, which are contained by the tab
switcher, as an instance of the class AbstractItemIterator
. The iterator may
not be nullprotected void secondLayoutPass(@NonNull AbstractItemIterator.AbstractBuilder builder)
builder
- The builder, which allows to create the iterator, which should be used to iterate the
tabs, as an instance of the class AbstractItemIterator.AbstractBuilder
. The
builder may not be null@NonNull protected de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void> onCreateContentRecyclerAdapter()
public final void inflateLayout(boolean tabsOnly)
tabsOnly
- True, if only the tabs should be inflated, false otherwise@Nullable public final android.support.v4.util.Pair<java.lang.Integer,java.lang.Float> detachLayout(boolean tabsOnly)
tabsOnly
- True, if only the tabs should be detached, false otherwisepublic final void setCallback(@Nullable AbstractTabSwitcherLayout.Callback callback)
callback
- The callback, which should be set, as an instance of the type AbstractTabSwitcherLayout.Callback
or
null, if no callback should be notifiedpublic final boolean isAnimationRunning()
TabSwitcherLayout
isAnimationRunning
in interface TabSwitcherLayout
@Nullable public final android.view.Menu getToolbarMenu()
TabSwitcherLayout
getToolbarMenu
in interface TabSwitcherLayout
Menu
or null, if the view
has not been laid out yetpublic final void onLogLevelChanged(@NonNull de.mrapp.android.util.logging.LogLevel logLevel)
Model.Listener
onLogLevelChanged
in interface Model.Listener
logLevel
- The log level, which has been set, as a value of the enum LogLevel. The log level
may not be null@CallSuper public void onDecoratorChanged(@NonNull TabSwitcherDecorator decorator)
Model.Listener
onDecoratorChanged
in interface Model.Listener
decorator
- The decorator, which has been set, as an instance of the class TabSwitcherDecorator
. The decorator may not be nullpublic void onAddTabButtonVisibilityChanged(boolean visible)
Model.Listener
onAddTabButtonVisibilityChanged
in interface Model.Listener
visible
- True, if the button, which allows to add a new tab, should be shown, false
otherwisepublic final void onAddTabButtonColorChanged(@Nullable android.content.res.ColorStateList colorStateList)
Model.Listener
onAddTabButtonColorChanged
in interface Model.Listener
colorStateList
- 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.Listener
onToolbarVisibilityChanged
in interface Model.Listener
visible
- True, if the toolbars should be shown, when the tab switcher is shown, false
otherwisepublic final void onToolbarTitleChanged(@Nullable java.lang.CharSequence title)
Model.Listener
onToolbarTitleChanged
in interface Model.Listener
title
- The title, which has been set, as an instance of the type CharSequence
or
null, if no title is setpublic final void onToolbarNavigationIconChanged(@Nullable android.graphics.drawable.Drawable icon, @Nullable android.view.View.OnClickListener listener)
Model.Listener
onToolbarNavigationIconChanged
in interface Model.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 notifiedpublic final void onToolbarMenuInflated(@MenuRes int resourceId, @Nullable android.support.v7.widget.Toolbar.OnMenuItemClickListener listener)
Model.Listener
onToolbarMenuInflated
in interface Model.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 notifiedpublic final void onTabIconChanged(@Nullable android.graphics.drawable.Drawable icon)
Model.Listener
onTabIconChanged
in interface Model.Listener
icon
- The icon, which has been set, as an instance of the class Drawable
or
null, if no icon is setpublic void onTabBackgroundColorChanged(@Nullable android.content.res.ColorStateList colorStateList)
Model.Listener
onTabBackgroundColorChanged
in interface Model.Listener
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 void onTabContentBackgroundColorChanged(int color)
Model.Listener
onTabContentBackgroundColorChanged
in interface Model.Listener
color
- The color, which has been set, as an Integer
value or -1, if the default
color should be usedpublic final void onTabTitleColorChanged(@Nullable android.content.res.ColorStateList colorStateList)
Model.Listener
onTabTitleColorChanged
in interface Model.Listener
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 onTabCloseButtonIconChanged(@Nullable android.graphics.drawable.Drawable icon)
Model.Listener
onTabCloseButtonIconChanged
in interface Model.Listener
icon
- 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.Listener
onTabProgressBarColorChanged
in interface Model.Listener
color
- The color, which has been set, as an Integer
value or -1, if the default
color should be usedpublic void onSwitcherShown()
Model.Listener
onSwitcherShown
in interface Model.Listener
public void onSwitcherHidden()
Model.Listener
onSwitcherHidden
in interface Model.Listener
public final void onAddedEventHandler(@NonNull TouchEventDispatcher dispatcher, @NonNull AbstractTouchEventHandler eventHandler)
TouchEventDispatcher.Callback
onAddedEventHandler
in interface TouchEventDispatcher.Callback
dispatcher
- The dispatcher, the event handler has been added to, as an instance of the class
TouchEventDispatcher
. The dispatcher may not be nulleventHandler
- The event handler, which has been added, as an instance of the class AbstractTouchEventHandler
. The event handler may not be nullpublic final void onRemovedEventHandler(@NonNull TouchEventDispatcher dispatcher, @NonNull AbstractTouchEventHandler eventHandler)
TouchEventDispatcher.Callback
onRemovedEventHandler
in interface TouchEventDispatcher.Callback
dispatcher
- The dispatcher, the event handler has been removed from, as an instance of the
class TouchEventDispatcher
. The dispatcher may not be nulleventHandler
- The event handler, which has been removed, as an instance of the class AbstractTouchEventHandler
. The event handler may not be null@Nullable public final AbstractDragTabsEventHandler.DragState onDrag(@NonNull AbstractDragTabsEventHandler.DragState dragState, float dragDistance)
AbstractDragTabsEventHandler.Callback
onDrag
in interface AbstractDragTabsEventHandler.Callback
dragState
- The current drag state as a value of the enum AbstractDragTabsEventHandler.DragState
. The drag state
must either be AbstractDragTabsEventHandler.DragState.DRAG_TO_END
or AbstractDragTabsEventHandler.DragState.DRAG_TO_START
dragDistance
- The current drag distance in pixels as a Float
valueAbstractDragTabsEventHandler.DragState.OVERSHOOT_START
or AbstractDragTabsEventHandler.DragState.OVERSHOOT_END
, null otherwisepublic final void onPressStarted(@NonNull AbstractItem item)
AbstractDragTabsEventHandler.Callback
onPressStarted
in interface AbstractDragTabsEventHandler.Callback
item
- The item, which corresponds to the view, which has been pressed, as an instance
of the class AbstractItem
. The item may not be nullpublic final void onPressEnded(@NonNull AbstractItem item)
AbstractDragTabsEventHandler.Callback
onPressEnded
in interface AbstractDragTabsEventHandler.Callback
item
- Tge item, which corresponds to the view, which was previously pressed, as an
instance of the class AbstractItem
. The item may not be nullpublic final void onClick(@NonNull AbstractItem item)
AbstractDragTabsEventHandler.Callback
onClick
in interface AbstractDragTabsEventHandler.Callback
item
- The item, which corresponds to the view, which has been clicked, as an instance
of the class AbstractItem
. The item may not be nullpublic final void onFling(float distance, long duration)
AbstractDragTabsEventHandler.Callback
onFling
in interface AbstractDragTabsEventHandler.Callback
distance
- The distance of the fling in pixels as a Float
valueduration
- The duration of the fling in milliseconds as a Long
valuepublic final void onCancelFling()
AbstractDragTabsEventHandler.Callback
onCancelFling
in interface AbstractDragTabsEventHandler.Callback
public void onRevertStartOvershoot()
AbstractDragTabsEventHandler.Callback
onRevertStartOvershoot
in interface AbstractDragTabsEventHandler.Callback
public void onRevertEndOvershoot()
AbstractDragTabsEventHandler.Callback
onRevertEndOvershoot
in interface AbstractDragTabsEventHandler.Callback
public void onSwipe(@NonNull TabItem tabItem, float distance)
AbstractDragTabsEventHandler.Callback
onSwipe
in interface AbstractDragTabsEventHandler.Callback
tabItem
- The tab item, which corresponds to the swiped tab, as an instance of the class
TabItem
. The tab item may not be nulldistance
- The distance, the tab is swiped by, in pixels as a Float
valuepublic void onSwipeEnded(@NonNull TabItem tabItem, boolean remove, float velocity)
AbstractDragTabsEventHandler.Callback
onSwipeEnded
in interface AbstractDragTabsEventHandler.Callback
tabItem
- The tab item, which corresponds to the swiped tab, as an instance of the class
TabItem
. The tab item may not be nullremove
- True, if the tab should be removed, false otherwisevelocity
- The velocity of the swipe gesture in pixels per second as a Float
valuepublic void onPulledDown()
PullDownGestureEventHandler.Callback
onPulledDown
in interface PullDownGestureEventHandler.Callback