diff --git a/doc/javadoc/allclasses-frame.html b/doc/javadoc/allclasses-frame.html new file mode 100644 index 00000000..10a7d596 --- /dev/null +++ b/doc/javadoc/allclasses-frame.html @@ -0,0 +1,100 @@ + + + +
+ +Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final int |
+PRIMARY_TOOLBAR_INDEX |
+0 |
+
+
+public static final int |
+SECONDARY_TOOLBAR_INDEX |
+1 |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+protected static final int |
+MAX_PRIORITY |
+2147483647 |
+
+
+protected static final int |
+MIN_PRIORITY |
+-2147483648 |
+
public abstract class AbstractState +extends java.lang.Object +implements Restorable+
StatefulTabSwitcherDecorator
. The state stores the tab it corresponds to and implements the
+ interface Restorable
to be able to store and restore its state.Constructor and Description | +
---|
AbstractState(Tab tab)
+Creates a new state of a specific tab.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
Tab |
+getTab()
+Returns the tab, the state corresponds to.
+ |
+
void |
+restoreInstanceState(android.os.Bundle savedInstanceState)
+Restores a previously saved state.
+ |
+
void |
+saveInstanceState(android.os.Bundle outState)
+Saves the current state.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@NonNull +public Tab getTab()+
Tab
. The tab
+ may not be nullpublic void saveInstanceState(@NonNull + android.os.Bundle outState)+
Restorable
saveInstanceState
in interface Restorable
outState
- The bundle, which should be used to store the saved state, as an instance of the
+ class Bundle
. The bundle may not be nullpublic void restoreInstanceState(@Nullable + android.os.Bundle savedInstanceState)+
Restorable
restoreInstanceState
in interface Restorable
savedInstanceState
- The saved state as an instance of the class Bundle
or null, if no saved state
+ is availablepublic interface AddTabButtonListener
+TabSwitcher
, has been clicked. The listener is responsible for instantiating
+ and adding the tab.Modifier and Type | +Method and Description | +
---|---|
void |
+onAddTab(TabSwitcher tabSwitcher)
+The method, which is invoked, when a button, which allows to add a tab to a tab switcher, has
+ been clicked.
+ |
+
void onAddTab(@NonNull + TabSwitcher tabSwitcher)+
tabSwitcher
- The tab switcher, the tab should be added to, as an instance of the class TabSwitcher
. The tab switcher may not be nullAnimationType
- The type of the animations, which are created by the builderBuilderType
- The type of the builderprotected abstract static class Animation.Builder<AnimationType,BuilderType>
+extends java.lang.Object
+Animation
.Modifier and Type | +Field and Description | +
---|---|
protected long |
+duration
+The duration of the animations, which are created by the builder.
+ |
+
protected android.view.animation.Interpolator |
+interpolator
+The interpolator, which is used by the animations, which are created by the builder.
+ |
+
Constructor and Description | +
---|
Builder()
+Creates a new builder, which allows to configure and create instances of the class
+Animation . |
+
Modifier and Type | +Method and Description | +
---|---|
abstract AnimationType |
+create()
+Creates and returns the animation.
+ |
+
protected BuilderType |
+self()
+Returns a reference to the builder.
+ |
+
BuilderType |
+setDuration(long duration)
+Sets the duration of the animations, which are created by the builder.
+ |
+
BuilderType |
+setInterpolator(android.view.animation.Interpolator interpolator)
+Sets the interpolator, which should be used by the animations, which are created by the
+ builder.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected long duration+
protected android.view.animation.Interpolator interpolator+
public Builder()+
Animation
.@NonNull +protected final BuilderType self()+
@NonNull +public abstract AnimationType create()+
@NonNull +public final BuilderType setDuration(long duration)+
duration
- The duration, which should be set, in milliseconds as a Long
value or -1,
+ if the default duration should be used@NonNull +public final BuilderType setInterpolator(@Nullable + android.view.animation.Interpolator interpolator)+
interpolator
- The interpolator, which should be set, as an instance of the type Interpolator
or null, if the default interpolator should be usedpublic abstract class Animation
+extends java.lang.Object
+TabSwitcher
.Modifier and Type | +Class and Description | +
---|---|
protected static class |
+Animation.Builder<AnimationType,BuilderType>
+An abstract base class for all builders, which allow to configure and create instances of the
+ class
+Animation . |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+Animation(long duration,
+ android.view.animation.Interpolator interpolator)
+Creates a new animation.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
long |
+getDuration()
+Returns the duration of the animation.
+ |
+
android.view.animation.Interpolator |
+getInterpolator()
+Returns the interpolator, which is used by the animation.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected Animation(long duration, + @Nullable + android.view.animation.Interpolator interpolator)+
duration
- The duration of the animation in milliseconds as a Long
value or -1, if the
+ default duration should be usedinterpolator
- The interpolator, which should be used by the animation, as an instance of the type
+ Interpolator
or null, if the default interpolator should be usedpublic final long getDuration()+
Long
value or -1, if the
+ default duration is used@Nullable +public final android.view.animation.Interpolator getInterpolator()+
Interpolator
or null, if the default interpolator is usedGestureType
- The type of the drag gestures, which are created by the builderBuilderType
- The type of the builderprotected abstract static class DragGesture.Builder<GestureType,BuilderType>
+extends java.lang.Object
+DragGesture
.Modifier and Type | +Field and Description | +
---|---|
protected int |
+threshold
+The threshold of the gestures, which are created by the builder.
+ |
+
protected android.graphics.RectF |
+touchableArea
+The bounds of the onscreen area, which is taken into consideration for recognizing the
+ drag gestures, which are created by the builder.
+ |
+
Constructor and Description | +
---|
Builder()
+Creates a new builder, which allows to configure and create instances of the class
+DragGesture . |
+
Modifier and Type | +Method and Description | +
---|---|
abstract GestureType |
+create()
+Creates and returns the drag gesture.
+ |
+
protected BuilderType |
+self()
+Returns a reference to the builder.
+ |
+
BuilderType |
+setThreshold(int threshold)
+Sets the threshold of the drag gestures, which are created by the builder.
+ |
+
BuilderType |
+setTouchableArea(float left,
+ float top,
+ float right,
+ float bottom)
+Sets the bounds of the onscreen area, which should be taken into consideration for
+ recognizing the drag gestures, which are create by the builder.
+ |
+
BuilderType |
+setTouchableArea(android.graphics.RectF bounds)
+Sets the bounds of the onscreen area, which should be taken into consideration for
+ recognizing the drag gestures, which are create by the builder.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected int threshold+
protected android.graphics.RectF touchableArea+
public Builder()+
DragGesture
.@NonNull +protected final BuilderType self()+
public abstract GestureType create()+
@NonNull +public final BuilderType setThreshold(int threshold)+
threshold
- The threshold, which should be set, in pixels as a Integer
value. The
+ threshold must be at least 0 or -1, if the default threshold should be used@NonNull +public final BuilderType setTouchableArea(float left, + float top, + float right, + float bottom)+
left
- The coordinate of the left edge in pixels as a Float
value. The
+ coordinate must be at least 0top
- The coordinate of the top edge in pixels as a Float
value. The coordinate
+ must be at least 0right
- The coordinate of the right edge in pixels as a Float
value. The
+ coordinate must be greater than the coordinate of the left edgebottom
- The coordinate of the bottom edge in pixels as a Float
value. The
+ coordinate must be greater than the coordinate of the top edge@NonNull +public final BuilderType setTouchableArea(@Nullable + android.graphics.RectF bounds)+
bounds
- The bounds, which should be set, as an instance of the class RectF
or
+ null, if the area should not be restrictedpublic abstract class DragGesture
+extends java.lang.Object
+Modifier and Type | +Class and Description | +
---|---|
protected static class |
+DragGesture.Builder<GestureType,BuilderType>
+A builder, which allows to configure and create instances of the class
+DragGesture . |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+DragGesture(int threshold,
+ android.graphics.RectF touchableArea)
+Creates a new drag gesture, which can be used to perform certain action when dragging in a
+ particular direction.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+getThreshold()
+Returns the distance in pixels, the gesture must last until it is recognized.
+ |
+
android.graphics.RectF |
+getTouchableArea()
+Returns the bounds of the onscreen area, which is taken into consideration for recognizing
+ the drag gesture.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected DragGesture(int threshold, + @Nullable + android.graphics.RectF touchableArea)+
threshold
- The distance in pixels, the gesture must last until it is recognized, as an Integer
value. The distance must be at least 0 or -1, if the default distance should
+ be usedtouchableArea
- The bounds of the onscreen area, which should be taken into consideration for
+ recognizing the drag gesture, as an instance of the class RectF
or null, if
+ the area should not be restrictedpublic final int getThreshold()+
Integer
value. The distance must be at least 0 or -1, if the default distance should be used@Nullable +public final android.graphics.RectF getTouchableArea()+
RectF
or null, if the area is not
+ restrictedpublic enum Layout +extends java.lang.Enum<Layout>+
TabSwitcher
.Enum Constant and Description | +
---|
PHONE_LANDSCAPE
+The layout, which is used on smartphones and phablet devices, when in landscape mode.
+ |
+
PHONE_PORTRAIT
+The layout, which is used on smartphones and phablet devices, when in portrait mode.
+ |
+
TABLET
+The layout, which is used on tablets.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static Layout |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static Layout[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final Layout PHONE_PORTRAIT+
public static final Layout PHONE_LANDSCAPE+
public static final Layout TABLET+
public static Layout[] values()+
+for (Layout c : Layout.values()) + System.out.println(c); +
public static Layout valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic enum LayoutPolicy +extends java.lang.Enum<LayoutPolicy>+
TabSwitcher
.Enum Constant and Description | +
---|
AUTO
+If the layout should automatically adapted, depending on whether the device is a smartphone
+ or tablet.
+ |
+
PHONE
+If the smartphone layout should be used, regardless of the device.
+ |
+
TABLET
+If the tablet layout should be used, regardless of the device.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static LayoutPolicy |
+fromValue(int value)
+Returns the layout policy, which corresponds to a specific value.
+ |
+
int |
+getValue()
+Returns the value of the layout policy.
+ |
+
static LayoutPolicy |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static LayoutPolicy[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final LayoutPolicy AUTO+
public static final LayoutPolicy PHONE+
public static final LayoutPolicy TABLET+
public static LayoutPolicy[] values()+
+for (LayoutPolicy c : LayoutPolicy.values()) + System.out.println(c); +
public static LayoutPolicy valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic final int getValue()+
Integer
valuepublic static LayoutPolicy fromValue(int value)+
value
- The value of the layout policy, which should be returned, as an Integer
+ valueLayoutPolicy
public static class PeekAnimation.Builder +extends Animation.Builder<PeekAnimation,PeekAnimation.Builder>+
PeekAnimation
.duration, interpolator
Constructor and Description | +
---|
Builder()
+Creates a new builder, which allows to configure and create instances of the class
+PeekAnimation . |
+
Modifier and Type | +Method and Description | +
---|---|
PeekAnimation |
+create()
+Creates and returns the animation.
+ |
+
PeekAnimation.Builder |
+setX(float x)
+Sets the horizontal position, the animations, which are created by the builder, should
+ start at.
+ |
+
PeekAnimation.Builder |
+setY(float y)
+Sets the vertical position, the animations, which are created by the builder, should
+ start at.
+ |
+
self, setDuration, setInterpolator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Builder()+
PeekAnimation
.@NonNull +public final PeekAnimation.Builder setX(float x)+
x
- The horizontal position, which should be set, in pixels as a Float
value@NonNull +public final PeekAnimation.Builder setY(float y)+
y
- The vertical position, which should be set, in pixels as a Float
value@NonNull +public final PeekAnimation create()+
Animation.Builder
create
in class Animation.Builder<PeekAnimation,PeekAnimation.Builder>
public class PeekAnimation +extends Animation+
TabSwitcher
. Peek animations can be used to
+ add tabs while the tab switcher is not shown and when using the smartphone layout. They are meant
+ to be used when adding a tab without selecting it and enable the user to peek at the added tab
+ for a short moment.Modifier and Type | +Class and Description | +
---|---|
static class |
+PeekAnimation.Builder
+A builder, which allows to configure and create instances of the class
+PeekAnimation . |
+
Modifier and Type | +Method and Description | +
---|---|
float |
+getX()
+Returns the horizontal position, the animation starts at.
+ |
+
float |
+getY()
+Returns the vertical position, the animation starts at.
+ |
+
getDuration, getInterpolator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public final float getX()+
Float
valuepublic final float getY()+
Float
valuepublic static class PullDownGesture.Builder +extends DragGesture.Builder<PullDownGesture,PullDownGesture.Builder>+
PullDownGesture
.threshold, touchableArea
Modifier and Type | +Method and Description | +
---|---|
PullDownGesture |
+create()
+Creates and returns the drag gesture.
+ |
+
self, setThreshold, setTouchableArea, setTouchableArea
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public final PullDownGesture create()+
DragGesture.Builder
create
in class DragGesture.Builder<PullDownGesture,PullDownGesture.Builder>
public class PullDownGesture +extends DragGesture+
Modifier and Type | +Class and Description | +
---|---|
static class |
+PullDownGesture.Builder
+A builder, which allows to configure and create instances of the class
+PullDownGesture . |
+
getThreshold, getTouchableArea
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static class RevealAnimation.Builder +extends Animation.Builder<RevealAnimation,RevealAnimation.Builder>+
RevealAnimation
.duration, interpolator
Constructor and Description | +
---|
Builder()
+Creates a new builder, which allows to configure and create instances of the class
+RevealAnimation . |
+
Modifier and Type | +Method and Description | +
---|---|
RevealAnimation |
+create()
+Creates and returns the animation.
+ |
+
RevealAnimation.Builder |
+setX(float x)
+Sets the horizontal position, the animations, which are created by the builder, should
+ start at.
+ |
+
RevealAnimation.Builder |
+setY(float y)
+Sets the vertical position, the animations, which are created by the builder, should
+ start at.
+ |
+
self, setDuration, setInterpolator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Builder()+
RevealAnimation
.@NonNull +public final RevealAnimation.Builder setX(float x)+
x
- The horizontal position, which should be set, in pixels as a Float
value@NonNull +public final RevealAnimation.Builder setY(float y)+
y
- The vertical position, which should be set, in pixels as a Float
value@NonNull +public final RevealAnimation create()+
Animation.Builder
create
in class Animation.Builder<RevealAnimation,RevealAnimation.Builder>
public class RevealAnimation +extends Animation+
TabSwitcher
when using the smartphone layout.
+ Tabs, which have been added by using a reveal animation, are selected automatically.Modifier and Type | +Class and Description | +
---|---|
static class |
+RevealAnimation.Builder
+A builder, which allows to configure and create instances of the class
+RevealAnimation . |
+
Modifier and Type | +Method and Description | +
---|---|
float |
+getX()
+Returns the horizontal position, the animation starts at.
+ |
+
float |
+getY()
+Returns the vertical position, the animation starts at.
+ |
+
getDuration, getInterpolator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public final float getX()+
Float
valuepublic final float getY()+
Float
valueStateType
- The type of the states, which are stored by the decoratorpublic abstract class StatefulTabSwitcherDecorator<StateType> +extends TabSwitcherDecorator+
TabSwitcherDecorator
, which allows to store any arbitrary state for each tab of the
+ associated TabSwitcher
. The state is kept even if the tab is currently not shown.
+ However, it is possible that states are vanished, if few memory is available, because they are
+ stored using SoftReference
s. Unlike the parameters, which can be set for an individual
+ Tab
using the method Tab.setParameters(Bundle)
, these states are not restored
+ when restoring the state of a TabSwitcher
, e.g. after orientation changes. Instead the
+ state is vanished and will be created from scratch when the tab is shown for the next time.
+
+ If it is necessary to store some data from a state, it can be put into the bundle, which is
+ passed to the onSaveInstanceState(View, Tab, int, int, Object, Bundle)
method. The data
+ can later be retrieved from the bundle when the method
+ onCreateState(Context, TabSwitcher, View, Tab, int, int, Bundle)
is invoked for the next
+ time.
+
+ It is recommended to use the class AbstractState
as a base class for implementing states.
+ This is not necessary though. Said class stores a reference to the tab, it corresponds to and
+ implements the interface Restorable
to be able to store and restore its state. By
+ implementing the methods of this interface and calling them in the decorator's onSaveInstanceState(View, Tab, int, int, Object, Bundle)
, respectively onCreateState(Context, TabSwitcher, View, Tab, int, int, Bundle)
method, the selected
+ properties of the state can be stored and restored.
+
+ If TabSwitcher.areSavedStatesClearedWhenRemovingTabs()
returns true, the state of tabs is
+ cleared when a tab has been removed from the TabSwitcher
. This can be prevented by using
+ the method TabSwitcher.clearSavedStatesWhenRemovingTabs(boolean)
. To manually remove the
+ state of a specific tab, the method clearState(Tab)
can be used. The method clearAllStates()
allows to remove the states of all tabs accordingly.
+
+ IMPORTANT: States must not store references to views, which have been inflated in the decorator's
+ TabSwitcherDecorator.onInflateView(LayoutInflater, ViewGroup, int)
method, because these views can be reused
+ across all tabs of the TabSwitcher
and therefore are not guaranteed to belong to the same
+ tab for the whole lifetime of the decorator.
Constructor and Description | +
---|
StatefulTabSwitcherDecorator() |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+clearAllStates()
+Removes the states of all tabs.
+ |
+
void |
+clearState(Tab tab)
+Removes the state of a specific tab.
+ |
+
StateType |
+getState(Tab tab)
+Returns the state of a specific tab.
+ |
+
protected void |
+onClearState(StateType state)
+The method, which is invoked on subclasses, when a state is cleared using the
+clearState(Tab) or clearAllStates() method. |
+
protected abstract StateType |
+onCreateState(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 on subclasses in order to create the state for a specific tab.
+ |
+
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.
+ |
+
protected void |
+onSaveInstanceState(android.view.View view,
+ Tab tab,
+ int index,
+ int viewType,
+ StateType state,
+ android.os.Bundle outState)
+The method, which is invoked, when the view, which is used to visualize a tab, is removed.
+ |
+
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.
+ |
+
protected abstract void |
+onShowTab(android.content.Context context,
+ TabSwitcher tabSwitcher,
+ android.view.View view,
+ Tab tab,
+ int index,
+ int viewType,
+ StateType state,
+ 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.
+ |
+
applyDecorator, getViewType, getViewTypeCount, inflateView, onInflateView, saveInstanceState
findViewById, setCurrentParentView
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public StatefulTabSwitcherDecorator()+
@Nullable +protected abstract StateType onCreateState(@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, for which a state should be created, as an instance of the class Tab
. The tab may not be nullindex
- The index of the tab, for which a state should be created, as an Integer
+ valueviewType
- The view type of the tab, for which a state should be created, as an Integer
+ valuesavedInstanceState
- The bundle, which has previously been used to save the state of the tab as an
+ instance of the class Bundle
or null, if no saved state is availableStateType
or null, if no state has been createdprotected void onClearState(@NonNull + StateType state)+
clearState(Tab)
or clearAllStates()
method.state
- The state, which is cleared, as an instance of the generic type StateType
.
+ The state may not be nullprotected abstract void onShowTab(@NonNull + android.content.Context context, + @NonNull + TabSwitcher tabSwitcher, + @NonNull + android.view.View view, + @NonNull + Tab tab, + int index, + int viewType, + @Nullable + StateType state, + @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
valuestate
- The state of the tab, which should be visualized, as an instance of the generic type
+ StateType
or null, if no state has been created yetsavedInstanceState
- 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 availableonShowTab(Context, TabSwitcher, View, Tab, int, int, Bundle)
protected void onSaveInstanceState(@NonNull + android.view.View view, + @NonNull + Tab tab, + int index, + int viewType, + @Nullable + StateType state, + @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
valuestate
- The state of tab, whose state should be saved, as an instance of the generic type
+ StateType
or null, if no state has been created yetoutState
- The bundle, the state of the tab should be saved to, as an instance of the class
+ Bundle
. The bundle may not be nullonSaveInstanceState(View, Tab, int, int, Bundle)
@Nullable +public final StateType getState(@NonNull + Tab tab)+
tab
- The tab, whose state should be returned, as an instance of the class Tab
. The
+ tab may not be nullStateType
or
+ null, if no state has been created yet or if it was removedpublic final void clearState(@NonNull + Tab tab)+
tab
- The tab, whose state should be removed, as an instance of the class Tab
. The
+ tab may not be nullpublic final void clearAllStates()+
public final 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)+
TabSwitcherDecorator
onShowTab
in class TabSwitcherDecorator
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 final void onSaveInstanceState(@NonNull + android.view.View view, + @NonNull + Tab tab, + int index, + int viewType, + @NonNull + android.os.Bundle outState)+
TabSwitcherDecorator
onSaveInstanceState
in class TabSwitcherDecorator
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 static class SwipeAnimation.Builder +extends Animation.Builder<SwipeAnimation,SwipeAnimation.Builder>+
SwipeAnimation
.duration, interpolator
Constructor and Description | +
---|
Builder()
+Creates a new builder, which allows to configure and create instances of the class
+SwipeAnimation . |
+
Modifier and Type | +Method and Description | +
---|---|
SwipeAnimation |
+create()
+Creates and returns the animation.
+ |
+
SwipeAnimation.Builder |
+setDirection(SwipeAnimation.SwipeDirection direction)
+Sets the direction of the animations, which are created by the builder.
+ |
+
SwipeAnimation.Builder |
+setRelocateAnimationDuration(long relocateAnimationDuration)
+Sets the duration of the animations, which are used to relocate the other tabs, when a
+ tab has been added or removed.
+ |
+
self, setDuration, setInterpolator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Builder()+
SwipeAnimation
.@NonNull +public final SwipeAnimation.Builder setDirection(@NonNull + SwipeAnimation.SwipeDirection direction)+
direction
- The direction, which should be set, as a value of the enum SwipeAnimation.SwipeDirection
. The direction may either be SwipeAnimation.SwipeDirection.LEFT_OR_TOP
+ or SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
@NonNull +public final SwipeAnimation.Builder setRelocateAnimationDuration(long relocateAnimationDuration)+
relocateAnimationDuration
- The duration, which should be set, in milliseconds as a Long
value or -1,
+ if the default duration should be used@NonNull +public final SwipeAnimation create()+
Animation.Builder
create
in class Animation.Builder<SwipeAnimation,SwipeAnimation.Builder>
public static enum SwipeAnimation.SwipeDirection +extends java.lang.Enum<SwipeAnimation.SwipeDirection>+
Enum Constant and Description | +
---|
LEFT_OR_TOP
+When the tab should be moved to/from the left, respectively the top when in landscape
+ mode.
+ |
+
RIGHT_OR_BOTTOM
+When the tab should be moved to/from the right, respectively the bottom when in landscape
+ mode.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static SwipeAnimation.SwipeDirection |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static SwipeAnimation.SwipeDirection[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final SwipeAnimation.SwipeDirection LEFT_OR_TOP+
public static final SwipeAnimation.SwipeDirection RIGHT_OR_BOTTOM+
public static SwipeAnimation.SwipeDirection[] values()+
+for (SwipeAnimation.SwipeDirection c : SwipeAnimation.SwipeDirection.values()) + System.out.println(c); +
public static SwipeAnimation.SwipeDirection valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic class SwipeAnimation +extends Animation+
TabSwitcher
.Modifier and Type | +Class and Description | +
---|---|
static class |
+SwipeAnimation.Builder
+A builder, which allows to configure and create instances of the class
+SwipeAnimation . |
+
static class |
+SwipeAnimation.SwipeDirection
+Contains all possible directions of a swipe animation.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
SwipeAnimation.SwipeDirection |
+getDirection()
+Returns the direction of the swipe animation.
+ |
+
long |
+getRelocateAnimationDuration()
+Returns the duration of the animations, which are used to relocate the other tabs, when a tab
+ has been added or removed.
+ |
+
getDuration, getInterpolator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@NonNull +public final SwipeAnimation.SwipeDirection getDirection()+
SwipeAnimation.SwipeDirection
.
+ The direction may not be nullpublic final long getRelocateAnimationDuration()+
Long
value or -1, if the default
+ duration is usedpublic static class SwipeGesture.Builder +extends DragGesture.Builder<SwipeGesture,SwipeGesture.Builder>+
SwipeGesture
.threshold, touchableArea
Constructor and Description | +
---|
Builder()
+Creates a new builder, which allows to configure and create instances of the class
+SwipeGesture . |
+
Modifier and Type | +Method and Description | +
---|---|
SwipeGesture |
+create()
+Creates and returns the drag gesture.
+ |
+
SwipeGesture.Builder |
+setAnimationDuration(long animationDuration)
+Sets the duration of the swipe animation of the gestures, which are created by the
+ builder.
+ |
+
self, setThreshold, setTouchableArea, setTouchableArea
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Builder()+
SwipeGesture
.public SwipeGesture.Builder setAnimationDuration(long animationDuration)+
animationDuration
- The duration, which should be set, in milliseconds as a Long
value or -1,
+ if the default duration should be usedpublic final SwipeGesture create()+
DragGesture.Builder
create
in class DragGesture.Builder<SwipeGesture,SwipeGesture.Builder>
public class SwipeGesture +extends DragGesture+
Modifier and Type | +Class and Description | +
---|---|
static class |
+SwipeGesture.Builder
+A builder, which allows to configure and create instances of the class
+SwipeGesture . |
+
Modifier and Type | +Method and Description | +
---|---|
long |
+getAnimationDuration()
+Returns the duration of the swipe animation.
+ |
+
getThreshold, getTouchableArea
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static interface Tab.Callback
+Modifier and Type | +Method and Description | +
---|---|
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 |
+onIconChanged(Tab tab)
+The method, which is invoked, when the tab's icon 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 |
+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 onTitleChanged(@NonNull + Tab tab)+
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullvoid onIconChanged(@NonNull + Tab tab)+
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullvoid onCloseableChanged(@NonNull + Tab tab)+
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullvoid onCloseButtonIconChanged(@NonNull + Tab tab)+
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullvoid onBackgroundColorChanged(@NonNull + Tab tab)+
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullvoid onContentBackgroundColorChanged(@NonNull + Tab tab)+
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullvoid onTitleTextColorChanged(@NonNull + Tab tab)+
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullvoid onProgressBarVisibilityChanged(@NonNull + Tab tab)+
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic class Tab
+extends java.lang.Object
+implements android.os.Parcelable
+TabSwitcher
widget. It has a title, as well as an optional
+ icon. Furthermore, it is possible to set a custom color and to specify, whether the tab should be
+ closeable, or not.Modifier and Type | +Class and Description | +
---|---|
static interface |
+Tab.Callback
+Defines the interface, a class, which should be notified, when a tab's properties have been
+ changed, must implement.
+ |
+
android.os.Parcelable.ClassLoaderCreator<T>, android.os.Parcelable.Creator<T>
Modifier and Type | +Field and Description | +
---|---|
static android.os.Parcelable.Creator<Tab> |
+CREATOR
+A creator, which allows to create instances of the class
+Tab from parcels. |
+
static java.lang.String |
+WAS_SHOWN_PARAMETER
+The name of the parameter, which specifies, whether the tab was already shown in a
+TabSwitcher , or not. |
+
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description | +
---|
Tab(java.lang.CharSequence title)
+Creates a new tab, which can be added to a
+TabSwitcher widget. |
+
Tab(android.content.Context context,
+ int resourceId)
+Creates a new tab, which can be added to a
+TabSwitcher widget. |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addCallback(Tab.Callback callback)
+Adds a new callback, which should be notified, when the tab's properties have been changed.
+ |
+
int |
+describeContents() |
+
android.content.res.ColorStateList |
+getBackgroundColor()
+Returns the background color of the tab.
+ |
+
android.graphics.drawable.Drawable |
+getCloseButtonIcon(android.content.Context context)
+Returns the icon of the tab's close button.
+ |
+
android.content.res.ColorStateList |
+getCloseButtonIconTintList()
+Returns the color state list, which is used to tint the tab's close button.
+ |
+
android.graphics.PorterDuff.Mode |
+getCloseButtonIconTintMode()
+Returns the mode, which is used to tint the tab's close button.
+ |
+
int |
+getContentBackgroundColor()
+Returns the background color of the tab's content.
+ |
+
android.graphics.drawable.Drawable |
+getIcon(android.content.Context context)
+Returns the tab's icon.
+ |
+
android.content.res.ColorStateList |
+getIconTintList()
+Returns the color state list, which is used to tint the tab's icon.
+ |
+
android.graphics.PorterDuff.Mode |
+getIconTintMode()
+Returns the mode, which is used to tint the tab's icon.
+ |
+
android.os.Bundle |
+getParameters()
+Returns a bundle, which contains the optional parameters, which are associated with the tab.
+ |
+
int |
+getProgressBarColor()
+Returns the color of the tab's progress bar.
+ |
+
java.lang.CharSequence |
+getTitle()
+Returns the tab's title.
+ |
+
android.content.res.ColorStateList |
+getTitleTextColor()
+Returns the text color of the tab's title.
+ |
+
boolean |
+isCloseable()
+Returns, whether the tab is closeable, or not.
+ |
+
boolean |
+isProgressBarShown()
+Returns, whether the tab's progress bar is shown, or not.
+ |
+
void |
+removeCallback(Tab.Callback callback)
+Removes a specific callback, which should not be notified, when the tab's properties have
+ been changed, anymore.
+ |
+
void |
+setBackgroundColor(android.content.res.ColorStateList colorStateList)
+Sets the tab's background color.
+ |
+
void |
+setBackgroundColor(int color)
+Sets the tab's background color.
+ |
+
void |
+setCloseable(boolean closeable)
+Sets, whether the tab should be closeable, or not.
+ |
+
void |
+setCloseButtonIcon(android.graphics.Bitmap icon)
+Sets the icon of the tab's close button.
+ |
+
void |
+setCloseButtonIcon(int resourceId)
+Sets the icon of the tab's close button.
+ |
+
void |
+setCloseButtonIconTint(int color)
+Sets the color, which should be used to tint the tab's close button.
+ |
+
void |
+setCloseButtonIconTintList(android.content.res.ColorStateList tintList)
+Sets the color state list, which should be used to tint the tab's close button.
+ |
+
void |
+setCloseButtonIconTintMode(android.graphics.PorterDuff.Mode mode)
+Sets the mode, which should be used to tint the tab's close button.
+ |
+
void |
+setContentBackgroundColor(int color)
+Sets the background color of the tab's content.
+ |
+
void |
+setIcon(android.graphics.Bitmap icon)
+Sets the tab's icon.
+ |
+
void |
+setIcon(int resourceId)
+Sets the tab's icon.
+ |
+
void |
+setIconTint(int color)
+Sets the color, which should be used to tint the tab's icon.
+ |
+
void |
+setIconTintList(android.content.res.ColorStateList tintList)
+Sets the color state list, which should be used to tint the tab's icon.
+ |
+
void |
+setIconTintMode(android.graphics.PorterDuff.Mode mode)
+Sets the mode, which should be used to tint the tab's icon.
+ |
+
void |
+setParameters(android.os.Bundle parameters)
+Sets a bundle, which contains the optional parameters, which should be associated with the
+ tab.
+ |
+
void |
+setProgressBarColor(int color)
+Sets the color of the tab's progress bar.
+ |
+
void |
+setTitle(java.lang.CharSequence title)
+Sets the tab's title.
+ |
+
void |
+setTitle(android.content.Context context,
+ int resourceId)
+Sets the tab's title.
+ |
+
void |
+setTitleTextColor(android.content.res.ColorStateList colorStateList)
+Sets the text color of the tab's title.
+ |
+
void |
+setTitleTextColor(int color)
+Sets the text color of the tab's title.
+ |
+
void |
+showProgressBar(boolean show)
+Sets, whether the tab's progress bar should be shown, or not.
+ |
+
void |
+writeToParcel(android.os.Parcel parcel,
+ int flags) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final java.lang.String WAS_SHOWN_PARAMETER+
TabSwitcher
, or not. This parameter should be not be set or modified manually.public Tab(@NonNull + java.lang.CharSequence title)+
TabSwitcher
widget.title
- The tab's title as an instance of the type CharSequence
. The title may not be
+ neither be null, nor emptypublic Tab(@NonNull + android.content.Context context, + @StringRes + int resourceId)+
TabSwitcher
widget.context
- The context, which should be used, as an instance of the class Context
. The
+ context may not be nullresourceId
- The resource id of the tab's title as an Integer
value. The resource id must
+ correspond to a valid string resource@NonNull +public final java.lang.CharSequence getTitle()+
CharSequence
. The title may
+ neither be null, nor emptypublic final void setTitle(@NonNull + java.lang.CharSequence title)+
title
- The title, which should be set, as an instance of the type CharSequence
. The
+ title may neither be null, nor emptypublic final void setTitle(@NonNull + android.content.Context context, + @StringRes + int resourceId)+
context
- The context, which should be used, as an instance of the class Context
. The
+ context may not be nullresourceId
- The resource id of the title, which should be set, as an Integer
value. The
+ resource id must correspond to a valid string resource@Nullable +public final android.graphics.drawable.Drawable getIcon(@NonNull + android.content.Context context)+
context
- The context, which should be used, as an instance of the class Context
. The
+ context may not be nullDrawable
or null, if no custom
+ icon is setpublic final void setIcon(@DrawableRes + int resourceId)+
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
+ resource id must correspond to a valid drawable resourcepublic final void setIcon(@Nullable + android.graphics.Bitmap icon)+
icon
- The icon, which should be set, as an instance of the class Bitmap
or null, if
+ no custom icon should be setpublic final android.content.res.ColorStateList getIconTintList()+
ColorStateList
or null, if the icon is not tintedpublic final void setIconTint(int color)+
color
- The color, which should be set, as an Integer
valuepublic final void setIconTintList(@Nullable + android.content.res.ColorStateList tintList)+
tintList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the icon should not be tintedpublic final android.graphics.PorterDuff.Mode getIconTintMode()+
PorterDuff.Mode
or null, if the default mode is usedpublic final void setIconTintMode(@Nullable + android.graphics.PorterDuff.Mode mode)+
mode
- The mode, which should be set, as a value of enum PorterDuff.Mode
or null, if
+ the default mode should be usedpublic final boolean isCloseable()+
public final void setCloseable(boolean closeable)+
closeable
- True, if the tab should be closeable, false otherwise@Nullable +public final android.graphics.drawable.Drawable getCloseButtonIcon(@NonNull + android.content.Context context)+
context
- The context, which should be used to retrieve the icon, as an instance of the class
+ Context
. The context may not be nullDrawable
or
+ null, if no custom icon is setpublic final void setCloseButtonIcon(@DrawableRes + int resourceId)+
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
+ resource id must correspond to a valid drawable resourcepublic final void setCloseButtonIcon(@Nullable + android.graphics.Bitmap icon)+
icon
- The icon, which should be set, as an instance of the class Bitmap
or null, if
+ no custom icon should be setpublic final android.content.res.ColorStateList getCloseButtonIconTintList()+
ColorStateList
or null, if the close button is not tintedpublic final void setCloseButtonIconTint(int color)+
color
- The color, which should be set, as an Integer
valuepublic final void setCloseButtonIconTintList(@Nullable + android.content.res.ColorStateList tintList)+
tintList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the close button should not be tintedpublic final android.graphics.PorterDuff.Mode getCloseButtonIconTintMode()+
PorterDuff.Mode
or null, if the default mode is usedpublic final void setCloseButtonIconTintMode(@Nullable + android.graphics.PorterDuff.Mode mode)+
mode
- The mode, which should be set, as a value of enum PorterDuff.Mode
or null, if
+ the default mode should be used@Nullable +public final android.content.res.ColorStateList getBackgroundColor()+
ColorStateList
or
+ -1, if no custom color is setpublic final void setBackgroundColor(int color)+
color
- The color, which should be set, as an Integer
value or -1, if no custom color
+ should be setpublic final void setBackgroundColor(@Nullable + android.content.res.ColorStateList colorStateList)+
colorStateList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if no custom color should be setpublic final int getContentBackgroundColor()+
Integer
value or -1, if no
+ custom color is setpublic final void setContentBackgroundColor(int color)+
color
- The color, which should be set, as an Integer
value or -1, if no custom color
+ should be set@Nullable +public final android.content.res.ColorStateList getTitleTextColor()+
ColorStateList
+ or null, if no custom color is setpublic final void setTitleTextColor(int color)+
color
- The color, which should be set, as an Integer
value or -1, if no custom color
+ should be setpublic final void setTitleTextColor(@Nullable + android.content.res.ColorStateList colorStateList)+
colorStateList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if no custom color should be setpublic final boolean isProgressBarShown()+
public final void showProgressBar(boolean show)+
show
- True, if the progress bar should be shown, false otherwisepublic final int getProgressBarColor()+
Integer
value or -1, if the default
+ color should be usedpublic final void setProgressBarColor(int color)+
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be used@Nullable +public final android.os.Bundle getParameters()+
Bundle
or null, if no parameters are associated with the
+ tabpublic final void setParameters(@Nullable + android.os.Bundle parameters)+
parameters
- The bundle, which should be set, as an instance of the class Bundle
or null,
+ if no parameters should be associated with the tabpublic final void addCallback(@NonNull + Tab.Callback callback)+
callback
- The callback, which should be added, as an instance of the type Tab.Callback
. The
+ callback may not be nullpublic final void removeCallback(@NonNull + Tab.Callback callback)+
callback
- The callback, which should be removed, as an instance of the type Tab.Callback
.
+ The callback may not be nullpublic final int describeContents()+
describeContents
in interface android.os.Parcelable
public final void writeToParcel(android.os.Parcel parcel, + int flags)+
writeToParcel
in interface android.os.Parcelable
public interface TabCloseListener
+Modifier and Type | +Method and Description | +
---|---|
boolean |
+onCloseTab(TabSwitcher tabSwitcher,
+ Tab tab)
+The method, which is invoked, when a tab is about to be closed by clicking its close button.
+ |
+
boolean onCloseTab(@NonNull + TabSwitcher tabSwitcher, + @NonNull + Tab tab)+
tabSwitcher
- The tab switcher, the tab belongs to, as an instance of the class TabSwitcher
. The tab switcher may not be nulltab
- The tab, which is about to be closed, as an instance of the class Tab
. The
+ tab may not be nullpublic interface TabPreviewListener
+Modifier and Type | +Method and Description | +
---|---|
boolean |
+onLoadTabPreview(TabSwitcher tabSwitcher,
+ Tab tab)
+The method, which is invoked, when the preview of a tab is about to be loaded.
+ |
+
boolean onLoadTabPreview(@NonNull + TabSwitcher tabSwitcher, + @NonNull + Tab tab)+
tabSwitcher
- The tab switcher, which contains the tab, whose preview is about to be loaded, as an
+ instance of the class TabSwitcher
. The tab switcher may not be nulltab
- The tab, whose preview is about to be loaded, as an instance of the class Tab
. The tab may not be nullpublic class TabSwitcher +extends android.widget.FrameLayout +implements TabSwitcherLayout, Model+
+ In order to specify the appearance of individual tabs, a class, which extends from the abstract
+ class TabSwitcherDecorator
, must be implemented and set to the tab switcher via the
+ setDecorator
-method.
+
+ The currently selected tab is shown fullscreen by default. When displaying the switcher via the
+ showSwitcher-method
, an overview of all tabs is shown, allowing to select an other
+ tab by clicking it. By swiping a tab or by clicking its close button, it can be removed,
+ resulting in the selected tab to be altered automatically. The switcher can programmatically be
+ hidden by calling the hideSwitcher
-method. By calling the
+ setSelectedTab
-method programmatically, a tab is selected and shown fullscreen.
+
+ Individual tabs are represented by instances of the class Tab
. Such tabs can dynamically
+ be added to the tab switcher by using the addTab
-methods. In order to remove them
+ afterwards, the removeTab
can be used. If the switcher is currently shown, calling
+ these methods results in the tabs being added or removed in an animated manner.
android.widget.FrameLayout.LayoutParams
android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnCapturedPointerListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnScrollChangeListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener, android.view.View.OnUnhandledKeyEventListener
Model.Listener
Modifier and Type | +Field and Description | +
---|---|
static int |
+PRIMARY_TOOLBAR_INDEX
+The index of the primary toolbar as returned by the method
+getToolbars() . |
+
static int |
+SECONDARY_TOOLBAR_INDEX
+The index of the secondary toolbar as returned by the method
+getToolbars() . |
+
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR, AUTOFILL_HINT_CREDIT_CARD_NUMBER, AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE, AUTOFILL_HINT_EMAIL_ADDRESS, AUTOFILL_HINT_NAME, AUTOFILL_HINT_PASSWORD, AUTOFILL_HINT_PHONE, AUTOFILL_HINT_POSTAL_ADDRESS, AUTOFILL_HINT_POSTAL_CODE, AUTOFILL_HINT_USERNAME, AUTOFILL_TYPE_DATE, AUTOFILL_TYPE_LIST, AUTOFILL_TYPE_NONE, AUTOFILL_TYPE_TEXT, AUTOFILL_TYPE_TOGGLE, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, IMPORTANT_FOR_AUTOFILL_AUTO, IMPORTANT_FOR_AUTOFILL_NO, IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_AUTOFILL_YES, IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, NOT_FOCUSABLE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z
Constructor and Description | +
---|
TabSwitcher(android.content.Context context)
+Creates a new tab switcher, which allows to switch between multiple tabs.
+ |
+
TabSwitcher(android.content.Context context,
+ android.util.AttributeSet attributeSet)
+Creates a new tab switcher, which allows to switch between multiple tabs.
+ |
+
TabSwitcher(android.content.Context context,
+ android.util.AttributeSet attributeSet,
+ int defaultStyle)
+Creates a new tab switcher, which allows to switch between multiple tabs.
+ |
+
TabSwitcher(android.content.Context context,
+ android.util.AttributeSet attributeSet,
+ int defaultStyle,
+ int defaultStyleResource)
+Creates a new tab switcher, which allows to switch between multiple tabs.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addAllTabs(java.util.Collection<? extends Tab> tabs)
+Adds all tabs, which are contained by a collection, to the tab switcher.
+ |
+
void |
+addAllTabs(java.util.Collection<? extends Tab> tabs,
+ int index)
+Adds all tabs, which are contained by a collection, to the tab switcher, starting at a
+ specific index.
+ |
+
void |
+addAllTabs(java.util.Collection<? extends Tab> tabs,
+ int index,
+ Animation animation)
+Adds all tabs, which are contained by a collection, to the tab switcher, starting at a
+ specific index.
+ |
+
void |
+addAllTabs(Tab[] tabs)
+Adds all tabs, which are contained by an array, to the tab switcher.
+ |
+
void |
+addAllTabs(Tab[] tabs,
+ int index)
+Adds all tabs, which are contained by an array, to the tab switcher, starting at a specific
+ index.
+ |
+
void |
+addAllTabs(Tab[] tabs,
+ int index,
+ Animation animation)
+Adds all tabs, which are contained by an array, to the tab switcher, starting at a specific
+ index.
+ |
+
void |
+addCloseTabListener(TabCloseListener listener)
+Adds a new listener, which should be notified, when a tab is about to be closed by clicking
+ its close button.
+ |
+
void |
+addDragGesture(DragGesture dragGesture)
+Adds a specific drag gesture to the tab switcher.
+ |
+
void |
+addListener(TabSwitcherListener listener)
+Adds a listener, which should be notified about the tab switcher's events.
+ |
+
void |
+addTab(Tab tab)
+Adds a new tab to the tab switcher.
+ |
+
void |
+addTab(Tab tab,
+ int index)
+Adds a new tab to the tab switcher at a specific index.
+ |
+
void |
+addTab(Tab tab,
+ int index,
+ Animation animation)
+Adds a new tab to the tab switcher at a specific index.
+ |
+
void |
+addTabPreviewListener(TabPreviewListener listener)
+Adds a new listener, which should be notified, when the preview of a tab is about to be
+ loaded.
+ |
+
void |
+applyPaddingToTabs(boolean applyPaddingToTabs)
+Sets, whether the padding of the tab switcher should be applied to the content of its tabs,
+ or not.
+ |
+
boolean |
+areSavedStatesClearedWhenRemovingTabs()
+Returns, whether saved states of tabs are cleared when the corresponding tabs are removed
+ from the tab switcher, or not.
+ |
+
boolean |
+areToolbarsShown()
+Returns, whether the toolbars are shown, when the tab switcher is shown, or not.
+ |
+
void |
+clear()
+Removes all tabs from the tab switcher.
+ |
+
void |
+clear(Animation animationType)
+Removes all tabs from the tab switcher.
+ |
+
void |
+clearAllSavedStates()
+Clears the saved states of all tabs.
+ |
+
void |
+clearSavedState(Tab tab)
+Clears the saved state of a specific tab.
+ |
+
void |
+clearSavedStatesWhenRemovingTabs(boolean clear)
+Sets, whether saved states of tabs should be cleared when the corresponding tabs are removed,
+ or not.
+ |
+
android.content.res.ColorStateList |
+getAddTabButtonColor()
+Returns the color of the button, which allows to add a new tab.
+ |
+
int |
+getCount()
+Returns the number of tabs, which are contained by the tab switcher.
+ |
+
TabSwitcherDecorator |
+getDecorator()
+Returns the decorator, which allows to inflate the views, which correspond to the tabs of the
+ tab switcher.
+ |
+
android.view.View |
+getEmptyView()
+Returns the view, which is shown, when the tab switcher is empty.
+ |
+
Layout |
+getLayout()
+Returns the layout of the tab switcher.
+ |
+
LayoutPolicy |
+getLayoutPolicy()
+Returns the layout policy, which is used by the tab switcher.
+ |
+
de.mrapp.android.util.logging.LogLevel |
+getLogLevel()
+Returns the log level, which is used for logging.
+ |
+
int |
+getPaddingBottom()
+Returns the bottom padding of the tab switcher.
+ |
+
int |
+getPaddingEnd()
+Returns the end padding of the tab switcher.
+ |
+
int |
+getPaddingLeft()
+Returns the left padding of the tab switcher.
+ |
+
int |
+getPaddingRight()
+Returns the right padding of the tab switcher.
+ |
+
int |
+getPaddingStart()
+Returns the start padding of the tab switcher.
+ |
+
int |
+getPaddingTop()
+Returns the top padding of the tab switcher.
+ |
+
Tab |
+getSelectedTab()
+Returns the currently selected tab.
+ |
+
int |
+getSelectedTabIndex()
+Returns the index of the currently selected tab.
+ |
+
Tab |
+getTab(int index)
+Returns the tab at a specific index.
+ |
+
android.content.res.ColorStateList |
+getTabBackgroundColor()
+Returns the default background color of a tab.
+ |
+
android.graphics.drawable.Drawable |
+getTabCloseButtonIcon()
+Returns the default icon of a tab's close button.
+ |
+
android.content.res.ColorStateList |
+getTabCloseButtonIconTintList()
+Returns the color state list, which is used to tint the close button of a tab.
+ |
+
android.graphics.PorterDuff.Mode |
+getTabCloseButtonIconTintMode()
+Returns the mode, which is used to tint the close button of a tab.
+ |
+
android.view.ViewGroup |
+getTabContainer()
+Returns the view group, which contains the tab switcher's tabs.
+ |
+
int |
+getTabContentBackgroundColor()
+Returns the default background color of a tab's content.
+ |
+
android.graphics.drawable.Drawable |
+getTabIcon()
+Returns the default icon of a tab.
+ |
+
android.content.res.ColorStateList |
+getTabIconTintList()
+Returns the color state list, which is used to tint the icon of a tab.
+ |
+
android.graphics.PorterDuff.Mode |
+getTabIconTintMode()
+Returns the mode, which is used to tint the icon of a tab.
+ |
+
long |
+getTabPreviewFadeDuration()
+Returns the duration of the fade animation, which is used to show the preview of tabs.
+ |
+
long |
+getTabPreviewFadeThreshold()
+Returns the duration, which must be reached when loading the preview of a tab to use a fade
+ animation.
+ |
+
int |
+getTabProgressBarColor()
+Returns the color of a tab's progress bar.
+ |
+
android.content.res.ColorStateList |
+getTabTitleTextColor()
+Returns the default text color of a tab's title.
+ |
+
android.view.Menu |
+getToolbarMenu()
+Returns the menu of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
android.graphics.drawable.Drawable |
+getToolbarNavigationIcon()
+Returns the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
android.content.res.ColorStateList |
+getToolbarNavigationIconTintList()
+Returns the color state list, which is used to tint the navigation icon of the toolbar, which
+ is shown, when the tab switcher is shown.
+ |
+
android.graphics.PorterDuff.Mode |
+getToolbarNavigationIconTintMode()
+Returns the mode, which is used to tint the navigation icon of the toolbar, which is shown,
+ when the tab switcher is shown.
+ |
+
android.support.v7.widget.Toolbar[] |
+getToolbars()
+Returns the toolbars, which are shown, when the tab switcher is shown.
+ |
+
java.lang.CharSequence |
+getToolbarTitle()
+Returns the title of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+hideSwitcher()
+Hides the tab switcher by using an animation, if it is currently shown.
+ |
+
int |
+indexOf(Tab tab)
+Returns the index of a specific tab.
+ |
+
void |
+inflateToolbarMenu(int resourceId,
+ android.support.v7.widget.Toolbar.OnMenuItemClickListener listener)
+Inflates the menu of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
boolean |
+isAddTabButtonShown()
+Returns, whether a button, which allows to add a new tab, is shown.
+ |
+
boolean |
+isAnimationRunning()
+Returns, whether an animation is currently running, or not.
+ |
+
boolean |
+isEmpty()
+Returns, whether the tab switcher is empty, or not.
+ |
+
boolean |
+isPaddingAppliedToTabs()
+Returns, whether the padding of the tab switcher is applied to the content of its tabs, or
+ not.
+ |
+
boolean |
+isSwitcherShown()
+Returns, whether the tab switcher is currently shown.
+ |
+
java.util.Iterator<Tab> |
+iterator() |
+
void |
+notifyTabChanged(Tab tab)
+Notifies the tab switcher that a specific tab has changed.
+ |
+
void |
+onRestoreInstanceState(android.os.Parcelable state) |
+
android.os.Parcelable |
+onSaveInstanceState() |
+
boolean |
+onTouchEvent(android.view.MotionEvent event) |
+
void |
+removeCloseTabListener(TabCloseListener listener)
+Removes a specific listener, which should not be notified, when a tab is about to be closed
+ by clicking its close button, anymore.
+ |
+
void |
+removeDragGesture(DragGesture dragGesture)
+Removes a specific drag gesture from the tab switcher.
+ |
+
void |
+removeListener(TabSwitcherListener listener)
+Removes a specific listener, which should not be notified about the tab switcher's events,
+ anymore.
+ |
+
void |
+removeTab(Tab tab)
+Removes a specific tab from the tab switcher.
+ |
+
void |
+removeTab(Tab tab,
+ Animation animation)
+Removes a specific tab from the tab switcher.
+ |
+
void |
+removeTabPreviewListener(TabPreviewListener listener)
+Removes a specific listener, which should not be notified, when the preview of a tab is about
+ to be loaded.
+ |
+
void |
+selectTab(int index)
+Selects the tab as a specific index.
+ |
+
void |
+selectTab(Tab tab)
+Selects a specific tab.
+ |
+
void |
+setAddTabButtonColor(android.content.res.ColorStateList colorStateList)
+Sets the color of the button, which allows to add a new tab.
+ |
+
void |
+setAddTabButtonColor(int color)
+Sets the color of the button, which allows to add a new tab.
+ |
+
void |
+setDecorator(TabSwitcherDecorator decorator)
+Sets the decorator, which allows to inflate the views, which correspond to the tabs of the
+ tab switcher.
+ |
+
void |
+setEmptyView(int resourceId)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setEmptyView(int resourceId,
+ long animationDuration)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setEmptyView(android.view.View view)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setEmptyView(android.view.View view,
+ long animationDuration)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setLayoutPolicy(LayoutPolicy layoutPolicy)
+Sets the layout policy, which should be used by the tab switcher.
+ |
+
void |
+setLogLevel(de.mrapp.android.util.logging.LogLevel logLevel)
+Sets the log level, which should be used for logging.
+ |
+
void |
+setPadding(int left,
+ int top,
+ int right,
+ int bottom)
+Sets the padding of the tab switcher.
+ |
+
void |
+setTabBackgroundColor(android.content.res.ColorStateList colorStateList)
+Sets the default background color of a tab.
+ |
+
void |
+setTabBackgroundColor(int color)
+Sets the default background color of a tab.
+ |
+
void |
+setTabCloseButtonIcon(android.graphics.Bitmap icon)
+Sets the default icon of a tab's close button.
+ |
+
void |
+setTabCloseButtonIcon(int resourceId)
+Sets the default icon of a tab's close button.
+ |
+
void |
+setTabCloseButtonIconTint(int color)
+Sets the color, which should be used to tint the close button of a tab.
+ |
+
void |
+setTabCloseButtonIconTintList(android.content.res.ColorStateList tintList)
+Sets the color state list, which should be used to tint the close button of a tab.
+ |
+
void |
+setTabCloseButtonIconTintMode(android.graphics.PorterDuff.Mode mode)
+Sets the mode, which should be used to tint the close button of a tab.
+ |
+
void |
+setTabContentBackgroundColor(int color)
+Sets the default background color of a tab's content.
+ |
+
void |
+setTabIcon(android.graphics.Bitmap icon)
+Sets the default icon of a tab.
+ |
+
void |
+setTabIcon(int resourceId)
+Sets the default icon of a tab.
+ |
+
void |
+setTabIconTint(int color)
+Sets the color, which should be used to tint the icon of a tab.
+ |
+
void |
+setTabIconTintList(android.content.res.ColorStateList tintList)
+Sets the color state list, which should be used to tint the icon of a tab.
+ |
+
void |
+setTabIconTintMode(android.graphics.PorterDuff.Mode mode)
+Sets the mode, which should be used to tint the icon of a tab.
+ |
+
void |
+setTabPreviewFadeDuration(long duration)
+Sets the duration of the fade animation, which is used to show the preview of tabs.
+ |
+
void |
+setTabPreviewFadeThreshold(long threshold)
+Sets the duration, which must be reached when loading the preview of a tab to use a fade
+ animation.
+ |
+
void |
+setTabProgressBarColor(int color)
+Sets the color of a tab's progress bar.
+ |
+
void |
+setTabTitleTextColor(android.content.res.ColorStateList colorStateList)
+Sets the default text color of a tab's title.
+ |
+
void |
+setTabTitleTextColor(int color)
+Sets the default text color of a tab's title.
+ |
+
void |
+setToolbarNavigationIcon(android.graphics.drawable.Drawable icon,
+ android.view.View.OnClickListener listener)
+Sets the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIcon(int resourceId,
+ android.view.View.OnClickListener listener)
+Sets the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIconTint(int color)
+Sets the color, which should be used to tint the navigation icon of the toolbar, which is
+ shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIconTintList(android.content.res.ColorStateList tintList)
+Sets the color state list, which should be used to tint the navigation icon of the toolbar,
+ which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIconTintMode(android.graphics.PorterDuff.Mode mode)
+Sets the mode, which should be used to tint the navigation icon of the toolbar, which is
+ shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarTitle(java.lang.CharSequence title)
+Sets the title of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarTitle(int resourceId)
+Sets the title of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
static void |
+setupWithMenu(TabSwitcher tabSwitcher,
+ android.view.Menu menu,
+ android.view.View.OnClickListener listener)
+Setups the tab switcher to be associated with those menu items of a specific menu, which use
+ a
+TabSwitcherButton as their action view. |
+
static void |
+setupWithMenu(TabSwitcher tabSwitcher,
+ android.view.View.OnClickListener listener)
+Setups the tab switcher to be associated with those menu items of its own toolbar menu, which
+ use a
+TabSwitcherButton as their action view. |
+
void |
+showAddTabButton(AddTabButtonListener listener)
+Sets, whether a button, which allows to add a new tab, should be shown.
+ |
+
void |
+showSwitcher()
+Shows the tab switcher by using an animation, if it is not already shown.
+ |
+
void |
+showToolbars(boolean show)
+Sets, whether the toolbars should be shown, when the tab switcher is shown, or not.
+ |
+
void |
+toggleSwitcherVisibility()
+Toggles the visibility of the tab switcher by using an animation, i.e.
+ |
+
checkLayoutParams, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAccessibilityClassName, getConsiderGoneChildrenWhenMeasuring, getMeasureAllChildren, onLayout, onMeasure, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedState
addChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAttachedToWindow, onCreateDrawableState, onDescendantInvalidated, onDetachedFromWindow, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
addExtraDataToAccessibilityNodeInfo, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, autofill, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getImportantForAutofill, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onRtlPropertiesChanged, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForeground, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDraw
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContext
forEach, spliterator
canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, keyboardNavigationClusterSearch, requestFitSystemWindows, requestLayout
public static final int PRIMARY_TOOLBAR_INDEX+
getToolbars()
.public static final int SECONDARY_TOOLBAR_INDEX+
getToolbars()
.public TabSwitcher(@NonNull + android.content.Context context)+
context
- The context, which should be used by the view, as an instance of the class Context
. The context may not be nullpublic TabSwitcher(@NonNull + android.content.Context context, + @Nullable + android.util.AttributeSet attributeSet)+
context
- The context, which should be used by the view, as an instance of the class Context
. The context may not be nullattributeSet
- The attribute set, the view's attributes should be obtained from, as an instance of
+ the type AttributeSet
or null, if no attributes should be obtainedpublic TabSwitcher(@NonNull + android.content.Context context, + @Nullable + android.util.AttributeSet attributeSet, + @AttrRes + int defaultStyle)+
context
- The context, which should be used by the view, as an instance of the class Context
. The context may not be nullattributeSet
- The attribute set, the view's attributes should be obtained from, as an instance of
+ the type AttributeSet
or null, if no attributes should be obtaineddefaultStyle
- The default style to apply to this view. If 0, no style will be applied (beyond what
+ is included in the theme). This may either be an attribute resource, whose value will
+ be retrieved from the current theme, or an explicit style resourcepublic TabSwitcher(@NonNull + android.content.Context context, + @Nullable + android.util.AttributeSet attributeSet, + @AttrRes + int defaultStyle, + @StyleRes + int defaultStyleResource)+
context
- The context, which should be used by the view, as an instance of the class Context
. The context may not be nullattributeSet
- The attribute set, the view's attributes should be obtained from, as an instance of
+ the type AttributeSet
or null, if no attributes should be obtaineddefaultStyle
- The default style to apply to this view. If 0, no style will be applied (beyond what
+ is included in the theme). This may either be an attribute resource, whose value will
+ be retrieved from the current theme, or an explicit style resourcedefaultStyleResource
- A resource identifier of a style resource that supplies default values for the view,
+ used only if the default style is 0 or can not be found in the theme. Can be 0 to not
+ look for defaultspublic static void setupWithMenu(@NonNull + TabSwitcher tabSwitcher, + @Nullable + android.view.View.OnClickListener listener)+
TabSwitcherButton
as their action view. The icon of such menu items will
+ automatically be updated, when the number of tabs, which are contained by the tab switcher,
+ changes.
+
+ Calling this method is basically the same as calling setupWithMenu(tabSwitcher,
+ tabSwitcher.getToolbarMenu(), listener)
. However, if the Menu
, which is
+ returned by tabSwitcher.getToolbarMenu()
is null, a ViewTreeObserver.OnGlobalLayoutListener
is registered at the given tab switcher to setup the tab switcher as
+ soon as the menu is initialized.
tabSwitcher
- The tab switcher, which should become associated with the menu items, as an instance
+ of the class TabSwitcher
. The tab switcher may not be nulllistener
- The listener, which should be set to the menu items, which use a TabSwitcherButton
as their action view, as an instance of the type OnClickListener
or null, if no listener should be setpublic static void setupWithMenu(@NonNull + TabSwitcher tabSwitcher, + @NonNull + android.view.Menu menu, + @Nullable + android.view.View.OnClickListener listener)+
TabSwitcherButton
as their action view. The icon of such menu items will
+ automatically be updated, when the number of tabs, which are contained by the tab switcher,
+ changes.tabSwitcher
- The tab switcher, which should become associated with the menu items, as an instance
+ of the class TabSwitcher
. The tab switcher may not be nullmenu
- The menu, whose menu items should become associated with the given tab switcher, as
+ an instance of the type Menu
. The menu may not be nulllistener
- The listener, which should be set to the menu items, which use a TabSwitcherButton
as their action view, as an instance of the type OnClickListener
or null, if no listener should be setpublic final void addListener(@NonNull + TabSwitcherListener listener)+
listener
- The listener, which should be added, as an instance of the type TabSwitcherListener
. The listener may not be nullpublic final void removeListener(@NonNull + TabSwitcherListener listener)+
listener
- The listener, which should be removed, as an instance of the type TabSwitcherListener
. The listener may not be null@NonNull +public final LayoutPolicy getLayoutPolicy()+
LayoutPolicy
. The layout policy may either be LayoutPolicy.AUTO
, LayoutPolicy.PHONE
or LayoutPolicy.TABLET
public final void setLayoutPolicy(@NonNull + LayoutPolicy layoutPolicy)+
+ Changing the layout policy after the view has been laid out does not have any effect.
layoutPolicy
- The layout policy, which should be set, as a value of the enum LayoutPolicy
.
+ The layout policy may either be LayoutPolicy.AUTO
, LayoutPolicy.PHONE
+ or LayoutPolicy.TABLET
@NonNull +public final Layout getLayout()+
Layout
. The layout may
+ either be Layout.PHONE_PORTRAIT
, Layout.PHONE_LANDSCAPE
or Layout.TABLET
public final void addDragGesture(@NonNull + DragGesture dragGesture)+
dragGesture
- The drag gesture, which should be added, as an instance of the class DragGesture
. The drag gesture may not be nullpublic final void removeDragGesture(@NonNull + DragGesture dragGesture)+
dragGesture
- The drag gesture, which should be removed, as an instance of the class DragGesture
. The drag gesture may not be nullpublic void clearSavedState(@NonNull + Tab tab)+
tab
- The tab, whose saved state should be cleared, as an instance of the class Tab
. The tab may not be nullpublic void clearAllSavedStates()+
public final void addTab(@NonNull + Tab tab)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an
+ animation is currently running, the tab will be added once all previously started animations
+ have been finished.public final void addTab(@NonNull + Tab tab, + int index)+
Model
SwipeAnimation
with direction
+ SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tab
+ will be added once all previously started animations have been finished.addTab
in interface Model
tab
- The tab, which should be added, as an instance of the class Tab
. The tab may
+ not be nullindex
- The index, the tab should be added at, as an Integer
value. The index must be
+ at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownpublic final void addTab(@NonNull + Tab tab, + int index, + @NonNull + Animation animation)+
Model
addTab
in interface Model
tab
- The tab, which should be added, as an instance of the class Tab
. The tab may
+ not be nullindex
- The index, the tab should be added at, as an Integer
value. The index must be
+ at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tab, as an instance of the class
+ Animation
. The animation may not be nullpublic final void addAllTabs(@NonNull + java.util.Collection<? extends Tab> tabs)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
+ be added once all previously started animations have been finished.addAllTabs
in interface Model
tabs
- A collection, which contains the tabs, which should be added, as an instance of the
+ type Collection
or an empty collection, if no tabs should be addedpublic final void addAllTabs(@NonNull + java.util.Collection<? extends Tab> tabs, + int index)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is
+ used. If an animation is currently running, the tabs will be added once all previously
+ started animations have been finished.addAllTabs
in interface Model
tabs
- A collection, which contains the tabs, which should be added, as an instance of the
+ type Collection
or an empty collection, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownpublic final void addAllTabs(@NonNull + java.util.Collection<? extends Tab> tabs, + int index, + @NonNull + Animation animation)+
Model
addAllTabs
in interface Model
tabs
- A collection, which contains the tabs, which should be added, as an instance of the
+ type Collection
or an empty collection, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tabs, as an instance of the class
+ Animation
. The animation may not be nullpublic final void addAllTabs(@NonNull + Tab[] tabs)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
+ be added once all previously started animations have been finished.addAllTabs
in interface Model
tabs
- An array, which contains the tabs, which should be added, as an array of the type
+ Tab
or an empty array, if no tabs should be addedpublic final void addAllTabs(@NonNull + Tab[] tabs, + int index)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is
+ used. If an animation is currently running, the tabs will be added once all previously
+ started animations have been finished.addAllTabs
in interface Model
tabs
- An array, which contains the tabs, which should be added, as an array of the type
+ Tab
or an empty array, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownpublic final void addAllTabs(@NonNull + Tab[] tabs, + int index, + @NonNull + Animation animation)+
Model
addAllTabs
in interface Model
tabs
- An array, which contains the tabs, which should be added, as an array of the type
+ Tab
or an empty array, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tabs, as an instance of the class
+ Animation
. The animation may not be nullpublic final void removeTab(@NonNull + Tab tab)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tab will
+ be removed once all previously started animations have been finished.public final void removeTab(@NonNull + Tab tab, + @NonNull + Animation animation)+
Model
public final void clear()+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
+ be removed once all previously started animations have been finished.public final void clear(@NonNull + Animation animationType)+
Model
public final void notifyTabChanged(@NonNull + Tab tab)+
tab
- The tab, which has changed, as an instance of the class Tab
. The tab may not
+ be nullpublic final void selectTab(@NonNull + Tab tab)+
Model
public final void selectTab(int index)+
Model
@Nullable +public final Tab getSelectedTab()+
Model
getSelectedTab
in interface Model
Tab
or null, if no tab
+ is currently selectedpublic final int getSelectedTabIndex()+
Model
getSelectedTabIndex
in interface Model
Integer
value or -1, if no tab
+ is currently selectedpublic final java.util.Iterator<Tab> iterator()+
iterator
in interface java.lang.Iterable<Tab>
public final boolean isEmpty()+
Model
public final int getCount()+
Model
@NonNull +public final Tab getTab(int index)+
Model
getTab
in interface Model
index
- The index of the tab, which should be returned, as an Integer
value. The
+ index must be at least 0 and at maximum getCount() - 1
, otherwise a
+ IndexOutOfBoundsException
will be thrownTab
. The tab may not be nullpublic final int indexOf(@NonNull + Tab tab)+
Model
public final boolean isSwitcherShown()+
Model
isSwitcherShown
in interface Model
public final void showSwitcher()+
Model
showSwitcher
in interface Model
public final void hideSwitcher()+
Model
hideSwitcher
in interface Model
public final void toggleSwitcherVisibility()+
Model
toggleSwitcherVisibility
in interface Model
public final void setDecorator(@NonNull + TabSwitcherDecorator decorator)+
Model
setDecorator
in interface Model
decorator
- The decorator, which should be set, as an instance of the class TabSwitcherDecorator
. The decorator may not be nullpublic final TabSwitcherDecorator getDecorator()+
Model
getDecorator
in interface Model
TabSwitcherDecorator
or null, if no
+ decorator has been set@NonNull +public final de.mrapp.android.util.logging.LogLevel getLogLevel()+
Model
getLogLevel
in interface Model
public final void setLogLevel(@NonNull + de.mrapp.android.util.logging.LogLevel logLevel)+
Model
setLogLevel
in interface Model
logLevel
- The log level, which should be set, as a value of the enum LogLevel. The log level
+ may not be nullpublic final void setPadding(int left, + int top, + int right, + int bottom)+
Model
setPadding
in interface Model
setPadding
in class android.view.View
left
- The left padding, which should be set, in pixels as an Integer
valuetop
- The top padding, which should be set, in pixels as an Integer
valueright
- The right padding, which should be set, in pixels as an Integer
valuebottom
- The bottom padding, which should be set, in pixels as an Integer
valuepublic final int getPaddingLeft()+
Model
getPaddingLeft
in interface Model
getPaddingLeft
in class android.view.View
Integer
valuepublic final int getPaddingTop()+
Model
getPaddingTop
in interface Model
getPaddingTop
in class android.view.View
Integer
valuepublic final int getPaddingRight()+
Model
getPaddingRight
in interface Model
getPaddingRight
in class android.view.View
Integer
valuepublic final int getPaddingBottom()+
Model
getPaddingBottom
in interface Model
getPaddingBottom
in class android.view.View
Integer
valuepublic final int getPaddingStart()+
Model
getPaddingStart
in interface Model
getPaddingStart
in class android.view.View
Integer
valuepublic final int getPaddingEnd()+
Model
getPaddingEnd
in interface Model
getPaddingEnd
in class android.view.View
Integer
valuepublic final void applyPaddingToTabs(boolean applyPaddingToTabs)+
Model
false
the padding is still taken into account for
+ positioning tabs and the tab switcher's toolbars.applyPaddingToTabs
in interface Model
applyPaddingToTabs
- True, if the padding of the tab switcher should be applied to the content of its
+ tabs, false otherwisepublic final boolean isPaddingAppliedToTabs()+
Model
isPaddingAppliedToTabs
in interface Model
@Nullable +public final android.graphics.drawable.Drawable getTabIcon()+
Model
getTabIcon
in interface Model
Drawable
or null, if no
+ icon is setpublic final void setTabIcon(@DrawableRes + int resourceId)+
Model
setTabIcon
in interface Model
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
+ resource id must correspond to a valid drawable resourcepublic final void setTabIcon(@Nullable + android.graphics.Bitmap icon)+
Model
setTabIcon
in interface Model
icon
- The icon, which should be set, as an instance of the class Bitmap
or null, if
+ no icon should be setpublic final android.content.res.ColorStateList getTabIconTintList()+
Model
getTabIconTintList
in interface Model
ColorStateList
or null, if the icon is not tintedpublic final void setTabIconTint(int color)+
Model
setTabIconTint
in interface Model
color
- The color, which should be set, as an Integer
valuepublic final void setTabIconTintList(@Nullable + android.content.res.ColorStateList tintList)+
Model
setTabIconTintList
in interface Model
tintList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the icon should not be tintedpublic final android.graphics.PorterDuff.Mode getTabIconTintMode()+
Model
getTabIconTintMode
in interface Model
PorterDuff.Mode
or null, if the default mode is usedpublic final void setTabIconTintMode(@Nullable + android.graphics.PorterDuff.Mode mode)+
Model
setTabIconTintMode
in interface Model
mode
- The mode, which should be set, as a value of enum PorterDuff.Mode
or null, if
+ the default mode should be used@Nullable +public final android.content.res.ColorStateList getTabBackgroundColor()+
Model
getTabBackgroundColor
in interface Model
ColorStateList
or null, if the default color is usedpublic final void setTabBackgroundColor(int color)+
Model
setTabBackgroundColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedpublic final void setTabBackgroundColor(@Nullable + android.content.res.ColorStateList colorStateList)+
Model
setTabBackgroundColor
in interface Model
colorStateList
- The color, which should be set, as an instance of the class ColorStateList
or
+ null, if the default color should be usedpublic final int getTabContentBackgroundColor()+
Model
getTabContentBackgroundColor
in interface Model
Integer
valuepublic final void setTabContentBackgroundColor(int color)+
Model
setTabContentBackgroundColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be used@Nullable +public final android.content.res.ColorStateList getTabTitleTextColor()+
Model
getTabTitleTextColor
in interface Model
ColorStateList
or null, if the default color is usedpublic final void setTabTitleTextColor(int color)+
Model
setTabTitleTextColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedpublic final void setTabTitleTextColor(@Nullable + android.content.res.ColorStateList colorStateList)+
Model
setTabTitleTextColor
in interface Model
colorStateList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the default color should be used@Nullable +public final android.graphics.drawable.Drawable getTabCloseButtonIcon()+
Model
getTabCloseButtonIcon
in interface Model
Drawable
+ or null, if the default icon is usedpublic final int getTabProgressBarColor()+
Model
getTabProgressBarColor
in interface Model
Integer
value or -1, if the default
+ color is usedpublic final void setTabProgressBarColor(int color)+
Model
setTabProgressBarColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedpublic final void setTabCloseButtonIcon(@DrawableRes + int resourceId)+
Model
setTabCloseButtonIcon
in interface Model
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
+ resource id must correspond to a valid drawable resourcepublic final void setTabCloseButtonIcon(@Nullable + android.graphics.Bitmap icon)+
Model
setTabCloseButtonIcon
in interface Model
icon
- The icon, which should be set, as an instance of the class Bitmap
or null, if
+ the default icon should be usedpublic final android.content.res.ColorStateList getTabCloseButtonIconTintList()+
Model
getTabCloseButtonIconTintList
in interface Model
ColorStateList
or null, if the close button is not tintedpublic final void setTabCloseButtonIconTint(int color)+
Model
setTabCloseButtonIconTint
in interface Model
color
- The color, which should be set, as an Integer
valuepublic final void setTabCloseButtonIconTintList(@Nullable + android.content.res.ColorStateList tintList)+
Model
setTabCloseButtonIconTintList
in interface Model
tintList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the close button should not be tintedpublic final android.graphics.PorterDuff.Mode getTabCloseButtonIconTintMode()+
Model
getTabCloseButtonIconTintMode
in interface Model
PorterDuff.Mode
or null, if the default mode is usedpublic final void setTabCloseButtonIconTintMode(@Nullable + android.graphics.PorterDuff.Mode mode)+
Model
setTabCloseButtonIconTintMode
in interface Model
mode
- The mode, which should be set, as a value of enum PorterDuff.Mode
or null, if
+ the default mode should be usedpublic final boolean isAddTabButtonShown()+
Model
isAddTabButtonShown
in interface Model
public final void showAddTabButton(@Nullable + AddTabButtonListener listener)+
Model
showAddTabButton
in interface Model
listener
- The listener, which should be notified, when the button has been clicked, as an
+ instance of the type AddTabButtonListener
or null, if the button should not
+ be shown@Nullable +public final android.content.res.ColorStateList getAddTabButtonColor()+
Model
getAddTabButtonColor
in interface Model
ColorStateList
or null, if the default color is usedpublic final void setAddTabButtonColor(int color)+
Model
setAddTabButtonColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedpublic final void setAddTabButtonColor(@Nullable + android.content.res.ColorStateList colorStateList)+
Model
setAddTabButtonColor
in interface Model
colorStateList
- The color, which should be set, as an instance of the class ColorStateList
or
+ null, if the default color should be usedpublic final boolean areToolbarsShown()+
Model
areToolbarsShown
in interface Model
public final void showToolbars(boolean show)+
Model
showToolbars
in interface Model
show
- True, if the toolbars should be shown, false otherwise@Nullable +public final java.lang.CharSequence getToolbarTitle()+
Model
getToolbarTitle
in interface Model
CharSequence
or null, if no title is setpublic final void setToolbarTitle(@StringRes + int resourceId)+
Model
setToolbarTitle
in interface Model
resourceId
- The resource id of the title, which should be set, as an Integer
value. The
+ resource id must correspond to a valid string resourcepublic final void setToolbarTitle(@Nullable + java.lang.CharSequence title)+
Model
setToolbarTitle
in interface Model
title
- The title, which should be set, as an instance of the type CharSequence
or
+ null, if no title should be set@Nullable +public final android.graphics.drawable.Drawable getToolbarNavigationIcon()+
Model
getToolbarNavigationIcon
in interface Model
Drawable
or null, if no icon is setpublic final void setToolbarNavigationIcon(@Nullable + android.graphics.drawable.Drawable icon, + @Nullable + android.view.View.OnClickListener listener)+
Model
setToolbarNavigationIcon
in interface Model
icon
- The icon, which should be set, as an instance of the class Drawable
or null,
+ if no icon should be 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 setToolbarNavigationIcon(@DrawableRes + int resourceId, + @Nullable + android.view.View.OnClickListener listener)+
Model
setToolbarNavigationIcon
in interface Model
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
+ resource id must correspond to a valid drawable resourcelistener
- 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 android.content.res.ColorStateList getToolbarNavigationIconTintList()+
Model
getToolbarNavigationIconTintList
in interface Model
ColorStateList
+ or null, if the navigation icon is not tintedpublic final void setToolbarNavigationIconTint(int color)+
Model
setToolbarNavigationIconTint
in interface Model
color
- The color, which should be set, as an Integer
valuepublic final void setToolbarNavigationIconTintList(@Nullable + android.content.res.ColorStateList tintList)+
Model
setToolbarNavigationIconTintList
in interface Model
tintList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the navigation icon should not be tintedpublic final android.graphics.PorterDuff.Mode getToolbarNavigationIconTintMode()+
Model
getToolbarNavigationIconTintMode
in interface Model
PorterDuff.Mode
or null, if
+ the default mode is usedpublic final void setToolbarNavigationIconTintMode(@Nullable + android.graphics.PorterDuff.Mode mode)+
Model
setToolbarNavigationIconTintMode
in interface Model
mode
- The mode, which should be set, as a value of the enum PorterDuff.Mode
or
+ null, if the default mode should be usedpublic final void inflateToolbarMenu(@MenuRes + int resourceId, + @Nullable + android.support.v7.widget.Toolbar.OnMenuItemClickListener listener)+
Model
inflateToolbarMenu
in interface Model
resourceId
- The resource id of the menu, which should be inflated, as an Integer
value.
+ The resource id must correspond to a valid menu resourcelistener
- The listener, which should be notified, when an menu item has been clicked, as an
+ instance of the type OnMenuItemClickListener or null, if no listener should be
+ notifiedpublic final long getTabPreviewFadeThreshold()+
Model
getTabPreviewFadeThreshold
in interface Model
Long
valuepublic final void setTabPreviewFadeThreshold(long threshold)+
Model
setTabPreviewFadeThreshold
in interface Model
threshold
- The duration, which should be set, in milliseconds as a Long
value. The
+ duration must be at least 0public final long getTabPreviewFadeDuration()+
Model
getTabPreviewFadeDuration
in interface Model
Long
valuepublic final void setTabPreviewFadeDuration(long duration)+
Model
setTabPreviewFadeDuration
in interface Model
duration
- The duration, which should be set, in milliseconds as a Long
value. The
+ duration must be at least 0@Nullable +public final android.view.View getEmptyView()+
Model
getEmptyView
in interface Model
View
or null, if no view is shownpublic void setEmptyView(@Nullable + android.view.View view)+
Model
setEmptyView
in interface Model
view
- The view, which should be set, as an instance of the class View
or null, if
+ no view should be shown, when the tab switcher is emptypublic final void setEmptyView(@Nullable + android.view.View view, + long animationDuration)+
Model
setEmptyView
in interface Model
view
- The view, which should be 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 usedpublic final void setEmptyView(@LayoutRes + int resourceId)+
Model
setEmptyView
in interface Model
resourceId
- The resource id of the view, which should be set, as an Integer
value. The
+ resource id must correspond to a valid layout resourcepublic final void setEmptyView(@LayoutRes + int resourceId, + long animationDuration)+
Model
setEmptyView
in interface Model
resourceId
- The resource id of the view, which should be set, as an Integer
value. The
+ resource id must correspond to a valid layout resourceanimationDuration
- 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 usedpublic final boolean areSavedStatesClearedWhenRemovingTabs()+
Model
areSavedStatesClearedWhenRemovingTabs
in interface Model
public final void clearSavedStatesWhenRemovingTabs(boolean clear)+
Model
clearSavedStatesWhenRemovingTabs
in interface Model
clear
- True, if the saved states of tabs should be cleared when the corresponding tabs are
+ removed, false otherwisepublic final void addCloseTabListener(@NonNull + TabCloseListener listener)+
Model
addCloseTabListener
in interface Model
listener
- The listener, which should be added, as an instance of the type TabCloseListener
. The listener may not be nullpublic final void removeCloseTabListener(@NonNull + TabCloseListener listener)+
Model
removeCloseTabListener
in interface Model
listener
- The listener, which should be removed, as an instance of the type TabCloseListener
. The listener may not be nullpublic final void addTabPreviewListener(@NonNull + TabPreviewListener listener)+
Model
addTabPreviewListener
in interface Model
listener
- The listener, which should be added, as an instance of the type TabPreviewListener
. The listener may not be nullpublic final void removeTabPreviewListener(@NonNull + TabPreviewListener listener)+
Model
removeTabPreviewListener
in interface Model
listener
- The listener, which should be removed, as an instance of the type TabPreviewListener
. The listener may not be nullpublic final boolean isAnimationRunning()+
TabSwitcherLayout
isAnimationRunning
in interface TabSwitcherLayout
@Nullable +public final android.view.ViewGroup getTabContainer()+
TabSwitcherLayout
getTabContainer
in interface TabSwitcherLayout
ViewGroup
or null, if the view has not been laid out yetpublic final android.support.v7.widget.Toolbar[] getToolbars()+
TabSwitcherLayout
PRIMARY_TOOLBAR_INDEX
+ of the returned array corresponds to the primary toolbar and the index SECONDARY_TOOLBAR_INDEX
corresponds to the secondary toolbar.getToolbars
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 boolean onTouchEvent(android.view.MotionEvent event)+
onTouchEvent
in class android.view.View
public final android.os.Parcelable onSaveInstanceState()+
onSaveInstanceState
in class android.view.View
public final void onRestoreInstanceState(android.os.Parcelable state)+
onRestoreInstanceState
in class android.view.View
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. |
+
findViewById, setCurrentParentView
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@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 nullpublic interface TabSwitcherListener
+Modifier and Type | +Method and Description | +
---|---|
void |
+onAllTabsRemoved(TabSwitcher tabSwitcher,
+ Tab[] tabs,
+ Animation animation)
+The method, which is invoked, when all tabs have been removed from the tab switcher.
+ |
+
void |
+onSelectionChanged(TabSwitcher tabSwitcher,
+ int selectedTabIndex,
+ Tab selectedTab)
+The method, which is invoked, when the currently selected tab has been changed.
+ |
+
void |
+onSwitcherHidden(TabSwitcher tabSwitcher)
+The method, which is invoked, when the tab switcher has been hidden.
+ |
+
void |
+onSwitcherShown(TabSwitcher tabSwitcher)
+The method, which is invoked, when the tab switcher has been shown.
+ |
+
void |
+onTabAdded(TabSwitcher tabSwitcher,
+ int index,
+ Tab tab,
+ Animation animation)
+The method, which is invoked, when a tab has been added to the tab switcher.
+ |
+
void |
+onTabRemoved(TabSwitcher tabSwitcher,
+ int index,
+ Tab tab,
+ Animation animation)
+The method, which is invoked, when a tab has been removed from the tab switcher.
+ |
+
void onSwitcherShown(@NonNull + TabSwitcher tabSwitcher)+
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullvoid onSwitcherHidden(@NonNull + TabSwitcher tabSwitcher)+
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullvoid onSelectionChanged(@NonNull + TabSwitcher tabSwitcher, + int selectedTabIndex, + @Nullable + Tab selectedTab)+
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullselectedTabIndex
- 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 tabsvoid onTabAdded(@NonNull + TabSwitcher tabSwitcher, + int index, + @NonNull + Tab tab, + @NonNull + Animation animation)+
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullindex
- 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 nullanimation
- The animation, which has been used to add the tab, as an instance of the class Animation
. The animation may not be nullvoid onTabRemoved(@NonNull + TabSwitcher tabSwitcher, + int index, + @NonNull + Tab tab, + @NonNull + Animation animation)+
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullindex
- 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 nullanimation
- The animation, which has been used to remove the tab, as an instance of the class
+ Animation
. The animation may not be nullvoid onAllTabsRemoved(@NonNull + TabSwitcher tabSwitcher, + @NonNull + Tab[] tabs, + @NonNull + Animation animation)+
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nulltabs
- 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 class TabSwitcherDrawable +extends android.graphics.drawable.Drawable +implements TabSwitcherListener+
TabSwitcher
. It must be registered at a TabSwitcher
instance in order to keep the
+ displayed label up to date. It therefore implements the interface TabSwitcherListener
.android.graphics.drawable.Drawable.Callback, android.graphics.drawable.Drawable.ConstantState
Constructor and Description | +
---|
TabSwitcherDrawable(android.content.Context context)
+Creates a new drawable, which allows to display the number of tabs, which are currently
+ contained by a
+TabSwitcher . |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+draw(android.graphics.Canvas canvas) |
+
int |
+getIntrinsicHeight() |
+
int |
+getIntrinsicWidth() |
+
int |
+getOpacity() |
+
void |
+onAllTabsRemoved(TabSwitcher tabSwitcher,
+ Tab[] tab,
+ Animation animation)
+The method, which is invoked, when all tabs have been removed from the tab switcher.
+ |
+
void |
+onSelectionChanged(TabSwitcher tabSwitcher,
+ int selectedTabIndex,
+ Tab selectedTab)
+The method, which is invoked, when the currently selected tab has been changed.
+ |
+
void |
+onSwitcherHidden(TabSwitcher tabSwitcher)
+The method, which is invoked, when the tab switcher has been hidden.
+ |
+
void |
+onSwitcherShown(TabSwitcher tabSwitcher)
+The method, which is invoked, when the tab switcher has been shown.
+ |
+
void |
+onTabAdded(TabSwitcher tabSwitcher,
+ int index,
+ Tab tab,
+ Animation animation)
+The method, which is invoked, when a tab has been added to the tab switcher.
+ |
+
void |
+onTabRemoved(TabSwitcher tabSwitcher,
+ int index,
+ Tab tab,
+ Animation animation)
+The method, which is invoked, when a tab has been removed from the tab switcher.
+ |
+
void |
+setAlpha(int alpha) |
+
void |
+setColorFilter(android.graphics.ColorFilter colorFilter) |
+
void |
+setCount(int count)
+Updates the drawable to display a specific value.
+ |
+
applyTheme, canApplyTheme, clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getAlpha, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOutline, getPadding, getState, getTransparentRegion, inflate, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isStateful, isVisible, jumpToCurrentState, mutate, onBoundsChange, onLayoutDirectionChanged, onLevelChange, onStateChange, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintList, setTintMode, setVisible, unscheduleSelf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public TabSwitcherDrawable(@NonNull + android.content.Context context)+
TabSwitcher
.context
- The context, which should be used by the drawable, as an instance of the class Context
. The context may not be nullpublic final void setCount(int count)+
count
- The value, which should be displayed, as an Integer
value. The value must be
+ at least 0public final void draw(@NonNull + android.graphics.Canvas canvas)+
draw
in class android.graphics.drawable.Drawable
public final int getIntrinsicWidth()+
getIntrinsicWidth
in class android.graphics.drawable.Drawable
public final int getIntrinsicHeight()+
getIntrinsicHeight
in class android.graphics.drawable.Drawable
public final void setAlpha(int alpha)+
setAlpha
in class android.graphics.drawable.Drawable
public final void setColorFilter(@Nullable + android.graphics.ColorFilter colorFilter)+
setColorFilter
in class android.graphics.drawable.Drawable
public final int getOpacity()+
getOpacity
in class android.graphics.drawable.Drawable
public final void onSwitcherShown(@NonNull + TabSwitcher tabSwitcher)+
TabSwitcherListener
onSwitcherShown
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullpublic final void onSwitcherHidden(@NonNull + TabSwitcher tabSwitcher)+
TabSwitcherListener
onSwitcherHidden
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullpublic final void onSelectionChanged(@NonNull + TabSwitcher tabSwitcher, + int selectedTabIndex, + @Nullable + Tab selectedTab)+
TabSwitcherListener
onSelectionChanged
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullselectedTabIndex
- 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 tabspublic final void onTabAdded(@NonNull + TabSwitcher tabSwitcher, + int index, + @NonNull + Tab tab, + @NonNull + Animation animation)+
TabSwitcherListener
onTabAdded
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullindex
- 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 nullanimation
- 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 onTabRemoved(@NonNull + TabSwitcher tabSwitcher, + int index, + @NonNull + Tab tab, + @NonNull + Animation animation)+
TabSwitcherListener
onTabRemoved
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullindex
- 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 nullanimation
- 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(@NonNull + TabSwitcher tabSwitcher, + @NonNull + Tab[] tab, + @NonNull + Animation animation)+
TabSwitcherListener
onAllTabsRemoved
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nulltab
- 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 nullClass | +Description | +
---|---|
TabSwitcherDrawable | +
+ A drawable, which allows to display the number of tabs, which are currently contained by a
+TabSwitcher . |
+
public abstract class AbstractDragGestureEventHandler +extends AbstractTouchEventHandler+
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description | +
---|
AbstractDragGestureEventHandler(TabSwitcher tabSwitcher,
+ int dragThreshold,
+ android.graphics.RectF touchableArea)
+Creates a new handler, which can be managed by a
+TouchEventDispatcher in order to
+ dispatch touch events to it. |
+
Modifier and Type | +Method and Description | +
---|---|
android.graphics.RectF |
+getTouchableArea()
+Returns the bounds of the onscreen area, the handler takes into consideration for handling
+ touch events.
+ |
+
compare, equals, getDragHelper, getPriority, getTabSwitcher, getVelocityTracker, handleTouchEvent, hashCode, isDragging, isDraggingAllowed, isInsideTouchableArea, isReset, onDown, onDrag, onTouchEvent, onUp, reset, setPointerId
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public AbstractDragGestureEventHandler(@NonNull + TabSwitcher tabSwitcher, + int dragThreshold, + @Nullable + android.graphics.RectF touchableArea)+
TouchEventDispatcher
in order to
+ dispatch touch events to it.tabSwitcher
- The tab switcher, the event handler belongs to, as an instance of the class TabSwitcher
. The tab switcher may not be nulldragThreshold
- The threshold of the drag helper, which is used to recognize drag gestures, in pixels
+ as an Integer
value The threshold must be at least 0touchableArea
- The bounds of the onscreen area, the handler should take into consideration for
+ handling touch events, as an instance of the class RectF
or null, if the are
+ should not be restricted@Nullable +public final android.graphics.RectF getTouchableArea()+
AbstractTouchEventHandler
getTouchableArea
in class AbstractTouchEventHandler
RectF
or null, if the area is not
+ restrictedpublic abstract class AbstractTouchEventHandler +extends java.lang.Object +implements java.util.Comparator<AbstractTouchEventHandler>+
TouchEventDispatcher
in order to dispatch touch events to them.Modifier and Type | +Field and Description | +
---|---|
protected static int |
+MAX_PRIORITY
+The maximum priority of an event handler.
+ |
+
protected static int |
+MIN_PRIORITY
+The minimum priority of an event handler.
+ |
+
Constructor and Description | +
---|
AbstractTouchEventHandler(int priority,
+ TabSwitcher tabSwitcher,
+ int dragThreshold)
+Creates a new handler, which can be managed by a
+TouchEventDispatcher in order to
+ dispatch touch events to it. |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+compare(AbstractTouchEventHandler o1,
+ AbstractTouchEventHandler o2) |
+
boolean |
+equals(java.lang.Object obj) |
+
de.mrapp.android.util.gesture.DragHelper |
+getDragHelper()
+Returns the drag helper, which is used by the event handler to recognize drag gestures.
+ |
+
int |
+getPriority()
+Returns the priority of the event handler.
+ |
+
protected TabSwitcher |
+getTabSwitcher()
+Returns the tab switcher, the event handler belongs to.
+ |
+
android.graphics.RectF |
+getTouchableArea()
+Returns the bounds of the onscreen area, the handler takes into consideration for handling
+ touch events.
+ |
+
protected android.view.VelocityTracker |
+getVelocityTracker()
+The velocity tracker, which is used by the touch handler to measure the velocity of drag
+ gestures.
+ |
+
boolean |
+handleTouchEvent(android.view.MotionEvent event)
+Handles a specific touch event.
+ |
+
int |
+hashCode() |
+
boolean |
+isDragging()
+Returns, whether a drag gesture is currently handled by the event handler, or not.
+ |
+
protected abstract boolean |
+isDraggingAllowed()
+Returns, whether performing a drag gesture is currently allowed, or not.
+ |
+
boolean |
+isInsideTouchableArea(android.view.MotionEvent event)
+Returns, whether a specific touch event occurred inside the touchable area of the event
+ handler.
+ |
+
boolean |
+isReset()
+Returns, whether the event handler is reset, or not.
+ |
+
protected abstract void |
+onDown(android.view.MotionEvent event)
+The method, which is invoked on implementing subclasses in order to handle, when a drag
+ gesture has been started.
+ |
+
protected abstract void |
+onDrag(android.view.MotionEvent event)
+The method, which is invoked on implementing subclasses in order to handle, when a drag
+ gesture is performed.
+ |
+
protected abstract void |
+onTouchEvent()
+The method, which is invoked on implementing subclasses, when a touch event is about to be
+ handled.
+ |
+
protected abstract void |
+onUp(android.view.MotionEvent event)
+Handles, when a drag gesture has been ended.
+ |
+
protected void |
+reset()
+Resets the event handler once a drag gesture has been ended.
+ |
+
void |
+setPointerId(int pointerId)
+Sets the id of the pointer, which has been used to start the current drag gesture.
+ |
+
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected static final int MAX_PRIORITY+
protected static final int MIN_PRIORITY+
public AbstractTouchEventHandler(int priority, + @NonNull + TabSwitcher tabSwitcher, + int dragThreshold)+
TouchEventDispatcher
in order to
+ dispatch touch events to it.priority
- The priority of the handler as an Integer
value. The priority must be at
+ least MIN_PRIORITY
and at maximum MAX_PRIORITY
tabSwitcher
- The tab switcher, the event handler belongs to, as an instance of the class TabSwitcher
. The tab switcher may not be nulldragThreshold
- The threshold of the drag helper, which is used to recognize drag gestures, in pixels
+ as an Integer
value The threshold must be at least 0@NonNull +protected final TabSwitcher getTabSwitcher()+
TabSwitcher
. The tab switcher may not be null@Nullable +protected final android.view.VelocityTracker getVelocityTracker()+
VelocityTracker
or null, if the velocity
+ tracker has not be initialized yetprotected void reset()+
protected abstract boolean isDraggingAllowed()+
protected abstract void onTouchEvent()+
protected abstract void onDown(@NonNull + android.view.MotionEvent event)+
event
- The touch event, which started the drag gesture, as an instance of the class MotionEvent
. The touch event may not be nullprotected abstract void onDrag(@NonNull + android.view.MotionEvent event)+
event
- The last touch event of the drag gesture as an instance of the class MotionEvent
. The touch event may not be nullprotected abstract void onUp(@Nullable + android.view.MotionEvent event)+
event
- The touch event, which ended the drag gesture, as an instance of the class MotionEvent
or null, if no fling animation should be triggeredpublic final boolean isReset()+
@CallSuper +public boolean isDragging()+
public final int getPriority()+
Integer
value@Nullable +public android.graphics.RectF getTouchableArea()+
RectF
or null, if the area is not
+ restrictedpublic final boolean isInsideTouchableArea(@NonNull + android.view.MotionEvent event)+
event
- The touch event, which should be checked, as an instance of the class MotionEvent
. The touch event may not be null@NonNull +public final de.mrapp.android.util.gesture.DragHelper getDragHelper()+
public final void setPointerId(int pointerId)+
pointerId
- The id, which should be set, as an Integer
value or -1, if no drag gesture is
+ currently startedpublic final boolean handleTouchEvent(@NonNull + android.view.MotionEvent event)+
event
- The event, which should be handled, as an instance of the class MotionEvent
.
+ The event may not be nullpublic final int compare(AbstractTouchEventHandler o1, + AbstractTouchEventHandler o2)+
compare
in interface java.util.Comparator<AbstractTouchEventHandler>
public final int hashCode()+
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object obj)+
equals
in interface java.util.Comparator<AbstractTouchEventHandler>
equals
in class java.lang.Object
public class DragGestureEventHandlerFactory
+extends java.lang.Object
+AbstractDragGestureEventHandler
.Constructor and Description | +
---|
DragGestureEventHandlerFactory(TabSwitcher tabSwitcher)
+Creates a new factory, which allows to create instances of the class
+AbstractDragGestureEventHandler . |
+
Modifier and Type | +Method and Description | +
---|---|
AbstractTouchEventHandler |
+fromGesture(DragGesture dragGesture)
+Creates and returns the event handler, which corresponds to a specific drag gesture.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public DragGestureEventHandlerFactory(@NonNull + TabSwitcher tabSwitcher)+
AbstractDragGestureEventHandler
.tabSwitcher
- The tab switcher, the event handler should be created for, as an instance of the
+ class TabSwitcher
. The tab switcher may not be null@NonNull +public final AbstractTouchEventHandler fromGesture(@NonNull + DragGesture dragGesture)+
dragGesture
- The drag gesture, the event handler should be created from, as an instance of the
+ class DragGesture
. The drag gesture may not be nullAbstractTouchEventHandler
. The event handler may not be nullpublic static interface PullDownGestureEventHandler.Callback
+PullDownGestureEventHandler
, must implement.Modifier and Type | +Method and Description | +
---|---|
void |
+onPulledDown()
+The method, which is notified, when the currently selected tab has been pulled down.
+ |
+
public class PullDownGestureEventHandler +extends AbstractDragGestureEventHandler+
Modifier and Type | +Class and Description | +
---|---|
static interface |
+PullDownGestureEventHandler.Callback
+Defines the interface, a class, which should be notified about the events of a
+PullDownGestureEventHandler , must implement. |
+
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description | +
---|
PullDownGestureEventHandler(TabSwitcher tabSwitcher,
+ int dragThreshold,
+ android.graphics.RectF touchableArea)
+Creates a new event handler, which allows to handle pull down gestures, which can be used to
+ show the tab switcher by pulling down the currently selected tab, when using the smartphone
+ layout.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
protected boolean |
+isDraggingAllowed()
+Returns, whether performing a drag gesture is currently allowed, or not.
+ |
+
protected void |
+onDown(android.view.MotionEvent event)
+The method, which is invoked on implementing subclasses in order to handle, when a drag
+ gesture has been started.
+ |
+
protected void |
+onDrag(android.view.MotionEvent event)
+The method, which is invoked on implementing subclasses in order to handle, when a drag
+ gesture is performed.
+ |
+
protected void |
+onTouchEvent()
+The method, which is invoked on implementing subclasses, when a touch event is about to be
+ handled.
+ |
+
protected void |
+onUp(android.view.MotionEvent event)
+Handles, when a drag gesture has been ended.
+ |
+
void |
+setCallback(PullDownGestureEventHandler.Callback callback)
+Sets the callback, which should be notified about the event handler's events.
+ |
+
getTouchableArea
compare, equals, getDragHelper, getPriority, getTabSwitcher, getVelocityTracker, handleTouchEvent, hashCode, isDragging, isInsideTouchableArea, isReset, reset, setPointerId
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public PullDownGestureEventHandler(@NonNull + TabSwitcher tabSwitcher, + int dragThreshold, + @Nullable + android.graphics.RectF touchableArea)+
tabSwitcher
- The tab switcher, the event handler belongs to, as an instance of the class TabSwitcher
. The tab switcher may not be nulldragThreshold
- The threshold of the drag helper, which is used to recognize drag gestures, in pixels
+ as an Integer
value The threshold must be at least 0touchableArea
- The bounds of the onscreen area, the handler should take into consideration for
+ handling touch events, as an instance of the class RectF
or null, if the arepublic final void setCallback(@Nullable + PullDownGestureEventHandler.Callback callback)+
callback
- The callback, which should be set, as an instance of the type PullDownGestureEventHandler.Callback
or
+ null, if no callback should be notifiedprotected final boolean isDraggingAllowed()+
AbstractTouchEventHandler
isDraggingAllowed
in class AbstractTouchEventHandler
protected final void onTouchEvent()+
AbstractTouchEventHandler
onTouchEvent
in class AbstractTouchEventHandler
protected final void onDown(@NonNull + android.view.MotionEvent event)+
AbstractTouchEventHandler
onDown
in class AbstractTouchEventHandler
event
- The touch event, which started the drag gesture, as an instance of the class MotionEvent
. The touch event may not be nullprotected final void onDrag(@NonNull + android.view.MotionEvent event)+
AbstractTouchEventHandler
onDrag
in class AbstractTouchEventHandler
event
- The last touch event of the drag gesture as an instance of the class MotionEvent
. The touch event may not be nullprotected final void onUp(@Nullable + android.view.MotionEvent event)+
AbstractTouchEventHandler
onUp
in class AbstractTouchEventHandler
event
- The touch event, which ended the drag gesture, as an instance of the class MotionEvent
or null, if no fling animation should be triggeredpublic static interface SwipeGestureEventHandler.Callback
+SwipeGestureEventHandler
, must implement.Modifier and Type | +Method and Description | +
---|---|
void |
+onSwitchingBetweenTabs(int selectedTabIndex,
+ float distance)
+The method, which is invoked, when switching between neighboring tabs.
+ |
+
void |
+onSwitchingBetweenTabsEnded(int selectedTabIndex,
+ int previousSelectedTabIndex,
+ boolean selectionChanged,
+ float velocity,
+ long animationDuration)
+The method, which is invoked, when switching between neighboring tabs ended.
+ |
+
void onSwitchingBetweenTabs(int selectedTabIndex, + float distance)+
selectedTabIndex
- The index of the currently selected tab as an Integer
valuedistance
- The distance, the currently selected tab is swiped by, in pixels as a Float
valuevoid onSwitchingBetweenTabsEnded(int selectedTabIndex, + int previousSelectedTabIndex, + boolean selectionChanged, + float velocity, + long animationDuration)+
selectedTabIndex
- The index of the tab, which should become selected, as an Integer
valuepreviousSelectedTabIndex
- The index of the previously selected tab as an Integer
valueselectionChanged
- True, if the selection has changed, false otherwisevelocity
- The velocity of the swipe gesture in pixels per second as a Float
valueanimationDuration
- The duration of the swipe animation in milliseconds as a Long
valuepublic class SwipeGestureEventHandler +extends AbstractDragGestureEventHandler+
Modifier and Type | +Class and Description | +
---|---|
static interface |
+SwipeGestureEventHandler.Callback
+Defines the interface, a class, which should be notified about the events of a
+SwipeGestureEventHandler , must implement. |
+
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description | +
---|
SwipeGestureEventHandler(TabSwitcher tabSwitcher,
+ int dragThreshold,
+ android.graphics.RectF touchableArea,
+ long animationDuration)
+Creates a new event handler, which allows to handle swipe gestures, which can be used to
+ switch between tabs.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
protected boolean |
+isDraggingAllowed()
+Returns, whether performing a drag gesture is currently allowed, or not.
+ |
+
protected void |
+onDown(android.view.MotionEvent event)
+The method, which is invoked on implementing subclasses in order to handle, when a drag
+ gesture has been started.
+ |
+
protected void |
+onDrag(android.view.MotionEvent event)
+The method, which is invoked on implementing subclasses in order to handle, when a drag
+ gesture is performed.
+ |
+
protected void |
+onTouchEvent()
+The method, which is invoked on implementing subclasses, when a touch event is about to be
+ handled.
+ |
+
protected void |
+onUp(android.view.MotionEvent event)
+Handles, when a drag gesture has been ended.
+ |
+
void |
+setCallback(SwipeGestureEventHandler.Callback callback)
+Sets the callback, which should be notified about the event handler's events.
+ |
+
getTouchableArea
compare, equals, getDragHelper, getPriority, getTabSwitcher, getVelocityTracker, handleTouchEvent, hashCode, isDragging, isInsideTouchableArea, isReset, reset, setPointerId
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public SwipeGestureEventHandler(@NonNull + TabSwitcher tabSwitcher, + int dragThreshold, + @Nullable + android.graphics.RectF touchableArea, + long animationDuration)+
tabSwitcher
- The tab switcher, the event handler belongs to, as an instance of the class TabSwitcher
. The tab switcher may not be nulldragThreshold
- The drag threshold in pixels as an Integer
value. The drag threshold must be
+ at least 0touchableArea
- The bounds of the onscreen area, the handler should take into consideration for
+ handling touch events, as an instance of the class RectF
or null, if the are
+ should not be restrictedanimationDuration
- The duration of the swipe animation in milliseconds as a Long
value or -1, if
+ the default duration should be usedpublic final void setCallback(@Nullable + SwipeGestureEventHandler.Callback callback)+
callback
- The callback, which should be set, as an instance of the type SwipeGestureEventHandler.Callback
or
+ null, if no callback should be notifiedprotected final boolean isDraggingAllowed()+
AbstractTouchEventHandler
isDraggingAllowed
in class AbstractTouchEventHandler
protected final void onTouchEvent()+
AbstractTouchEventHandler
onTouchEvent
in class AbstractTouchEventHandler
protected final void onDown(@NonNull + android.view.MotionEvent event)+
AbstractTouchEventHandler
onDown
in class AbstractTouchEventHandler
event
- The touch event, which started the drag gesture, as an instance of the class MotionEvent
. The touch event may not be nullprotected final void onDrag(@NonNull + android.view.MotionEvent event)+
AbstractTouchEventHandler
onDrag
in class AbstractTouchEventHandler
event
- The last touch event of the drag gesture as an instance of the class MotionEvent
. The touch event may not be nullprotected final void onUp(@Nullable + android.view.MotionEvent event)+
AbstractTouchEventHandler
onUp
in class AbstractTouchEventHandler
event
- The touch event, which ended the drag gesture, as an instance of the class MotionEvent
or null, if no fling animation should be triggeredpublic static interface TouchEventDispatcher.Callback
+TouchEventDispatcher
, must implement.Modifier and Type | +Method and Description | +
---|---|
void |
+onAddedEventHandler(TouchEventDispatcher dispatcher,
+ AbstractTouchEventHandler eventHandler)
+The method, which is invoked, when an event handler has been added.
+ |
+
void |
+onRemovedEventHandler(TouchEventDispatcher dispatcher,
+ AbstractTouchEventHandler eventHandler)
+The method, which is invoked, when an event handler has been removed.
+ |
+
void onAddedEventHandler(@NonNull + TouchEventDispatcher dispatcher, + @NonNull + AbstractTouchEventHandler eventHandler)+
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 nullvoid onRemovedEventHandler(@NonNull + TouchEventDispatcher dispatcher, + @NonNull + AbstractTouchEventHandler eventHandler)+
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 nullpublic class TouchEventDispatcher +extends java.lang.Object +implements java.lang.Iterable<AbstractTouchEventHandler>+
Modifier and Type | +Class and Description | +
---|---|
static interface |
+TouchEventDispatcher.Callback
+Defines the interface, a class, which should be notified, when event handlers are added to or
+ removed from a
+TouchEventDispatcher , must implement. |
+
Constructor and Description | +
---|
TouchEventDispatcher()
+Creates a new dispatcher, which allows to dispatch touch events to multiple event handlers in
+ the order of their priority.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addEventHandler(AbstractTouchEventHandler handler)
+Adds a specific event handler to the dispatcher.
+ |
+
boolean |
+handleTouchEvent(android.view.MotionEvent event)
+Handles a specific touch event by dispatching it to the first suited event handler.
+ |
+
java.util.Iterator<AbstractTouchEventHandler> |
+iterator() |
+
void |
+removeEventHandler(AbstractTouchEventHandler handler)
+Removes a specific event handler from the dispatcher.
+ |
+
void |
+setCallback(TouchEventDispatcher.Callback callback)
+Sets the callback, which should be notified, when event handlers are added or removed.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public TouchEventDispatcher()+
public final void setCallback(@Nullable + TouchEventDispatcher.Callback callback)+
callback
- The callback, which should be set, as an instance of the type TouchEventDispatcher.Callback
or
+ null, if no callback should be notifiedpublic final void addEventHandler(@NonNull + AbstractTouchEventHandler handler)+
handler
- The event handler, which should be added, as an instance of hte class AbstractTouchEventHandler
. The event handler may not be nullpublic final void removeEventHandler(@NonNull + AbstractTouchEventHandler handler)+
handler
- The event handler, which should be removed, as an instance of the class AbstractTouchEventHandler
. The event handler may not be nullpublic final boolean handleTouchEvent(@NonNull + android.view.MotionEvent event)+
event
- The event, which should be handled, as an instance of the class MotionEvent
.
+ The event may not be nullpublic final java.util.Iterator<AbstractTouchEventHandler> iterator()+
iterator
in interface java.lang.Iterable<AbstractTouchEventHandler>
Interface | +Description | +
---|---|
PullDownGestureEventHandler.Callback | +
+ Defines the interface, a class, which should be notified about the events of a
+PullDownGestureEventHandler , must implement. |
+
SwipeGestureEventHandler.Callback | +
+ Defines the interface, a class, which should be notified about the events of a
+SwipeGestureEventHandler , must implement. |
+
TouchEventDispatcher.Callback | +
+ Defines the interface, a class, which should be notified, when event handlers are added to or
+ removed from a
+TouchEventDispatcher , must implement. |
+
Class | +Description | +
---|---|
AbstractDragGestureEventHandler | +
+ An abstract base class for all event handlers, which allow to handle drag gestures.
+ |
+
AbstractTouchEventHandler | +
+ An abstract base class for all event handlers, which can be managed by a
+TouchEventDispatcher in order to dispatch touch events to them. |
+
DragGestureEventHandlerFactory | +
+ A factory, which allows to create instances of the class
+AbstractDragGestureEventHandler . |
+
PullDownGestureEventHandler | +
+ An event handler, which allows to handle pull down gestures, which can be used to show the tab
+ switcher by pulling down the currently selected tab, when using the smartphone layout.
+ |
+
SwipeGestureEventHandler | +
+ An event handler, which allows to handle swipe gestures, which can be used to switch between
+ tabs.
+ |
+
TouchEventDispatcher | +
+ A dispatcher, which allows to dispatch touch events to multiple event handlers in the order of
+ their priority.
+ |
+
public abstract static class AbstractItemIterator.AbstractBuilder<BuilderType extends AbstractItemIterator.AbstractBuilder<?,ProductType>,ProductType extends AbstractItemIterator>
+extends java.lang.Object
+AbstractItemIterator
.Modifier and Type | +Field and Description | +
---|---|
protected boolean |
+reverse
+True, if the items should be iterated in reverse order, false otherwise.
+ |
+
protected int |
+start
+The index of the first item, which should be iterated.
+ |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+AbstractBuilder()
+Creates a new builder, which allows to configure and create instances of the class
+AbstractItemIterator . |
+
Modifier and Type | +Method and Description | +
---|---|
abstract ProductType |
+create()
+Creates the iterator, which has been configured by using the builder.
+ |
+
BuilderType |
+reverse(boolean reverse)
+Sets, whether the items should be iterated in reverse order, or not.
+ |
+
BuilderType |
+start(int start)
+Sets the index of the first item, which should be iterated.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected boolean reverse+
protected int start+
protected AbstractBuilder()+
AbstractItemIterator
.@NonNull +public abstract ProductType create()+
ItemIterator
. The iterator may not be null@NonNull +public BuilderType reverse(boolean reverse)+
reverse
- True, if the items should be iterated in reverse order, false otherwise@NonNull +public BuilderType start(int start)+
start
- The index, which should be set, as an Integer
value or -1, if all items
+ should be iteratedpublic abstract class AbstractItemIterator +extends java.lang.Object +implements java.util.Iterator<AbstractItem>+
AbstractItem
.Modifier and Type | +Class and Description | +
---|---|
static class |
+AbstractItemIterator.AbstractBuilder<BuilderType extends AbstractItemIterator.AbstractBuilder<?,ProductType>,ProductType extends AbstractItemIterator>
+An abstract base class of all builders, which allows to configure and create instances of the
+ class
+AbstractItemIterator . |
+
Constructor and Description | +
---|
AbstractItemIterator() |
+
Modifier and Type | +Method and Description | +
---|---|
AbstractItem |
+first()
+Returns the first item.
+ |
+
abstract int |
+getCount()
+The method, which is invoked on subclasses in order to retrieve the total number of available
+ items.
+ |
+
abstract AbstractItem |
+getItem(int index)
+The method, which is invoked on subclasses in order to retrieve the item, which corresponds
+ to a specific index.
+ |
+
boolean |
+hasNext() |
+
protected void |
+initialize(boolean reverse,
+ int start)
+Initializes the iterator.
+ |
+
AbstractItem |
+next() |
+
AbstractItem |
+peek()
+Returns the next item.
+ |
+
AbstractItem |
+previous()
+Returns the previous item.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
public abstract int getCount()+
Integer
value@NonNull +public abstract AbstractItem getItem(int index)+
index
- The index of the item, which should be returned, as an Integer
valueAbstractItem
. The item may not be nullprotected final void initialize(boolean reverse, + int start)+
reverse
- True, if the items should be iterated in reverse order, false otherwisestart
- The index of the first item, which should be iterated, as an Integer
value or
+ -1, if all items should be iteratedpublic final AbstractItem first()+
AbstractItem
or null, if no items
+ are availablepublic final AbstractItem previous()+
AbstractItem
or null, if no
+ previous item is availablepublic final AbstractItem peek()+
AbstractItem
or null, if no next
+ item is availablepublic final boolean hasNext()+
hasNext
in interface java.util.Iterator<AbstractItem>
public final AbstractItem next()+
next
in interface java.util.Iterator<AbstractItem>
public static class ArrayItemIterator.Builder +extends AbstractItemIterator.AbstractBuilder<ArrayItemIterator.Builder,ArrayItemIterator>+
ArrayItemIterator
.reverse, start
Constructor and Description | +
---|
Builder(Model model,
+ de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler,
+ Tab[] array,
+ int firstIndex)
+Creates a new builder, which allows to configure and create instances of the class
+ArrayItemIterator . |
+
Modifier and Type | +Method and Description | +
---|---|
ArrayItemIterator |
+create()
+Creates the iterator, which has been configured by using the builder.
+ |
+
reverse, start
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Builder(@NonNull + Model model, + @NonNull + de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler, + @NonNull + Tab[] array, + int firstIndex)+
ArrayItemIterator
.model
- The model, which belongs to the tab switcher, whose items should be iterated by
+ the iterator, which is created by the builder, as an instance of the type Model
. The model may not be nullviewRecycler
- The view recycler, which allows to inflate the views, which are used to visualize
+ the tabs, which should be iterated by the iterator, as an instance of the class
+ AttachedViewRecycler. The view recycler may not be nullarray
- The array, which contains the tabs, which should be iterated by the iterator, as
+ an array of the type Tab
. The array may not be nullfirstIndex
- The index of the first tab, which should be iterated by the iterator, as an
+ Integer
value. The index must be at least 0@NonNull +public ArrayItemIterator create()+
AbstractItemIterator.AbstractBuilder
create
in class AbstractItemIterator.AbstractBuilder<ArrayItemIterator.Builder,ArrayItemIterator>
ItemIterator
. The iterator may not be nullpublic class ArrayItemIterator +extends AbstractItemIterator+
Modifier and Type | +Class and Description | +
---|---|
static class |
+ArrayItemIterator.Builder
+A builder, which allows to configure an create instances of the class
+ArrayItemIterator . |
+
AbstractItemIterator.AbstractBuilder<BuilderType extends AbstractItemIterator.AbstractBuilder<?,ProductType>,ProductType extends AbstractItemIterator>
Modifier and Type | +Method and Description | +
---|---|
int |
+getCount()
+The method, which is invoked on subclasses in order to retrieve the total number of available
+ items.
+ |
+
AbstractItem |
+getItem(int index)
+The method, which is invoked on subclasses in order to retrieve the item, which corresponds
+ to a specific index.
+ |
+
first, hasNext, initialize, next, peek, previous
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
public final int getCount()+
AbstractItemIterator
getCount
in class AbstractItemIterator
Integer
value@NonNull +public final AbstractItem getItem(int index)+
AbstractItemIterator
getItem
in class AbstractItemIterator
index
- The index of the item, which should be returned, as an Integer
valueAbstractItem
. The item may not be nullpublic static class ItemIterator.Builder +extends AbstractItemIterator.AbstractBuilder<ItemIterator.Builder,ItemIterator>+
ItemIterator
.reverse, start
Constructor and Description | +
---|
Builder(Model model,
+ de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler)
+Creates a new builder, which allows to configure and create instances of the class
+ItemIterator . |
+
Modifier and Type | +Method and Description | +
---|---|
ItemIterator |
+create()
+Creates the iterator, which has been configured by using the builder.
+ |
+
reverse, start
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Builder(@NonNull + Model model, + @NonNull + de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler)+
ItemIterator
.model
- The model, which belongs to the tab switcher, whose items should be iterated by
+ the iterator, which is created by the builder, as an instance of the type Model
. The model may not be nullviewRecycler
- The view recycler, which allows to inflate the views, which are used to visualize
+ the items, which are iterated by the iterator, which is created by the builder,
+ as an instance of the class AttachedViewRecycler. The view recycler may not be
+ null@NonNull +public ItemIterator create()+
AbstractItemIterator.AbstractBuilder
create
in class AbstractItemIterator.AbstractBuilder<ItemIterator.Builder,ItemIterator>
ItemIterator
. The iterator may not be nullpublic class ItemIterator +extends AbstractItemIterator+
TabSwitcher
.Modifier and Type | +Class and Description | +
---|---|
static class |
+ItemIterator.Builder
+A builder, which allows to configure and create instances of the class
+ItemIterator . |
+
AbstractItemIterator.AbstractBuilder<BuilderType extends AbstractItemIterator.AbstractBuilder<?,ProductType>,ProductType extends AbstractItemIterator>
Modifier and Type | +Method and Description | +
---|---|
int |
+getCount()
+The method, which is invoked on subclasses in order to retrieve the total number of available
+ items.
+ |
+
AbstractItem |
+getItem(int index)
+The method, which is invoked on subclasses in order to retrieve the item, which corresponds
+ to a specific index.
+ |
+
first, hasNext, initialize, next, peek, previous
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
public final int getCount()+
AbstractItemIterator
getCount
in class AbstractItemIterator
Integer
value@NonNull +public final AbstractItem getItem(int index)+
AbstractItemIterator
getItem
in class AbstractItemIterator
index
- The index of the item, which should be returned, as an Integer
valueAbstractItem
. The item may not be nullClass | +Description | +
---|---|
AbstractItemIterator | +
+ An abstract base class for all iterators, which allow to iterate items of the type
+AbstractItem . |
+
AbstractItemIterator.AbstractBuilder<BuilderType extends AbstractItemIterator.AbstractBuilder<?,ProductType>,ProductType extends AbstractItemIterator> | +
+ An abstract base class of all builders, which allows to configure and create instances of the
+ class
+AbstractItemIterator . |
+
ArrayItemIterator | +
+ An iterator, which allows to iterate the items, which correspond to the tabs, which are
+ contained by an array.
+ |
+
ArrayItemIterator.Builder | +
+ A builder, which allows to configure an create instances of the class
+ArrayItemIterator . |
+
ItemIterator | +
+ An iterator, which allows to iterate the items, which correspond to the child views of a
+TabSwitcher . |
+
ItemIterator.Builder | +
+ A builder, which allows to configure and create instances of the class
+ItemIterator . |
+
public abstract class AbstractArithmetics +extends java.lang.Object +implements Arithmetics+
TabSwitcher
's tabs.Arithmetics.Axis
Constructor and Description | +
---|
AbstractArithmetics(TabSwitcher tabSwitcher)
+Creates a new class, which provides methods, which allow to calculate the position, size and
+ rotation of a
+TabSwitcher 's tabs. |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+animatePosition(Arithmetics.Axis axis,
+ android.view.ViewPropertyAnimator animator,
+ AbstractItem item,
+ float position)
+Animates the position of an item on a specific axis.
+ |
+
float |
+getScale(AbstractItem item)
+Returns the scale of an item, depending on its margin.
+ |
+
float |
+getTabContainerSize(Arithmetics.Axis axis)
+Returns the size of the container, which contains the tab switcher's tabs, on a specific
+ axis.
+ |
+
protected TabSwitcher |
+getTabSwitcher()
+Returns the tab switcher, the arithmetics are calculated for.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
animatePosition, animateRotation, animateScale, getPivot, getPosition, getRotation, getScale, getSize, getTabContainerSize, getTabSwitcherPadding, getTouchPosition, setPivot, setPosition, setRotation, setScale
public AbstractArithmetics(@NonNull + TabSwitcher tabSwitcher)+
TabSwitcher
's tabs.tabSwitcher
- The tab switcher, the arithmetics should be calculated for, as an instance of the
+ class TabSwitcher
. The tab switcher may not be null@NonNull +protected final TabSwitcher getTabSwitcher()+
TabSwitcher
. The tab switcher may not be nullpublic final float getTabContainerSize(@NonNull + Arithmetics.Axis axis)+
Arithmetics
getTabContainerSize
in interface Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullFloat
valuepublic final void animatePosition(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.ViewPropertyAnimator animator, + @NonNull + AbstractItem item, + float position)+
Arithmetics
animatePosition
in interface Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, which should be used to animate the position, as an instance of the
+ class ViewPropertyAnimator
. The animator may not be nullitem
- The item, whose position should be animated, as an instance of the class View
. The view may not be nullposition
- The position, which should be set by the animation, as a Float
valuepublic final float getScale(@NonNull + AbstractItem item)+
Arithmetics
getScale
in interface Arithmetics
item
- The item, whose scale should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
valuepublic static interface AbstractDragTabsEventHandler.Callback
+Modifier and Type | +Method and Description | +
---|---|
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.
+ |
+
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.
+ |
+
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 |
+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.
+ |
+
@Nullable +AbstractDragTabsEventHandler.DragState onDrag(@NonNull + AbstractDragTabsEventHandler.DragState dragState, + float dragDistance)+
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 otherwisevoid onPressStarted(@NonNull + AbstractItem item)+
item
- The item, which corresponds to the view, which has been pressed, as an instance
+ of the class AbstractItem
. The item may not be nullvoid onPressEnded(@NonNull + AbstractItem item)+
item
- Tge item, which corresponds to the view, which was previously pressed, as an
+ instance of the class AbstractItem
. The item may not be nullvoid onClick(@NonNull + AbstractItem item)+
item
- The item, which corresponds to the view, which has been clicked, as an instance
+ of the class AbstractItem
. The item may not be nullvoid onFling(float distance, + long duration)+
distance
- The distance of the fling in pixels as a Float
valueduration
- The duration of the fling in milliseconds as a Long
valuevoid onCancelFling()+
void onRevertStartOvershoot()+
void onRevertEndOvershoot()+
void onSwipe(@NonNull + TabItem tabItem, + float distance)+
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
valuevoid onSwipeEnded(@NonNull + TabItem tabItem, + boolean remove, + float velocity)+
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 static enum AbstractDragTabsEventHandler.DragState +extends java.lang.Enum<AbstractDragTabsEventHandler.DragState>+
TabSwitcher
.Enum Constant and Description | +
---|
DRAG_TO_END
+When the tabs are dragged towards the end.
+ |
+
DRAG_TO_START
+When the tabs are dragged towards the start.
+ |
+
NONE
+When no dragging gesture is being performed.
+ |
+
OVERSHOOT_END
+When an overshoot at the end is being performed.
+ |
+
OVERSHOOT_START
+When an overshoot at the start is being performed.
+ |
+
PULLING_DOWN
+When the currently selected tab is pulled down.
+ |
+
SWIPE
+When a tab is swiped.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static AbstractDragTabsEventHandler.DragState |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static AbstractDragTabsEventHandler.DragState[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final AbstractDragTabsEventHandler.DragState NONE+
public static final AbstractDragTabsEventHandler.DragState DRAG_TO_START+
public static final AbstractDragTabsEventHandler.DragState DRAG_TO_END+
public static final AbstractDragTabsEventHandler.DragState OVERSHOOT_START+
public static final AbstractDragTabsEventHandler.DragState OVERSHOOT_END+
public static final AbstractDragTabsEventHandler.DragState SWIPE+
public static final AbstractDragTabsEventHandler.DragState PULLING_DOWN+
public static AbstractDragTabsEventHandler.DragState[] values()+
+for (AbstractDragTabsEventHandler.DragState c : AbstractDragTabsEventHandler.DragState.values()) + System.out.println(c); +
public static AbstractDragTabsEventHandler.DragState valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullCallbackType
- The type of the drag handler's callbackpublic abstract class AbstractDragTabsEventHandler<CallbackType extends AbstractDragTabsEventHandler.Callback> +extends AbstractTouchEventHandler+
Modifier and Type | +Class and Description | +
---|---|
static interface |
+AbstractDragTabsEventHandler.Callback
+Defines the interface, a class, which should be notified about the events of a drag handler,
+ must implement.
+ |
+
static class |
+AbstractDragTabsEventHandler.DragState
+Contains all possible states of dragging gestures, which can be performed on a
+TabSwitcher . |
+
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description | +
---|
AbstractDragTabsEventHandler(TabSwitcher tabSwitcher,
+ Arithmetics arithmetics,
+ boolean swipeEnabled)
+Creates a new drag handler, which allows to calculate the position and state of tabs on touch
+ events.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
protected Arithmetics |
+getArithmetics()
+Returns the arithmetics, which are used to calculate the positions, size and rotation of
+ tabs.
+ |
+
protected CallbackType |
+getCallback()
+Returns the callback, which should be notified about the drag handler's events.
+ |
+
protected abstract AbstractItem |
+getFocusedItem(float position)
+The method, which is invoked on implementing subclasses in order to retrieve the item, which
+ corresponds to the view, which is focused when clicking/dragging at a specific position.
+ |
+
boolean |
+handleDrag(float dragPosition,
+ float orthogonalPosition)
+Handles drag gestures.
+ |
+
boolean |
+isDragging()
+Returns, whether a drag gesture is currently handled by the event handler, or not.
+ |
+
protected boolean |
+isDraggingAllowed()
+Returns, whether performing a drag gesture is currently allowed, or not.
+ |
+
protected boolean |
+isSwipeThresholdReached(TabItem swipedTabItem)
+Returns, whether the threshold of a swiped tab item, which causes the corresponding tab to be
+ removed, has been reached, or not.
+ |
+
protected void |
+onDown(android.view.MotionEvent event)
+The method, which is invoked on implementing subclasses in order to handle, when a drag
+ gesture has been started.
+ |
+
protected void |
+onDrag(android.view.MotionEvent event)
+The method, which is invoked on implementing subclasses in order to handle, when a drag
+ gesture is performed.
+ |
+
protected float |
+onOvershootEnd(float dragPosition,
+ float overshootThreshold)
+The method, which is invoked on implementing subclasses, when the tabs are overshooting at
+ the end.
+ |
+
protected void |
+onOvershootReverted()
+The method, which is invoked on implementing subclasses, when an overshoot has been reverted.
+ |
+
protected float |
+onOvershootStart(float dragPosition,
+ float overshootThreshold)
+The method, which is invoked on implementing subclasses, when the tabs are overshooting at
+ the start.
+ |
+
protected void |
+onReset()
+The method, which invoked on implementing subclasses, when the drag handler has been reset.
+ |
+
protected void |
+onTouchEvent()
+The method, which is invoked on implementing subclasses, when a touch event is about to be
+ handled.
+ |
+
void |
+onUp(android.view.MotionEvent event)
+Handles, when a drag gesture has been ended.
+ |
+
void |
+reset()
+Resets the event handler once a drag gesture has been ended.
+ |
+
void |
+setCallback(CallbackType callback)
+Sets the callback, which should be notified about the drag handler's events.
+ |
+
void |
+setDragState(AbstractDragTabsEventHandler.DragState dragState)
+Sets the state of the currently performed drag gesture.
+ |
+
compare, equals, getDragHelper, getPriority, getTabSwitcher, getTouchableArea, getVelocityTracker, handleTouchEvent, hashCode, isInsideTouchableArea, isReset, setPointerId
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public AbstractDragTabsEventHandler(@NonNull + TabSwitcher tabSwitcher, + @NonNull + Arithmetics arithmetics, + boolean swipeEnabled)+
tabSwitcher
- The tab switcher, whose tabs' positions and states should be calculated by the drag
+ handler, as an instance of the class TabSwitcher
. The tab switcher may not be
+ nullarithmetics
- The arithmetics, which should be used to calculate the position, size and rotation of
+ tabs, as an instance of the type Arithmetics
. The arithmetics may not be
+ nullswipeEnabled
- True, if tabs can be swiped on the orthogonal axis, false otherwise@NonNull +protected Arithmetics getArithmetics()+
Arithmetics
. The arithmetics may not be null@Nullable +protected CallbackType getCallback()+
protected abstract AbstractItem getFocusedItem(float position)+
position
- The position on the dragging axis in pixels as a Float
valueAbstractItem
or null, if no view is focusedprotected float onOvershootStart(float dragPosition, + float overshootThreshold)+
dragPosition
- The position of the pointer on the dragging axis in pixels as a Float
valueovershootThreshold
- The position on the dragging axis, an overshoot at the start currently starts at, in
+ pixels as a Float
valueFloat
valueprotected float onOvershootEnd(float dragPosition, + float overshootThreshold)+
dragPosition
- The position of the pointer on the dragging axis in pixels as a Float
valueovershootThreshold
- The position on the dragging axis, an overshoot at the end currently starts at, in
+ pixels as a Float
valueFloat
valueprotected void onOvershootReverted()+
protected void onReset()+
protected boolean isSwipeThresholdReached(@NonNull + TabItem swipedTabItem)+
swipedTabItem
- The swiped tab item as an instance of the class TabItem
. The tab item may not
+ be nullpublic final void setCallback(@Nullable + CallbackType callback)+
callback
- The callback, which should be set, as an instance of the generic type CallbackType or
+ null, if no callback should be notifiedpublic final void setDragState(@NonNull + AbstractDragTabsEventHandler.DragState dragState)+
dragState
- The state, which should be set, as a value of the enum AbstractDragTabsEventHandler.DragState
. The state
+ may not be nullpublic final boolean handleDrag(float dragPosition, + float orthogonalPosition)+
dragPosition
- The position of the pointer on the dragging axis in pixels as a Float
valueorthogonalPosition
- The position of the pointer of the orthogonal axis in pixels as a Float
+ valuepublic final boolean isDragging()+
AbstractTouchEventHandler
isDragging
in class AbstractTouchEventHandler
public final void reset()+
AbstractTouchEventHandler
reset
in class AbstractTouchEventHandler
protected final boolean isDraggingAllowed()+
AbstractTouchEventHandler
isDraggingAllowed
in class AbstractTouchEventHandler
protected final void onTouchEvent()+
AbstractTouchEventHandler
onTouchEvent
in class AbstractTouchEventHandler
protected final void onDown(@NonNull + android.view.MotionEvent event)+
AbstractTouchEventHandler
onDown
in class AbstractTouchEventHandler
event
- The touch event, which started the drag gesture, as an instance of the class MotionEvent
. The touch event may not be nullprotected final void onDrag(@NonNull + android.view.MotionEvent event)+
AbstractTouchEventHandler
onDrag
in class AbstractTouchEventHandler
event
- The last touch event of the drag gesture as an instance of the class MotionEvent
. The touch event may not be nullpublic final void onUp(@Nullable + android.view.MotionEvent event)+
AbstractTouchEventHandler
onUp
in class AbstractTouchEventHandler
event
- The touch event, which ended the drag gesture, as an instance of the class MotionEvent
or null, if no fling animation should be triggeredpublic abstract class AbstractTabRecyclerAdapter +extends de.mrapp.android.util.view.AbstractViewRecycler.Adapter<AbstractItem,java.lang.Integer> +implements Tab.Callback, Model.Listener+
TabSwitcher
.Constructor and Description | +
---|
AbstractTabRecyclerAdapter(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 abstract Layout |
+getLayout()
+The method, which is invoked on implementing subclasses in order to retrieve the layout,
+ which is used by the tab switcher.
+ |
+
protected TabSwitcherModel |
+getModel()
+Returns the model of the tab switcher.
+ |
+
protected TabSwitcherStyle |
+getStyle()
+Returns the style, which allow to retrieve style attributes of the tab switcher.
+ |
+
protected TabItem |
+getTabItem(Tab tab)
+Returns the tab item, which corresponds to a specific tab.
+ |
+
protected TabSwitcher |
+getTabSwitcher()
+Returns the tab switcher, which contains the tabs.
+ |
+
protected de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,java.lang.Integer> |
+getViewRecyclerOrThrowException()
+Returns the view recycler, the adapter is bound to, or throws an
+IllegalStateException , if no view recycler has been set. |
+
int |
+getViewType(AbstractItem item) |
+
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 |
+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,
+ boolean selectionChanged,
+ 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 |
+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 |
+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.
+ |
+
protected abstract 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 |
+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.
+ |
+
protected abstract 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 |
+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 |
+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,
+ AbstractItem item) |
+
void |
+onSelectionChanged(int previousIndex,
+ int index,
+ Tab selectedTab,
+ boolean switcherHidden)
+The method, which is invoked, when the currently selected tab has been changed.
+ |
+
protected abstract 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 |
+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 selectionChanged,
+ 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,
+ boolean selectionChanged,
+ 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,
+ 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.
+ |
+
void |
+setViewRecycler(de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,java.lang.Integer> viewRecycler)
+Sets the view recycler, which allows to inflate the views, which are used to visualize tabs.
+ |
+
getViewTypeCount
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AbstractTabRecyclerAdapter(@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 switcher, as
+ an instance of the class TabSwitcherStyle
. The style 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 TabSwitcherStyle getStyle()+
TabSwitcherStyle
. The style may not be null@Nullable +protected final TabItem getTabItem(@NonNull + Tab tab)+
@NonNull +protected final de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,java.lang.Integer> getViewRecyclerOrThrowException()+
IllegalStateException
, if no view recycler has been set.protected void onAdaptBackgroundColor(int color, + @NonNull + TabItem tabItem)+
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 abstract android.view.View onInflateTabView(@NonNull + android.view.LayoutInflater inflater, + @Nullable + android.view.ViewGroup parent, + @NonNull + AbstractTabViewHolder viewHolder)+
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 abstract void onShowTabView(@NonNull + android.view.View view, + @NonNull + TabItem tabItem, + @NonNull + java.lang.Integer... params)+
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 abstract AbstractTabViewHolder onCreateTabViewHolder()+
AbstractTabViewHolder
. The view holder may not be null@NonNull +protected abstract Layout getLayout()+
Layout
.
+ The layout may not be nullpublic final void setViewRecycler(@NonNull + de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,java.lang.Integer> viewRecycler)+
viewRecycler
- The view recycler, which should be set, as an instance of the class
+ AttachedViewRecycler. The view recycler may not be nullpublic 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 nullpublic final 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 final void onSwitcherShown()+
Model.Listener
onSwitcherShown
in interface Model.Listener
public final void onSwitcherHidden()+
Model.Listener
onSwitcherHidden
in interface Model.Listener
public final void onSelectionChanged(int previousIndex, + int index, + @Nullable + Tab selectedTab, + boolean switcherHidden)+
Model.Listener
onSelectionChanged
in interface Model.Listener
previousIndex
- 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, + @NonNull + Tab tab, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + boolean switcherVisibilityChanged, + @NonNull + Animation animation)+
Model.Listener
onTabAdded
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection has changed, false otherwiseswitcherVisibilityChanged
- 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, + @NonNull + Tab[] tabs, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + @NonNull + Animation animation)+
Model.Listener
onAllTabsAdded
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection has changed, false otherwiseanimation
- 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, + @NonNull + Tab tab, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + @NonNull + Animation animation)+
Model.Listener
onTabRemoved
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection changed, false otherwiseanimation
- 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(@NonNull + Tab[] tabs, + @NonNull + Animation animation)+
Model.Listener
onAllTabsRemoved
in interface Model.Listener
tabs
- 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 void onPaddingChanged(int left, + int top, + int right, + int bottom)+
Model.Listener
onPaddingChanged
in interface Model.Listener
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 void onApplyPaddingToTabsChanged(boolean applyPaddingToTabs)+
Model.Listener
onApplyPaddingToTabsChanged
in interface Model.Listener
applyPaddingToTabs
- True, if the padding of the tab switcher is applied to the content of its tabs,
+ false otherwisepublic 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 set@CallSuper +public 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 final 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 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 onEmptyViewChanged(@Nullable + android.view.View view, + long animationDuration)+
Model.Listener
onEmptyViewChanged
in interface Model.Listener
view
- 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 usedpublic final void onTitleChanged(@NonNull + Tab tab)+
Tab.Callback
onTitleChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onIconChanged(@NonNull + Tab tab)+
Tab.Callback
onIconChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onCloseableChanged(@NonNull + Tab tab)+
Tab.Callback
onCloseableChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onCloseButtonIconChanged(@NonNull + Tab tab)+
Tab.Callback
onCloseButtonIconChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onBackgroundColorChanged(@NonNull + Tab tab)+
Tab.Callback
onBackgroundColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic void onContentBackgroundColorChanged(@NonNull + Tab tab)+
Tab.Callback
onContentBackgroundColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onTitleTextColorChanged(@NonNull + Tab tab)+
Tab.Callback
onTitleTextColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onProgressBarVisibilityChanged(@NonNull + Tab tab)+
Tab.Callback
onProgressBarVisibilityChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onProgressBarColorChanged(@NonNull + Tab tab)+
Tab.Callback
onProgressBarColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ null@CallSuper +public int getViewType(@NonNull + AbstractItem item)+
getViewType
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<AbstractItem,java.lang.Integer>
@CallSuper + @NonNull +public 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 de.mrapp.android.util.view.AbstractViewRecycler.Adapter<AbstractItem,java.lang.Integer>
@CallSuper +public 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 de.mrapp.android.util.view.AbstractViewRecycler.Adapter<AbstractItem,java.lang.Integer>
@CallSuper +public void onRemoveView(@NonNull + android.view.View view, + @NonNull + AbstractItem item)+
onRemoveView
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<AbstractItem,java.lang.Integer>
protected class AbstractTabSwitcherLayout.AnimationListenerWrapper
+extends android.animation.AnimatorListenerAdapter
+Constructor and Description | +
---|
AnimationListenerWrapper(android.animation.Animator.AnimatorListener listener)
+Creates a new 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.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+onAnimationCancel(android.animation.Animator animation) |
+
void |
+onAnimationEnd(android.animation.Animator animation) |
+
void |
+onAnimationStart(android.animation.Animator animation) |
+
onAnimationPause, onAnimationRepeat, onAnimationResume
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onAnimationEnd, onAnimationStart
public AnimationListenerWrapper(@Nullable + android.animation.Animator.AnimatorListener listener)+
listener
- The listener, which should be encapsulated, as an instance of the type Animator.AnimatorListener
or null, if no listener should be encapsulatedpublic void onAnimationStart(android.animation.Animator animation)+
onAnimationStart
in interface android.animation.Animator.AnimatorListener
onAnimationStart
in class android.animation.AnimatorListenerAdapter
public void onAnimationEnd(android.animation.Animator animation)+
onAnimationEnd
in interface android.animation.Animator.AnimatorListener
onAnimationEnd
in class android.animation.AnimatorListenerAdapter
public void onAnimationCancel(android.animation.Animator animation)+
onAnimationCancel
in interface android.animation.Animator.AnimatorListener
onAnimationCancel
in class android.animation.AnimatorListenerAdapter
public static interface AbstractTabSwitcherLayout.Callback
+Modifier and Type | +Method and Description | +
---|---|
void |
+onAnimationsEnded() |
+
protected class AbstractTabSwitcherLayout.InitialItemIterator +extends AbstractItemIterator+
TabSwitcher
. When an item is referenced for the first time, its initial position
+ and state is calculated and the item is stored in a backing array. When the item is
+ iterated again, it is retrieved from the backing array.AbstractItemIterator.AbstractBuilder<BuilderType extends AbstractItemIterator.AbstractBuilder<?,ProductType>,ProductType extends AbstractItemIterator>
Modifier and Type | +Method and Description | +
---|---|
int |
+getCount()
+The method, which is invoked on subclasses in order to retrieve the total number of available
+ items.
+ |
+
AbstractItem |
+getItem(int index)
+The method, which is invoked on subclasses in order to retrieve the item, which corresponds
+ to a specific index.
+ |
+
first, hasNext, initialize, next, peek, previous
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
public final int getCount()+
AbstractItemIterator
getCount
in class AbstractItemIterator
Integer
value@NonNull +public final AbstractItem getItem(int index)+
AbstractItemIterator
getItem
in class AbstractItemIterator
index
- The index of the item, which should be returned, as an Integer
valueAbstractItem
. The item may not be nullprotected class AbstractTabSwitcherLayout.InitialItemIteratorBuilder +extends AbstractItemIterator.AbstractBuilder<AbstractTabSwitcherLayout.InitialItemIteratorBuilder,AbstractTabSwitcherLayout.InitialItemIterator>+
AbstractTabSwitcherLayout.InitialItemIterator
.reverse, start
Constructor and Description | +
---|
InitialItemIteratorBuilder(AbstractItem[] backingArray)
+Creates a new builder, which allows to configure and create instances of the class
+
+AbstractTabSwitcherLayout.InitialItemIterator . |
+
Modifier and Type | +Method and Description | +
---|---|
AbstractTabSwitcherLayout.InitialItemIterator |
+create()
+Creates the iterator, which has been configured by using the builder.
+ |
+
reverse, start
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public InitialItemIteratorBuilder(@NonNull + AbstractItem[] backingArray)+
AbstractTabSwitcherLayout.InitialItemIterator
.backingArray
- The backing array, which should be used to store items, once their initial
+ position and state has been calculated. The backing array may not be null@NonNull +public AbstractTabSwitcherLayout.InitialItemIterator create()+
AbstractItemIterator.AbstractBuilder
create
in class AbstractItemIterator.AbstractBuilder<AbstractTabSwitcherLayout.InitialItemIteratorBuilder,AbstractTabSwitcherLayout.InitialItemIterator>
ItemIterator
. The iterator may not be nullpublic static class AbstractTabSwitcherLayout.LayoutListenerWrapper
+extends java.lang.Object
+implements android.view.ViewTreeObserver.OnGlobalLayoutListener
+Constructor and Description | +
---|
LayoutListenerWrapper(android.view.View view,
+ android.view.ViewTreeObserver.OnGlobalLayoutListener listener)
+Creates a new layout listener, which unregisters itself from the observed view, when
+ invoked.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+onGlobalLayout() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public LayoutListenerWrapper(@NonNull + android.view.View view, + @Nullable + android.view.ViewTreeObserver.OnGlobalLayoutListener listener)+
view
- The observed view as an instance of the class View
. The view may not be
+ nulllistener
- The listener, which should be encapsulated, as an instance of the type ViewTreeObserver.OnGlobalLayoutListener
or null, if no listener should be encapsulatedpublic 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.
+ |
+
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 otherwisepublic 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
public abstract class AbstractTabViewHolder
+extends java.lang.Object
+TabSwitcher
consists of.Modifier and Type | +Field and Description | +
---|---|
android.widget.ImageButton |
+closeButton
+The close button of a tab.
+ |
+
android.widget.ImageView |
+iconImageView
+The image view, which is used to display the icon of a tab.
+ |
+
de.mrapp.android.view.CircularProgressBar |
+progressBar
+The progress bar of a tab.
+ |
+
android.view.ViewGroup |
+titleContainer
+The view group, which contains the title and close button of a tab.
+ |
+
android.widget.TextView |
+titleTextView
+The text view, which is used to display the title of a tab.
+ |
+
Constructor and Description | +
---|
AbstractTabViewHolder() |
+
public android.view.ViewGroup titleContainer+
public android.widget.TextView titleTextView+
public android.widget.ImageView iconImageView+
public de.mrapp.android.view.CircularProgressBar progressBar+
public android.widget.ImageButton closeButton+
public static enum Arithmetics.Axis +extends java.lang.Enum<Arithmetics.Axis>+
TabSwitcher
can be moved.Enum Constant and Description | +
---|
DRAGGING_AXIS
+The axis on which a tab is moved when dragging it.
+ |
+
ORTHOGONAL_AXIS
+The axis on which a tab is moved, when it is added to or removed from the switcher.
+ |
+
X_AXIS
+The horizontal axis.
+ |
+
Y_AXIS
+The vertical axis.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static Arithmetics.Axis |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static Arithmetics.Axis[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final Arithmetics.Axis DRAGGING_AXIS+
public static final Arithmetics.Axis ORTHOGONAL_AXIS+
public static final Arithmetics.Axis X_AXIS+
public static final Arithmetics.Axis Y_AXIS+
public static Arithmetics.Axis[] values()+
+for (Arithmetics.Axis c : Arithmetics.Axis.values()) + System.out.println(c); +
public static Arithmetics.Axis valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic interface Arithmetics
+TabSwitcher
's children, must implement.Modifier and Type | +Interface and Description | +
---|---|
static class |
+Arithmetics.Axis
+Contains all axes on which the tabs of a
+TabSwitcher can be moved. |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+animatePosition(Arithmetics.Axis axis,
+ android.view.ViewPropertyAnimator animator,
+ AbstractItem item,
+ float position)
+Animates the position of an item on a specific axis.
+ |
+
void |
+animatePosition(Arithmetics.Axis axis,
+ android.view.ViewPropertyAnimator animator,
+ AbstractItem item,
+ float position,
+ boolean includePadding)
+Animates the position of an item on a specific axis.
+ |
+
void |
+animateRotation(Arithmetics.Axis axis,
+ android.view.ViewPropertyAnimator animator,
+ float angle)
+Animates the rotation of an item on a specific axis.
+ |
+
void |
+animateScale(Arithmetics.Axis axis,
+ android.view.ViewPropertyAnimator animator,
+ float scale)
+Animates the scale of an item on a specific axis.
+ |
+
float |
+getPivot(Arithmetics.Axis axis,
+ AbstractItem item,
+ AbstractDragTabsEventHandler.DragState dragState)
+Returns the pivot of an item on a specific axis, depending on the current drag state.
+ |
+
float |
+getPosition(Arithmetics.Axis axis,
+ AbstractItem item)
+Returns the position of a specific item on a specific axis.
+ |
+
float |
+getRotation(Arithmetics.Axis axis,
+ AbstractItem item)
+Returns the rotation of an item on a specific axis.
+ |
+
float |
+getScale(AbstractItem item)
+Returns the scale of an item, depending on its margin.
+ |
+
float |
+getScale(AbstractItem item,
+ boolean includePadding)
+Returns the scale of an item, depending on its margin.
+ |
+
float |
+getSize(Arithmetics.Axis axis,
+ AbstractItem item)
+Returns the size of an item on a specific axis.
+ |
+
float |
+getTabContainerSize(Arithmetics.Axis axis)
+Returns the size of the container, which contains the tab switcher's tabs, on a specific
+ axis.
+ |
+
float |
+getTabContainerSize(Arithmetics.Axis axis,
+ boolean includePadding)
+Returns the size of the container, which contains the tab switcher's tabs, on a specific
+ axis.
+ |
+
int |
+getTabSwitcherPadding(Arithmetics.Axis axis,
+ int gravity)
+Returns the padding of the tab switcher on a specific axis and using a specific gravity.
+ |
+
float |
+getTouchPosition(Arithmetics.Axis axis,
+ android.view.MotionEvent event)
+Returns the position of a touch event on a specific axis.
+ |
+
void |
+setPivot(Arithmetics.Axis axis,
+ AbstractItem item,
+ float pivot)
+Sets the pivot of an item on a specific axis.
+ |
+
void |
+setPosition(Arithmetics.Axis axis,
+ AbstractItem item,
+ float position)
+Sets the position of an item on a specific axis.
+ |
+
void |
+setRotation(Arithmetics.Axis axis,
+ AbstractItem item,
+ float angle)
+Sets the rotation of an item on a specific axis.
+ |
+
void |
+setScale(Arithmetics.Axis axis,
+ AbstractItem item,
+ float scale)
+Sets the scale of an item on a specific axis.
+ |
+
int getTabSwitcherPadding(@NonNull + Arithmetics.Axis axis, + int gravity)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullgravity
- The gravity as an Integer
value. The gravity must be
+ Gravity.START
or Gravity.END
Integer
valuefloat getTabContainerSize(@NonNull + Arithmetics.Axis axis)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullFloat
valuefloat getTabContainerSize(@NonNull + Arithmetics.Axis axis, + boolean includePadding)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullincludePadding
- True, if the padding and the size of the toolbars should be included, false
+ otherwiseFloat
valuefloat getTouchPosition(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.MotionEvent event)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullevent
- The touch event, whose position should be returned, as an instance of the class
+ MotionEvent
. The motion event may not be nullFloat
valuefloat getPosition(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose position should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
valuevoid setPosition(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float position)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose position should be set, as an instance of the class AbstractItem
. The item may not be nullposition
- The position, which should be set, as a Float
valuevoid animatePosition(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.ViewPropertyAnimator animator, + @NonNull + AbstractItem item, + float position)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, which should be used to animate the position, as an instance of the
+ class ViewPropertyAnimator
. The animator may not be nullitem
- The item, whose position should be animated, as an instance of the class View
. The view may not be nullposition
- The position, which should be set by the animation, as a Float
valuevoid animatePosition(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.ViewPropertyAnimator animator, + @NonNull + AbstractItem item, + float position, + boolean includePadding)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, which should be used to animate the position, as an instance of the
+ class ViewPropertyAnimator
. The animator may not be nullitem
- The item, whose position should be animated, as an instance of the class View
. The view may not be nullposition
- The position, which should be set by the animation, as a Float
valueincludePadding
- True, if the item's padding should be taken into account, false otherwisefloat getScale(@NonNull + AbstractItem item)+
item
- The item, whose scale should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
valuefloat getScale(@NonNull + AbstractItem item, + boolean includePadding)+
item
- The item, whose scale should be returned, as an instance of the class AbstractItem
. The item may not be nullincludePadding
- True, if the item's padding should be taken into account as well, false otherwiseFloat
valuevoid setScale(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float scale)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose scale should be set, as an instance of the class AbstractItem
. The item may not be nullscale
- The scale, which should be set, as a Float
valuevoid animateScale(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.ViewPropertyAnimator animator, + float scale)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, which should be used to animate the scale, as an instance of the class
+ ViewPropertyAnimator
. The animator may not be nullscale
- The scale, which should be set by the animation, as a Float
valuefloat getSize(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose size should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
valuefloat getPivot(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + @NonNull + AbstractDragTabsEventHandler.DragState dragState)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose pivot should be returned, as an instance of the class AbstractItem
. The item may not be nulldragState
- The current drag state as a value of the enum AbstractDragTabsEventHandler.DragState
. The drag state may
+ not be nullFloat
valuevoid setPivot(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float pivot)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose pivot should be set, as an instance of the class View
. The
+ item may not be nullpivot
- The pivot, which should be set, as a Float
valuefloat getRotation(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose rotation should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
valuevoid setRotation(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float angle)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose rotation should be set, as an instance of the class AbstractItem
. The item may not be nullangle
- The rotation, which should be set, as a Float
valuevoid animateRotation(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.ViewPropertyAnimator animator, + float angle)+
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, should be used to animate the rotation, as an instance of the class
+ ViewPropertyAnimator
. The animator may not be nullangle
- The rotation, which should be set by the animation, as a Float
valuepublic class ContentRecyclerAdapter +extends de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void> +implements Restorable, TabSwitcherListener+
TabSwitcher
, by encapsulating a TabSwitcherDecorator
.Constructor and Description | +
---|
ContentRecyclerAdapter(TabSwitcher tabSwitcher,
+ TabSwitcherDecorator decorator)
+Creates a new view recycler adapter, which allows to inflate views, which are associated with
+ the tabs of a
+TabSwitcher , by encapsulating a TabSwitcherDecorator . |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+clearAllSavedStates()
+Clears the saved states of all tabs.
+ |
+
void |
+clearSavedState(Tab tab)
+Clears the saved state of a specific tab.
+ |
+
int |
+getViewType(Tab item) |
+
int |
+getViewTypeCount() |
+
void |
+onAllTabsRemoved(TabSwitcher tabSwitcher,
+ Tab[] tabs,
+ Animation animation)
+The method, which is invoked, when all tabs have been removed from the tab switcher.
+ |
+
android.view.View |
+onInflateView(android.view.LayoutInflater inflater,
+ android.view.ViewGroup parent,
+ Tab item,
+ int viewType,
+ java.lang.Void... params) |
+
void |
+onRemoveView(android.view.View view,
+ Tab item) |
+
void |
+onSelectionChanged(TabSwitcher tabSwitcher,
+ int selectedTabIndex,
+ Tab selectedTab)
+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(TabSwitcher tabSwitcher)
+The method, which is invoked, when the tab switcher has been hidden.
+ |
+
void |
+onSwitcherShown(TabSwitcher tabSwitcher)
+The method, which is invoked, when the tab switcher has been shown.
+ |
+
void |
+onTabAdded(TabSwitcher tabSwitcher,
+ int index,
+ Tab tab,
+ Animation animation)
+The method, which is invoked, when a tab has been added to the tab switcher.
+ |
+
void |
+onTabRemoved(TabSwitcher tabSwitcher,
+ int index,
+ Tab tab,
+ Animation animation)
+The method, which is invoked, when a tab has been removed from the tab switcher.
+ |
+
void |
+restoreInstanceState(android.os.Bundle savedInstanceState)
+Restores a previously saved state.
+ |
+
void |
+saveInstanceState(android.os.Bundle outState)
+Saves the current state.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public ContentRecyclerAdapter(@NonNull + TabSwitcher tabSwitcher, + @NonNull + TabSwitcherDecorator decorator)+
TabSwitcher
, by encapsulating a TabSwitcherDecorator
.tabSwitcher
- The tab switcher, which contains the tabs, whose associated views are inflated by the
+ adapter, correspond to, as an instance of the class TabSwitcher
. The tab
+ switcher may not be nulldecorator
- The decorator, which should be used to inflate the associated views, as an instance
+ of the class TabSwitcherDecorator
. The decorator may not be nullpublic void clearSavedState(@NonNull + Tab tab)+
tab
- The tab, whose saved state should be cleared, as an instance of the class Tab
. The tab may not be nullpublic void clearAllSavedStates()+
@NonNull +public final android.view.View onInflateView(@NonNull + android.view.LayoutInflater inflater, + @Nullable + android.view.ViewGroup parent, + @NonNull + Tab item, + int viewType, + @NonNull + java.lang.Void... params)+
onInflateView
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void>
public final void onShowView(@NonNull + android.content.Context context, + @NonNull + android.view.View view, + @NonNull + Tab item, + boolean inflated, + @NonNull + java.lang.Void... params)+
onShowView
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void>
public final void onRemoveView(@NonNull + android.view.View view, + @NonNull + Tab item)+
onRemoveView
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void>
public final int getViewTypeCount()+
getViewTypeCount
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void>
public final int getViewType(@NonNull + Tab item)+
getViewType
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void>
public final void saveInstanceState(@NonNull + android.os.Bundle outState)+
Restorable
saveInstanceState
in interface Restorable
outState
- 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(@Nullable + android.os.Bundle savedInstanceState)+
Restorable
restoreInstanceState
in interface Restorable
savedInstanceState
- The saved state as an instance of the class Bundle
or null, if no saved state
+ is availablepublic final void onSwitcherShown(@NonNull + TabSwitcher tabSwitcher)+
TabSwitcherListener
onSwitcherShown
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullpublic final void onSwitcherHidden(@NonNull + TabSwitcher tabSwitcher)+
TabSwitcherListener
onSwitcherHidden
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullpublic final void onSelectionChanged(@NonNull + TabSwitcher tabSwitcher, + int selectedTabIndex, + @Nullable + Tab selectedTab)+
TabSwitcherListener
onSelectionChanged
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullselectedTabIndex
- 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 tabspublic final void onTabAdded(@NonNull + TabSwitcher tabSwitcher, + int index, + @NonNull + Tab tab, + @NonNull + Animation animation)+
TabSwitcherListener
onTabAdded
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullindex
- 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 nullanimation
- 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 onTabRemoved(@NonNull + TabSwitcher tabSwitcher, + int index, + @NonNull + Tab tab, + @NonNull + Animation animation)+
TabSwitcherListener
onTabRemoved
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullindex
- 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 nullanimation
- 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(@NonNull + TabSwitcher tabSwitcher, + @NonNull + Tab[] tabs, + @NonNull + Animation animation)+
TabSwitcherListener
onAllTabsRemoved
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nulltabs
- 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 interface TabSwitcherLayout
+TabSwitcher
,
+ must implement.Modifier and Type | +Method and Description | +
---|---|
android.view.ViewGroup |
+getTabContainer()
+Returns the view group, which contains the tab switcher's tabs.
+ |
+
android.view.Menu |
+getToolbarMenu()
+Returns the menu of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
android.support.v7.widget.Toolbar[] |
+getToolbars()
+Returns the toolbars, which are shown, when the tab switcher is shown.
+ |
+
boolean |
+isAnimationRunning()
+Returns, whether an animation is currently running, or not.
+ |
+
boolean isAnimationRunning()+
@Nullable +android.view.ViewGroup getTabContainer()+
ViewGroup
or null, if the view has not been laid out yet@Nullable +android.support.v7.widget.Toolbar[] getToolbars()+
TabSwitcher.PRIMARY_TOOLBAR_INDEX
+ of the returned array corresponds to the primary toolbar and the index TabSwitcher.SECONDARY_TOOLBAR_INDEX
corresponds to the secondary toolbar.@Nullable +android.view.Menu getToolbarMenu()+
Menu
or null, if the view
+ has not been laid out yetInterface | +Description | +
---|---|
AbstractDragTabsEventHandler.Callback | +
+ Defines the interface, a class, which should be notified about the events of a drag handler,
+ must implement.
+ |
+
AbstractTabSwitcherLayout.Callback | +
+ Defines the interface, a class, which should be notified about the events of a tab switcher
+ layout, must implement.
+ |
+
Arithmetics | +
+ Defines the interface, a class, which provides methods, which allow to calculate the position,
+ size and rotation of a
+TabSwitcher 's children, must implement. |
+
TabSwitcherLayout | +
+ Defines the interface, a layout, which implements the functionality of a
+TabSwitcher ,
+ must implement. |
+
Class | +Description | +
---|---|
AbstractArithmetics | +
+ An abstract base class for all classes, which provide methods, which allow to calculate the
+ position, size and rotation of a
+TabSwitcher 's tabs. |
+
AbstractDragTabsEventHandler<CallbackType extends AbstractDragTabsEventHandler.Callback> | +
+ An abstract base class for all drag handlers, which allow to calculate the position and state of
+ tabs on touch events.
+ |
+
AbstractTabRecyclerAdapter | +
+ An abstract base class for all view recycler adapters, which allow to inflate the views, which
+ are used to visualize the tabs of a
+TabSwitcher . |
+
AbstractTabSwitcherLayout | +
+ An abstract base class for all layouts, which implement the functionality of a
+TabSwitcher . |
+
AbstractTabSwitcherLayout.LayoutListenerWrapper | +
+ A layout listener, which unregisters itself from the observed view, when invoked.
+ |
+
AbstractTabViewHolder | +
+ An abstract base class for all view holders, which allow to store references to the views, a tab
+ of a
+TabSwitcher consists of. |
+
ContentRecyclerAdapter | +
+ A view recycler adapter, which allows to inflate the views, which are associated with the tabs of
+ a
+TabSwitcher , by encapsulating a TabSwitcherDecorator . |
+
Enum | +Description | +
---|---|
AbstractDragTabsEventHandler.DragState | +
+ Contains all possible states of dragging gestures, which can be performed on a
+TabSwitcher . |
+
Arithmetics.Axis | +
+ Contains all axes on which the tabs of a
+TabSwitcher can be moved. |
+
public class PhoneArithmetics +extends AbstractArithmetics+
TabSwitcher
's tabs, when using the smartphone layout.Arithmetics.Axis
Constructor and Description | +
---|
PhoneArithmetics(TabSwitcher tabSwitcher)
+Creates a new class, which provides methods, which allow to calculate the position, size and
+ rotation of a
+TabSwitcher 's tabs, when using the smartphone layout. |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+animatePosition(Arithmetics.Axis axis,
+ android.view.ViewPropertyAnimator animator,
+ AbstractItem item,
+ float position,
+ boolean includePadding)
+Animates the position of an item on a specific axis.
+ |
+
void |
+animateRotation(Arithmetics.Axis axis,
+ android.view.ViewPropertyAnimator animator,
+ float angle)
+Animates the rotation of an item on a specific axis.
+ |
+
void |
+animateScale(Arithmetics.Axis axis,
+ android.view.ViewPropertyAnimator animator,
+ float scale)
+Animates the scale of an item on a specific axis.
+ |
+
float |
+getPivot(Arithmetics.Axis axis,
+ AbstractItem item,
+ AbstractDragTabsEventHandler.DragState dragState)
+Returns the pivot of an item on a specific axis, depending on the current drag state.
+ |
+
float |
+getPosition(Arithmetics.Axis axis,
+ AbstractItem item)
+Returns the position of a specific item on a specific axis.
+ |
+
float |
+getRotation(Arithmetics.Axis axis,
+ AbstractItem item)
+Returns the rotation of an item on a specific axis.
+ |
+
float |
+getScale(AbstractItem item,
+ boolean includePadding)
+Returns the scale of an item, depending on its margin.
+ |
+
float |
+getSize(Arithmetics.Axis axis,
+ AbstractItem item)
+Returns the size of an item on a specific axis.
+ |
+
float |
+getTabContainerSize(Arithmetics.Axis axis,
+ boolean includePadding)
+Returns the size of the container, which contains the tab switcher's tabs, on a specific
+ axis.
+ |
+
int |
+getTabSwitcherPadding(Arithmetics.Axis axis,
+ int gravity)
+Returns the padding of the tab switcher on a specific axis and using a specific gravity.
+ |
+
float |
+getTouchPosition(Arithmetics.Axis axis,
+ android.view.MotionEvent event)
+Returns the position of a touch event on a specific axis.
+ |
+
void |
+setPivot(Arithmetics.Axis axis,
+ AbstractItem item,
+ float pivot)
+Sets the pivot of an item on a specific axis.
+ |
+
void |
+setPosition(Arithmetics.Axis axis,
+ AbstractItem item,
+ float position)
+Sets the position of an item on a specific axis.
+ |
+
void |
+setRotation(Arithmetics.Axis axis,
+ AbstractItem item,
+ float angle)
+Sets the rotation of an item on a specific axis.
+ |
+
void |
+setScale(Arithmetics.Axis axis,
+ AbstractItem item,
+ float scale)
+Sets the scale of an item on a specific axis.
+ |
+
animatePosition, getScale, getTabContainerSize, getTabSwitcher
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public PhoneArithmetics(@NonNull + TabSwitcher tabSwitcher)+
TabSwitcher
's tabs, when using the smartphone layout.tabSwitcher
- The tab switcher, the arithmetics should be calculated for, as an instance of the
+ class TabSwitcher
. The tab switcher may not be nullpublic final int getTabSwitcherPadding(@NonNull + Arithmetics.Axis axis, + int gravity)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullgravity
- The gravity as an Integer
value. The gravity must be
+ Gravity.START
or Gravity.END
Integer
valuepublic final float getTabContainerSize(@NonNull + Arithmetics.Axis axis, + boolean includePadding)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullincludePadding
- True, if the padding and the size of the toolbars should be included, false
+ otherwiseFloat
valuepublic final float getTouchPosition(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.MotionEvent event)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullevent
- The touch event, whose position should be returned, as an instance of the class
+ MotionEvent
. The motion event may not be nullFloat
valuepublic final float getPosition(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose position should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
valuepublic final void setPosition(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float position)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose position should be set, as an instance of the class AbstractItem
. The item may not be nullposition
- The position, which should be set, as a Float
valuepublic final void animatePosition(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.ViewPropertyAnimator animator, + @NonNull + AbstractItem item, + float position, + boolean includePadding)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, which should be used to animate the position, as an instance of the
+ class ViewPropertyAnimator
. The animator may not be nullitem
- The item, whose position should be animated, as an instance of the class View
. The view may not be nullposition
- The position, which should be set by the animation, as a Float
valueincludePadding
- True, if the item's padding should be taken into account, false otherwisepublic final float getScale(@NonNull + AbstractItem item, + boolean includePadding)+
Arithmetics
item
- The item, whose scale should be returned, as an instance of the class AbstractItem
. The item may not be nullincludePadding
- True, if the item's padding should be taken into account as well, false otherwiseFloat
valuepublic final void setScale(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float scale)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose scale should be set, as an instance of the class AbstractItem
. The item may not be nullscale
- The scale, which should be set, as a Float
valuepublic final void animateScale(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.ViewPropertyAnimator animator, + float scale)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, which should be used to animate the scale, as an instance of the class
+ ViewPropertyAnimator
. The animator may not be nullscale
- The scale, which should be set by the animation, as a Float
valuepublic final float getSize(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose size should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
valuepublic final float getPivot(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + @NonNull + AbstractDragTabsEventHandler.DragState dragState)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose pivot should be returned, as an instance of the class AbstractItem
. The item may not be nulldragState
- The current drag state as a value of the enum AbstractDragTabsEventHandler.DragState
. The drag state may
+ not be nullFloat
valuepublic final void setPivot(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float pivot)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose pivot should be set, as an instance of the class View
. The
+ item may not be nullpivot
- The pivot, which should be set, as a Float
valuepublic final float getRotation(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose rotation should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
valuepublic final void setRotation(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float angle)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose rotation should be set, as an instance of the class AbstractItem
. The item may not be nullangle
- The rotation, which should be set, as a Float
valuepublic final void animateRotation(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.ViewPropertyAnimator animator, + float angle)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, should be used to animate the rotation, as an instance of the class
+ ViewPropertyAnimator
. The animator may not be nullangle
- The rotation, which should be set by the animation, as a Float
valuepublic static interface PhoneDragTabsEventHandler.Callback +extends AbstractDragTabsEventHandler.Callback+
Modifier and Type | +Method and Description | +
---|---|
void |
+onStartOvershoot(float position)
+The method, which is invoked, when tabs are overshooting at the start.
+ |
+
void |
+onTiltOnEndOvershoot(float angle)
+The method, which is invoked, when the tabs should be tilted when overshooting at the
+ end.
+ |
+
void |
+onTiltOnStartOvershoot(float angle)
+The method, which is invoked, when the tabs should be tilted when overshooting at the
+ start.
+ |
+
onCancelFling, onClick, onDrag, onFling, onPressEnded, onPressStarted, onRevertEndOvershoot, onRevertStartOvershoot, onSwipe, onSwipeEnded
void onStartOvershoot(float position)+
position
- The position of the first tab in pixels as a Float
valuevoid onTiltOnStartOvershoot(float angle)+
angle
- The angle, the tabs should be tilted by, in degrees as a Float
valuevoid onTiltOnEndOvershoot(float angle)+
angle
- The angle, the tabs should be tilted by, in degrees as a Float
valuepublic class PhoneDragTabsEventHandler +extends AbstractDragTabsEventHandler<PhoneDragTabsEventHandler.Callback>+
Modifier and Type | +Class and Description | +
---|---|
static interface |
+PhoneDragTabsEventHandler.Callback
+Defines the interface, a class, which should be notified about the events of a drag handler,
+ must implement.
+ |
+
AbstractDragTabsEventHandler.DragState
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description | +
---|
PhoneDragTabsEventHandler(TabSwitcher tabSwitcher,
+ Arithmetics arithmetics,
+ de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler)
+Creates a new drag handler, which allows to calculate the position and state of tabs on touch
+ events, when using the smartphone layout.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
protected AbstractItem |
+getFocusedItem(float position)
+The method, which is invoked on implementing subclasses in order to retrieve the item, which
+ corresponds to the view, which is focused when clicking/dragging at a specific position.
+ |
+
protected boolean |
+isSwipeThresholdReached(TabItem swipedTabItem)
+Returns, whether the threshold of a swiped tab item, which causes the corresponding tab to be
+ removed, has been reached, or not.
+ |
+
protected float |
+onOvershootEnd(float dragPosition,
+ float overshootThreshold)
+The method, which is invoked on implementing subclasses, when the tabs are overshooting at
+ the end.
+ |
+
protected void |
+onOvershootReverted()
+The method, which is invoked on implementing subclasses, when an overshoot has been reverted.
+ |
+
protected float |
+onOvershootStart(float dragPosition,
+ float overshootThreshold)
+The method, which is invoked on implementing subclasses, when the tabs are overshooting at
+ the start.
+ |
+
protected void |
+onReset()
+The method, which invoked on implementing subclasses, when the drag handler has been reset.
+ |
+
getArithmetics, getCallback, handleDrag, isDragging, isDraggingAllowed, onDown, onDrag, onTouchEvent, onUp, reset, setCallback, setDragState
compare, equals, getDragHelper, getPriority, getTabSwitcher, getTouchableArea, getVelocityTracker, handleTouchEvent, hashCode, isInsideTouchableArea, isReset, setPointerId
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public PhoneDragTabsEventHandler(@NonNull + TabSwitcher tabSwitcher, + @NonNull + Arithmetics arithmetics, + @NonNull + de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler)+
tabSwitcher
- The tab switcher, whose tabs' positions and states should be calculated by the drag
+ handler, as an instance of the class TabSwitcher
. The tab switcher may not be
+ nullarithmetics
- The arithmetics, which should be used to calculate the position, size and rotation of
+ tabs, as an instance of the type Arithmetics
. The arithmetics may not be
+ nullviewRecycler
- The view recycler, which allows to inflate the views, which are used to visualize the
+ tabs, whose positions and states should be calculated by the tab switcher, as an
+ instance of the class AttachedViewRecycler. The view recycler may not be null@Nullable +protected final AbstractItem getFocusedItem(float position)+
AbstractDragTabsEventHandler
getFocusedItem
in class AbstractDragTabsEventHandler<PhoneDragTabsEventHandler.Callback>
position
- The position on the dragging axis in pixels as a Float
valueAbstractItem
or null, if no view is focusedprotected final float onOvershootStart(float dragPosition, + float overshootThreshold)+
AbstractDragTabsEventHandler
onOvershootStart
in class AbstractDragTabsEventHandler<PhoneDragTabsEventHandler.Callback>
dragPosition
- The position of the pointer on the dragging axis in pixels as a Float
valueovershootThreshold
- The position on the dragging axis, an overshoot at the start currently starts at, in
+ pixels as a Float
valueFloat
valueprotected final float onOvershootEnd(float dragPosition, + float overshootThreshold)+
AbstractDragTabsEventHandler
onOvershootEnd
in class AbstractDragTabsEventHandler<PhoneDragTabsEventHandler.Callback>
dragPosition
- The position of the pointer on the dragging axis in pixels as a Float
valueovershootThreshold
- The position on the dragging axis, an overshoot at the end currently starts at, in
+ pixels as a Float
valueFloat
valueprotected final void onOvershootReverted()+
AbstractDragTabsEventHandler
onOvershootReverted
in class AbstractDragTabsEventHandler<PhoneDragTabsEventHandler.Callback>
protected final void onReset()+
AbstractDragTabsEventHandler
onReset
in class AbstractDragTabsEventHandler<PhoneDragTabsEventHandler.Callback>
protected final boolean isSwipeThresholdReached(@NonNull + TabItem swipedTabItem)+
AbstractDragTabsEventHandler
isSwipeThresholdReached
in class AbstractDragTabsEventHandler<PhoneDragTabsEventHandler.Callback>
swipedTabItem
- The swiped tab item as an instance of the class TabItem
. The tab item may not
+ be nullpublic 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
getViewTypeCount
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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)+ +
public class PhoneTabSwitcherLayout +extends AbstractTabSwitcherLayout +implements PhoneDragTabsEventHandler.Callback+
TabSwitcher
on smartphones.AbstractTabSwitcherLayout.AnimationListenerWrapper, AbstractTabSwitcherLayout.Callback, AbstractTabSwitcherLayout.InitialItemIterator, AbstractTabSwitcherLayout.InitialItemIteratorBuilder, AbstractTabSwitcherLayout.LayoutListenerWrapper
Constructor and Description | +
---|
PhoneTabSwitcherLayout(TabSwitcher tabSwitcher,
+ TabSwitcherModel model,
+ PhoneArithmetics arithmetics,
+ TabSwitcherStyle style,
+ TouchEventDispatcher touchEventDispatcher)
+Creates a new layout, which implements the functionality of a
+TabSwitcher on
+ smartphones. |
+
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 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,
+ 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 float |
+calculatePredecessorPosition(AbstractItem item,
+ AbstractItem successor)
+Calculates the position of an item in relation to the position of its successor.
+ |
+
protected float |
+calculateSuccessorPosition(AbstractItem item,
+ AbstractItem predecessor)
+Calculates the position of an item in relation to the position of its predecessor.
+ |
+
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.
+ |
+
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 |
+getStackedTabCount()
+The method, which is invoked on implementing subclasses in order to retrieve the number of
+ tabs, which are contained by a stack.
+ |
+
android.view.ViewGroup |
+getTabContainer()
+Returns the view group, which contains the tab switcher's tabs.
+ |
+
protected 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 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.support.v7.widget.Toolbar[] |
+getToolbars()
+Returns the toolbars, which are shown, when the tab switcher is shown.
+ |
+
protected 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.
+ |
+
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.
+ |
+
void |
+onAllTabsAdded(int index,
+ Tab[] tabs,
+ int previousSelectedTabIndex,
+ int selectedTabIndex,
+ boolean selectionChanged,
+ 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 |
+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 |
+onDecoratorChanged(TabSwitcherDecorator decorator)
+The method, which is invoked, when the decorator has been changed.
+ |
+
protected 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.
+ |
+
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 |
+onGlobalLayout() |
+
protected void |
+onInflateLayout(android.view.LayoutInflater inflater,
+ boolean tabsOnly)
+The method, which is invoked on implementing subclasses in order to inflate the layout.
+ |
+
void |
+onPaddingChanged(int left,
+ int top,
+ int right,
+ int bottom)
+The method, which is invoked, when the padding has been changed.
+ |
+
void |
+onPulledDown()
+The method, which is notified, when the currently selected tab has been pulled down.
+ |
+
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 |
+onSelectionChanged(int previousIndex,
+ int index,
+ Tab selectedTab,
+ boolean switcherHidden)
+The method, which is invoked, when the currently selected tab has been changed.
+ |
+
void |
+onStartOvershoot(float position)
+The method, which is invoked, when tabs are overshooting at the start.
+ |
+
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 |
+onSwitchingBetweenTabs(int selectedTabIndex,
+ float distance)
+The method, which is invoked, when switching between neighboring tabs.
+ |
+
void |
+onSwitchingBetweenTabsEnded(int selectedTabIndex,
+ int previousSelectedTabIndex,
+ boolean selectionChanged,
+ float velocity,
+ long animationDuration)
+The method, which is invoked, when switching between neighboring tabs ended.
+ |
+
void |
+onTabAdded(int index,
+ Tab tab,
+ int previousSelectedTabIndex,
+ int selectedTabIndex,
+ boolean selectionChanged,
+ boolean switcherVisibilityChanged,
+ Animation animation)
+The method, which is invoked, when a tab has been added to the model.
+ |
+
void |
+onTabRemoved(int index,
+ Tab tab,
+ int previousSelectedTabIndex,
+ int selectedTabIndex,
+ boolean selectionChanged,
+ Animation animation)
+The method, which is invoked, when a tab has been removed from the model.
+ |
+
void |
+onTiltOnEndOvershoot(float angle)
+The method, which is invoked, when the tabs should be tilted when overshooting at the
+ end.
+ |
+
void |
+onTiltOnStartOvershoot(float angle)
+The method, which is invoked, when the tabs should be tilted when overshooting at the
+ start.
+ |
+
protected void |
+updateView(AbstractItem item,
+ boolean dragging)
+Updates the view, which is used to visualize a specific item.
+ |
+
calculateMinStartPosition, calculatePositionAndStateWhenStackedAtStart, clipPosition, clipPosition, detachLayout, getArithmetics, getContext, getFirstVisibleIndex, getItemCount, getLogger, getModel, getStackedTabSpacing, getStyle, getTabSwitcher, getToolbarMenu, inflateLayout, inflateOrRemoveView, inflateView, isAnimationRunning, isStackedAtStart, onAddedEventHandler, onAddTabButtonColorChanged, onAddTabButtonVisibilityChanged, onCancelFling, onClick, onCreateContentRecyclerAdapter, onDrag, onFling, onLogLevelChanged, onPressEnded, onPressStarted, onRemovedEventHandler, onTabBackgroundColorChanged, onTabCloseButtonIconChanged, onTabContentBackgroundColorChanged, onTabIconChanged, onTabProgressBarColorChanged, onTabTitleColorChanged, onToolbarMenuInflated, onToolbarNavigationIconChanged, onToolbarTitleChanged, onToolbarVisibilityChanged, secondLayoutPass, setCallback, setFirstVisibleIndex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onCancelFling, onClick, onDrag, onFling, onPressEnded, onPressStarted
public PhoneTabSwitcherLayout(@NonNull + TabSwitcher tabSwitcher, + @NonNull + TabSwitcherModel model, + @NonNull + PhoneArithmetics arithmetics, + @NonNull + TabSwitcherStyle style, + @NonNull + TouchEventDispatcher touchEventDispatcher)+
TabSwitcher
on
+ smartphones.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 class
+ PhoneArithmetics
. 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 nullpublic final AbstractDragTabsEventHandler<?> getDragHandler()+
AbstractTabSwitcherLayout
getDragHandler
in class AbstractTabSwitcherLayout
AbstractDragTabsEventHandler
or null, if the drag handler has not been initialized yetprotected final void onInflateLayout(@NonNull + android.view.LayoutInflater inflater, + boolean tabsOnly)+
AbstractTabSwitcherLayout
onInflateLayout
in class AbstractTabSwitcherLayout
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 final android.support.v4.util.Pair<java.lang.Integer,java.lang.Float> onDetachLayout(boolean tabsOnly)+
AbstractTabSwitcherLayout
onDetachLayout
in class AbstractTabSwitcherLayout
tabsOnly
- True, if only the tabs should be detached, false otherwisepublic final de.mrapp.android.util.view.AbstractViewRecycler<Tab,java.lang.Void> getContentViewRecycler()+
AbstractTabSwitcherLayout
getContentViewRecycler
in class AbstractTabSwitcherLayout
protected final de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,java.lang.Integer> getTabViewRecycler()+
AbstractTabSwitcherLayout
getTabViewRecycler
in class AbstractTabSwitcherLayout
protected final AbstractTabRecyclerAdapter getTabRecyclerAdapter()+
AbstractTabSwitcherLayout
getTabRecyclerAdapter
in class AbstractTabSwitcherLayout
AbstractTabRecyclerAdapter
or
+ null, if the view recycler has not been initialized yetprotected final void updateView(@NonNull + AbstractItem item, + boolean dragging)+
AbstractTabSwitcherLayout
updateView
in class AbstractTabSwitcherLayout
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 final float calculateAttachedPosition(int count)+
AbstractTabSwitcherLayout
calculateAttachedPosition
in class AbstractTabSwitcherLayout
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 usedprotected final void inflateAndUpdateView(@NonNull + AbstractItem item, + boolean dragging, + @Nullable + android.view.ViewTreeObserver.OnGlobalLayoutListener listener)+
AbstractTabSwitcherLayout
inflateAndUpdateView
in class AbstractTabSwitcherLayout
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 final int getStackedTabCount()+
AbstractTabSwitcherLayout
getStackedTabCount
in class AbstractTabSwitcherLayout
Integer
value@NonNull +protected final android.support.v4.util.Pair<java.lang.Float,State> calculatePositionAndStateWhenStackedAtStart(int count, + int index, + @Nullable + State predecessorState)+
AbstractTabSwitcherLayout
calculatePositionAndStateWhenStackedAtStart
in class AbstractTabSwitcherLayout
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 final android.support.v4.util.Pair<java.lang.Float,State> calculatePositionAndStateWhenStackedAtEnd(int index)+
AbstractTabSwitcherLayout
calculatePositionAndStateWhenStackedAtEnd
in class AbstractTabSwitcherLayout
index
- The index of the item, whose position and state should be returned, as an Integer
valueprotected final boolean isOvershootingAtStart()+
AbstractTabSwitcherLayout
isOvershootingAtStart
in class AbstractTabSwitcherLayout
protected final boolean isOvershootingAtEnd(@NonNull + AbstractDragTabsEventHandler.DragState dragState, + @NonNull + AbstractItemIterator iterator)+
AbstractTabSwitcherLayout
isOvershootingAtEnd
in class AbstractTabSwitcherLayout
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 final float calculateMaxEndPosition(int index)+
AbstractTabSwitcherLayout
calculateMaxEndPosition
in class AbstractTabSwitcherLayout
index
- The index of the item, whose position should be calculated, as an Integer
+ valueFloat
value or -1, if no
+ maximum position is availableprotected final float calculateSuccessorPosition(@NonNull + AbstractItem item, + @NonNull + AbstractItem predecessor)+
AbstractTabSwitcherLayout
calculateSuccessorPosition
in class AbstractTabSwitcherLayout
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 final float calculatePredecessorPosition(@NonNull + AbstractItem item, + @NonNull + AbstractItem successor)+
AbstractTabSwitcherLayout
calculatePredecessorPosition
in class AbstractTabSwitcherLayout
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
value@Nullable +public final android.view.ViewGroup getTabContainer()+
TabSwitcherLayout
getTabContainer
in interface TabSwitcherLayout
ViewGroup
or null, if the view has not been laid out yet@NonNull +public final android.support.v7.widget.Toolbar[] getToolbars()+
TabSwitcherLayout
TabSwitcher.PRIMARY_TOOLBAR_INDEX
+ of the returned array corresponds to the primary toolbar and the index TabSwitcher.SECONDARY_TOOLBAR_INDEX
corresponds to the secondary toolbar.getToolbars
in interface TabSwitcherLayout
public final void onDecoratorChanged(@NonNull + TabSwitcherDecorator decorator)+
Model.Listener
onDecoratorChanged
in interface Model.Listener
onDecoratorChanged
in class AbstractTabSwitcherLayout
decorator
- The decorator, which has been set, as an instance of the class TabSwitcherDecorator
. The decorator may not be nullpublic final void onSwitcherShown()+
Model.Listener
onSwitcherShown
in interface Model.Listener
onSwitcherShown
in class AbstractTabSwitcherLayout
public final void onSwitcherHidden()+
Model.Listener
onSwitcherHidden
in interface Model.Listener
onSwitcherHidden
in class AbstractTabSwitcherLayout
public final void onSelectionChanged(int previousIndex, + int index, + @Nullable + Tab selectedTab, + boolean switcherHidden)+
Model.Listener
onSelectionChanged
in interface Model.Listener
previousIndex
- 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, + @NonNull + Tab tab, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + boolean switcherVisibilityChanged, + @NonNull + Animation animation)+
Model.Listener
onTabAdded
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection has changed, false otherwiseswitcherVisibilityChanged
- 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, + @NonNull + Tab[] tabs, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + @NonNull + Animation animation)+
Model.Listener
onAllTabsAdded
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection has changed, false otherwiseanimation
- 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, + @NonNull + Tab tab, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + @NonNull + Animation animation)+
Model.Listener
onTabRemoved
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection changed, false otherwiseanimation
- 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(@NonNull + Tab[] tabs, + @NonNull + Animation animation)+
Model.Listener
onAllTabsRemoved
in interface Model.Listener
tabs
- 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.Listener
onPaddingChanged
in interface Model.Listener
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
applyPaddingToTabs
- True, if the padding of the tab switcher is applied to the content of its tabs,
+ false otherwisepublic final void onEmptyViewChanged(@Nullable + android.view.View view, + long animationDuration)+
Model.Listener
onEmptyViewChanged
in interface Model.Listener
view
- 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 usedpublic final void onGlobalLayout()+
onGlobalLayout
in interface android.view.ViewTreeObserver.OnGlobalLayoutListener
public final void onRevertStartOvershoot()+
AbstractDragTabsEventHandler.Callback
onRevertStartOvershoot
in interface AbstractDragTabsEventHandler.Callback
onRevertStartOvershoot
in class AbstractTabSwitcherLayout
public final void onRevertEndOvershoot()+
AbstractDragTabsEventHandler.Callback
onRevertEndOvershoot
in interface AbstractDragTabsEventHandler.Callback
onRevertEndOvershoot
in class AbstractTabSwitcherLayout
public final void onStartOvershoot(float position)+
PhoneDragTabsEventHandler.Callback
onStartOvershoot
in interface PhoneDragTabsEventHandler.Callback
position
- The position of the first tab in pixels as a Float
valuepublic final void onTiltOnStartOvershoot(float angle)+
PhoneDragTabsEventHandler.Callback
onTiltOnStartOvershoot
in interface PhoneDragTabsEventHandler.Callback
angle
- The angle, the tabs should be tilted by, in degrees as a Float
valuepublic final void onTiltOnEndOvershoot(float angle)+
PhoneDragTabsEventHandler.Callback
onTiltOnEndOvershoot
in interface PhoneDragTabsEventHandler.Callback
angle
- The angle, the tabs should be tilted by, in degrees as a Float
valuepublic final void onSwipe(@NonNull + TabItem tabItem, + float distance)+
AbstractDragTabsEventHandler.Callback
onSwipe
in interface AbstractDragTabsEventHandler.Callback
onSwipe
in class AbstractTabSwitcherLayout
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 final void onSwipeEnded(@NonNull + TabItem tabItem, + boolean remove, + float velocity)+
AbstractDragTabsEventHandler.Callback
onSwipeEnded
in interface AbstractDragTabsEventHandler.Callback
onSwipeEnded
in class AbstractTabSwitcherLayout
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 final void onSwitchingBetweenTabs(int selectedTabIndex, + float distance)+
SwipeGestureEventHandler.Callback
onSwitchingBetweenTabs
in interface SwipeGestureEventHandler.Callback
selectedTabIndex
- The index of the currently selected tab as an Integer
valuedistance
- The distance, the currently selected tab is swiped by, in pixels as a Float
valuepublic final void onSwitchingBetweenTabsEnded(int selectedTabIndex, + int previousSelectedTabIndex, + boolean selectionChanged, + float velocity, + long animationDuration)+
SwipeGestureEventHandler.Callback
onSwitchingBetweenTabsEnded
in interface SwipeGestureEventHandler.Callback
selectedTabIndex
- The index of the tab, which should become selected, as an Integer
valuepreviousSelectedTabIndex
- The index of the previously selected tab as an Integer
valueselectionChanged
- True, if the selection has changed, false otherwisevelocity
- The velocity of the swipe gesture in pixels per second as a Float
valueanimationDuration
- The duration of the swipe animation in milliseconds as a Long
valuepublic final void onPulledDown()+
PullDownGestureEventHandler.Callback
onPulledDown
in interface PullDownGestureEventHandler.Callback
onPulledDown
in class AbstractTabSwitcherLayout
public class PhoneTabViewHolder +extends AbstractTabViewHolder+
TabSwitcher
+ consists of, when using the smartphone layout.Modifier and Type | +Field and Description | +
---|---|
android.view.View |
+borderView
+The view, which is used to display a border around the preview of a tab.
+ |
+
android.view.View |
+content
+The view, which is associated with a tab.F
+ |
+
android.view.ViewGroup |
+contentContainer
+The view group, which contains the view, which is associated with a tab.
+ |
+
android.widget.ImageView |
+previewImageView
+The image view, which is used to display the preview of a tab.
+ |
+
closeButton, iconImageView, progressBar, titleContainer, titleTextView
Constructor and Description | +
---|
PhoneTabViewHolder() |
+
public android.view.ViewGroup contentContainer+
public android.view.View content+
public android.widget.ImageView previewImageView+
public android.view.View borderView+
public class PreviewDataBinder +extends de.mrapp.android.util.multithreading.AbstractDataBinder<android.graphics.Bitmap,Tab,android.widget.ImageView,TabItem>+
de.mrapp.android.util.multithreading.AbstractDataBinder.Listener<DataType,KeyType,ViewType,ParamType>
android.os.Handler.Callback
CACHE_SIZE
Constructor and Description | +
---|
PreviewDataBinder(android.view.ViewGroup parent,
+ de.mrapp.android.util.view.ViewRecycler<Tab,java.lang.Void> contentViewRecycler,
+ Model model)
+Creates a new data binder, which allows to asynchronously render preview images of tabs and
+ display them afterwards.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
protected android.graphics.Bitmap |
+doInBackground(Tab key,
+ TabItem... params) |
+
protected void |
+onPostExecute(android.widget.ImageView view,
+ android.graphics.Bitmap data,
+ long duration,
+ TabItem... params) |
+
protected void |
+onPreExecute(android.widget.ImageView view,
+ TabItem... params) |
+
addListener, cancel, clearCache, getContext, getLogLevel, handleMessage, isCached, isCacheUsed, isCanceled, load, load, removeListener, setLogLevel, useCache
createAsync, createAsync, dispatchMessage, dump, getLooper, getMessageName, hasMessages, hasMessages, obtainMessage, obtainMessage, obtainMessage, obtainMessage, obtainMessage, post, postAtFrontOfQueue, postAtTime, postAtTime, postDelayed, postDelayed, removeCallbacks, removeCallbacks, removeCallbacksAndMessages, removeMessages, removeMessages, sendEmptyMessage, sendEmptyMessageAtTime, sendEmptyMessageDelayed, sendMessage, sendMessageAtFrontOfQueue, sendMessageAtTime, sendMessageDelayed, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public PreviewDataBinder(@NonNull + android.view.ViewGroup parent, + @NonNull + de.mrapp.android.util.view.ViewRecycler<Tab,java.lang.Void> contentViewRecycler, + @NonNull + Model model)+
parent
- The parent view of the tab switcher, the tabs belong to, as an instance of the class
+ ViewGroup
. The parent may not be nullcontentViewRecycler
- The view recycler, which should be used to inflate the views, which are associated
+ with tabs, as an instance of the class ViewRecycler. The view recycler may not be
+ nullmodel
- The model of the tab switcher, the tabs belong to, as an instance of the type Model
. The model may not be nullprotected final void onPreExecute(@NonNull + android.widget.ImageView view, + @NonNull + TabItem... params)+ +
@NonNull +protected final android.graphics.Bitmap doInBackground(@NonNull + Tab key, + @NonNull + TabItem... params)+ +
protected final void onPostExecute(@NonNull + android.widget.ImageView view, + @Nullable + android.graphics.Bitmap data, + long duration, + @NonNull + TabItem... params)+ +
Interface | +Description | +
---|---|
PhoneDragTabsEventHandler.Callback | +
+ Defines the interface, a class, which should be notified about the events of a drag handler,
+ must implement.
+ |
+
Class | +Description | +
---|---|
PhoneArithmetics | +
+ Provides methods, which allow to calculate the position, size and rotation of a
+TabSwitcher 's tabs, when using the smartphone layout. |
+
PhoneDragTabsEventHandler | +
+ A drag handler, which allows to calculate the position and state of tabs on touch events, when
+ using the smartphone layout.
+ |
+
PhoneTabRecyclerAdapter | +
+ A view recycler adapter, which allows to inflate the views, which are used to visualize the tabs
+ of a
+TabSwitcher , when using the smartphone layout. |
+
PhoneTabSwitcherLayout | +
+ A layout, which implements the functionality of a
+TabSwitcher on smartphones. |
+
PhoneTabViewHolder | +
+ A view holder, which allows to store references to the views, a tab of a
+TabSwitcher
+ consists of, when using the smartphone layout. |
+
PreviewDataBinder | +
+ A data binder, which allows to asynchronously render preview images of tabs and display them
+ afterwards.
+ |
+
public class TabletArithmetics +extends AbstractArithmetics+
TabSwitcher
's tabs, when using the tablet layout.Arithmetics.Axis
Constructor and Description | +
---|
TabletArithmetics(TabSwitcher tabSwitcher)
+Creates a new class, which provides methods, which allow to calculate the position, size and
+ rotation of a
+TabSwitcher 's tabs, when using the tablet layout. |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+animatePosition(Arithmetics.Axis axis,
+ android.view.ViewPropertyAnimator animator,
+ AbstractItem item,
+ float position,
+ boolean includePadding)
+Animates the position of an item on a specific axis.
+ |
+
void |
+animateRotation(Arithmetics.Axis axis,
+ android.view.ViewPropertyAnimator animator,
+ float angle)
+Animates the rotation of an item on a specific axis.
+ |
+
void |
+animateScale(Arithmetics.Axis axis,
+ android.view.ViewPropertyAnimator animator,
+ float scale)
+Animates the scale of an item on a specific axis.
+ |
+
float |
+getPivot(Arithmetics.Axis axis,
+ AbstractItem item,
+ AbstractDragTabsEventHandler.DragState dragState)
+Returns the pivot of an item on a specific axis, depending on the current drag state.
+ |
+
float |
+getPosition(Arithmetics.Axis axis,
+ AbstractItem item)
+Returns the position of a specific item on a specific axis.
+ |
+
float |
+getRotation(Arithmetics.Axis axis,
+ AbstractItem item)
+Returns the rotation of an item on a specific axis.
+ |
+
float |
+getScale(AbstractItem item,
+ boolean includePadding)
+Returns the scale of an item, depending on its margin.
+ |
+
float |
+getSize(Arithmetics.Axis axis,
+ AbstractItem item)
+Returns the size of an item on a specific axis.
+ |
+
float |
+getTabContainerSize(Arithmetics.Axis axis,
+ boolean includePadding)
+Returns the size of the container, which contains the tab switcher's tabs, on a specific
+ axis.
+ |
+
int |
+getTabSwitcherPadding(Arithmetics.Axis axis,
+ int gravity)
+Returns the padding of the tab switcher on a specific axis and using a specific gravity.
+ |
+
float |
+getTouchPosition(Arithmetics.Axis axis,
+ android.view.MotionEvent event)
+Returns the position of a touch event on a specific axis.
+ |
+
void |
+setPivot(Arithmetics.Axis axis,
+ AbstractItem item,
+ float pivot)
+Sets the pivot of an item on a specific axis.
+ |
+
void |
+setPosition(Arithmetics.Axis axis,
+ AbstractItem item,
+ float position)
+Sets the position of an item on a specific axis.
+ |
+
void |
+setRotation(Arithmetics.Axis axis,
+ AbstractItem item,
+ float angle)
+Sets the rotation of an item on a specific axis.
+ |
+
void |
+setScale(Arithmetics.Axis axis,
+ AbstractItem item,
+ float scale)
+Sets the scale of an item on a specific axis.
+ |
+
animatePosition, getScale, getTabContainerSize, getTabSwitcher
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public TabletArithmetics(@NonNull + TabSwitcher tabSwitcher)+
TabSwitcher
's tabs, when using the tablet layout.tabSwitcher
- The tab switcher, the arithmetics should be calculated for, as an instance of the
+ class TabSwitcher
. The tab switcher may not be nullpublic final int getTabSwitcherPadding(@NonNull + Arithmetics.Axis axis, + int gravity)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullgravity
- The gravity as an Integer
value. The gravity must be
+ Gravity.START
or Gravity.END
Integer
valuepublic final float getTabContainerSize(@NonNull + Arithmetics.Axis axis, + boolean includePadding)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullincludePadding
- True, if the padding and the size of the toolbars should be included, false
+ otherwiseFloat
valuepublic final float getTouchPosition(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.MotionEvent event)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullevent
- The touch event, whose position should be returned, as an instance of the class
+ MotionEvent
. The motion event may not be nullFloat
valuepublic final float getPosition(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose position should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
valuepublic final void setPosition(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float position)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose position should be set, as an instance of the class AbstractItem
. The item may not be nullposition
- The position, which should be set, as a Float
valuepublic final void animatePosition(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.ViewPropertyAnimator animator, + @NonNull + AbstractItem item, + float position, + boolean includePadding)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, which should be used to animate the position, as an instance of the
+ class ViewPropertyAnimator
. The animator may not be nullitem
- The item, whose position should be animated, as an instance of the class View
. The view may not be nullposition
- The position, which should be set by the animation, as a Float
valueincludePadding
- True, if the item's padding should be taken into account, false otherwisepublic final float getScale(@NonNull + AbstractItem item, + boolean includePadding)+
Arithmetics
item
- The item, whose scale should be returned, as an instance of the class AbstractItem
. The item may not be nullincludePadding
- True, if the item's padding should be taken into account as well, false otherwiseFloat
valuepublic final void setScale(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float scale)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose scale should be set, as an instance of the class AbstractItem
. The item may not be nullscale
- The scale, which should be set, as a Float
valuepublic final void animateScale(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.ViewPropertyAnimator animator, + float scale)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, which should be used to animate the scale, as an instance of the class
+ ViewPropertyAnimator
. The animator may not be nullscale
- The scale, which should be set by the animation, as a Float
valuepublic final float getSize(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose size should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
valuepublic final float getPivot(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + @NonNull + AbstractDragTabsEventHandler.DragState dragState)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose pivot should be returned, as an instance of the class AbstractItem
. The item may not be nulldragState
- The current drag state as a value of the enum AbstractDragTabsEventHandler.DragState
. The drag state may
+ not be nullFloat
valuepublic void setPivot(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float pivot)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose pivot should be set, as an instance of the class View
. The
+ item may not be nullpivot
- The pivot, which should be set, as a Float
valuepublic final float getRotation(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose rotation should be returned, as an instance of the class AbstractItem
. The item may not be nullFloat
valuepublic final void setRotation(@NonNull + Arithmetics.Axis axis, + @NonNull + AbstractItem item, + float angle)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullitem
- The item, whose rotation should be set, as an instance of the class AbstractItem
. The item may not be nullangle
- The rotation, which should be set, as a Float
valuepublic final void animateRotation(@NonNull + Arithmetics.Axis axis, + @NonNull + android.view.ViewPropertyAnimator animator, + float angle)+
Arithmetics
axis
- The axis as a value of the enum Arithmetics.Axis
. The axis may not be nullanimator
- The animator, should be used to animate the rotation, as an instance of the class
+ ViewPropertyAnimator
. The animator may not be nullangle
- The rotation, which should be set by the animation, as a Float
valuepublic class TabletContentRecyclerAdapterWrapper +extends de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void> +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,
+ de.mrapp.android.util.view.AttachedViewRecycler<Tab,?> 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,
+ boolean selectionChanged,
+ 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 |
+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 |
+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(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 |
+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 selectionChanged,
+ 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,
+ boolean selectionChanged,
+ 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,
+ 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.
+ |
+
void |
+restoreInstanceState(android.os.Bundle savedInstanceState)
+Restores a previously saved state.
+ |
+
void |
+saveInstanceState(android.os.Bundle outState)
+Saves the current state.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public TabletContentRecyclerAdapterWrapper(@NonNull + TabSwitcher tabSwitcher, + @NonNull + TabSwitcherStyle style, + @NonNull + de.mrapp.android.util.view.AttachedViewRecycler<Tab,?> viewRecycler, + @NonNull + 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 null@NonNull +public final android.view.View onInflateView(@NonNull + android.view.LayoutInflater inflater, + @Nullable + android.view.ViewGroup parent, + @NonNull + Tab item, + int viewType, + @NonNull + java.lang.Void... params)+
onInflateView
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void>
public final void onShowView(@NonNull + android.content.Context context, + @NonNull + android.view.View view, + @NonNull + Tab item, + boolean inflated, + @NonNull + java.lang.Void... params)+
onShowView
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void>
public final void onRemoveView(@NonNull + android.view.View view, + @NonNull + Tab item)+
onRemoveView
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void>
public final int getViewTypeCount()+
getViewTypeCount
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void>
public final int getViewType(@NonNull + Tab item)+
getViewType
in class de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void>
public final void saveInstanceState(@NonNull + android.os.Bundle outState)+
Restorable
saveInstanceState
in interface Restorable
outState
- 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(@Nullable + android.os.Bundle savedInstanceState)+
Restorable
restoreInstanceState
in interface Restorable
savedInstanceState
- The saved state as an instance of the class Bundle
or null, if no saved state
+ is availablepublic final void onTitleChanged(@NonNull + Tab tab)+
Tab.Callback
onTitleChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onIconChanged(@NonNull + Tab tab)+
Tab.Callback
onIconChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onCloseableChanged(@NonNull + Tab tab)+
Tab.Callback
onCloseableChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onCloseButtonIconChanged(@NonNull + Tab tab)+
Tab.Callback
onCloseButtonIconChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onBackgroundColorChanged(@NonNull + Tab tab)+
Tab.Callback
onBackgroundColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onContentBackgroundColorChanged(@NonNull + Tab tab)+
Tab.Callback
onContentBackgroundColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onTitleTextColorChanged(@NonNull + Tab tab)+
Tab.Callback
onTitleTextColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onProgressBarVisibilityChanged(@NonNull + Tab tab)+
Tab.Callback
onProgressBarVisibilityChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onProgressBarColorChanged(@NonNull + Tab tab)+
Tab.Callback
onProgressBarColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic 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 nullpublic final 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 final void onSwitcherShown()+
Model.Listener
onSwitcherShown
in interface Model.Listener
public final void onSwitcherHidden()+
Model.Listener
onSwitcherHidden
in interface Model.Listener
public final void onSelectionChanged(int previousIndex, + int index, + @Nullable + Tab selectedTab, + boolean switcherHidden)+
Model.Listener
onSelectionChanged
in interface Model.Listener
previousIndex
- 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, + @NonNull + Tab tab, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + boolean switcherVisibilityChanged, + @NonNull + Animation animation)+
Model.Listener
onTabAdded
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection has changed, false otherwiseswitcherVisibilityChanged
- 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, + @NonNull + Tab[] tabs, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + @NonNull + Animation animation)+
Model.Listener
onAllTabsAdded
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection has changed, false otherwiseanimation
- 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, + @NonNull + Tab tab, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + @NonNull + Animation animation)+
Model.Listener
onTabRemoved
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection changed, false otherwiseanimation
- 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(@NonNull + Tab[] tabs, + @NonNull + Animation animation)+
Model.Listener
onAllTabsRemoved
in interface Model.Listener
tabs
- 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.Listener
onPaddingChanged
in interface Model.Listener
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
applyPaddingToTabs
- True, if the padding of the tab switcher is applied to the content of its tabs,
+ false otherwisepublic 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 final 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 final 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 final 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 onEmptyViewChanged(@Nullable + android.view.View view, + long animationDuration)+
Model.Listener
onEmptyViewChanged
in interface Model.Listener
view
- 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 usedpublic class TabletDragTabsEventHandler +extends AbstractDragTabsEventHandler<AbstractDragTabsEventHandler.Callback>+
AbstractDragTabsEventHandler.Callback, AbstractDragTabsEventHandler.DragState
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description | +
---|
TabletDragTabsEventHandler(TabSwitcher tabSwitcher,
+ Arithmetics arithmetics,
+ de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler)
+Creates a new drag handler, which allows to calculate the position and state of tabs on touch
+ events, when using the tablet layout.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
protected AbstractItem |
+getFocusedItem(float position)
+The method, which is invoked on implementing subclasses in order to retrieve the item, which
+ corresponds to the view, which is focused when clicking/dragging at a specific position.
+ |
+
android.graphics.RectF |
+getTouchableArea()
+Returns the bounds of the onscreen area, the handler takes into consideration for handling
+ touch events.
+ |
+
getArithmetics, getCallback, handleDrag, isDragging, isDraggingAllowed, isSwipeThresholdReached, onDown, onDrag, onOvershootEnd, onOvershootReverted, onOvershootStart, onReset, onTouchEvent, onUp, reset, setCallback, setDragState
compare, equals, getDragHelper, getPriority, getTabSwitcher, getVelocityTracker, handleTouchEvent, hashCode, isInsideTouchableArea, isReset, setPointerId
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public TabletDragTabsEventHandler(@NonNull + TabSwitcher tabSwitcher, + @NonNull + Arithmetics arithmetics, + @NonNull + de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler)+
tabSwitcher
- The tab switcher, whose tabs' positions and states should be calculated by the drag
+ handler, as an instance of the class TabSwitcher
. The tab switcher may not be
+ nullarithmetics
- The arithmetics, which should be used to calculate the position, size and rotation of
+ tabs, as an instance of the type Arithmetics
. The arithmetics may not be
+ nullviewRecycler
- The view recycler, which allows to inflate the views, which are used to visualize the
+ tabs, whose positions and states should be calculated by the tab switcher, as an
+ instance of the class AttachedViewRecycler. The view recycler may not be null@NonNull +public final android.graphics.RectF getTouchableArea()+
AbstractTouchEventHandler
getTouchableArea
in class AbstractTouchEventHandler
RectF
or null, if the area is not
+ restricted@Nullable +protected final AbstractItem getFocusedItem(float position)+
AbstractDragTabsEventHandler
getFocusedItem
in class AbstractDragTabsEventHandler<AbstractDragTabsEventHandler.Callback>
position
- The position on the dragging axis in pixels as a Float
valueAbstractItem
or null, if no view is focusedpublic 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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 nullpublic class TabletTabSwitcherLayout +extends AbstractTabSwitcherLayout +implements Tab.Callback+
TabSwitcher
on tablets.AbstractTabSwitcherLayout.AnimationListenerWrapper, AbstractTabSwitcherLayout.Callback, AbstractTabSwitcherLayout.InitialItemIterator, AbstractTabSwitcherLayout.InitialItemIteratorBuilder, AbstractTabSwitcherLayout.LayoutListenerWrapper
Constructor and Description | +
---|
TabletTabSwitcherLayout(TabSwitcher tabSwitcher,
+ TabSwitcherModel model,
+ Arithmetics arithmetics,
+ TabSwitcherStyle style,
+ TouchEventDispatcher touchEventDispatcher)
+Creates a new layout, which implements the functionality of a
+TabSwitcher on
+ tablets. |
+
Modifier and Type | +Method and Description | +
---|---|
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 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,
+ 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 float |
+calculatePredecessorPosition(AbstractItem item,
+ AbstractItem successor)
+Calculates the position of an item in relation to the position of its successor.
+ |
+
protected float |
+calculateSuccessorPosition(AbstractItem item,
+ AbstractItem predecessor)
+Calculates the position of an item in relation to the position of its predecessor.
+ |
+
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.
+ |
+
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 |
+getStackedTabCount()
+The method, which is invoked on implementing subclasses in order to retrieve the number of
+ tabs, which are contained by a stack.
+ |
+
android.view.ViewGroup |
+getTabContainer()
+Returns the view group, which contains the tab switcher's tabs.
+ |
+
protected 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 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.support.v7.widget.Toolbar[] |
+getToolbars()
+Returns the toolbars, which are shown, when the tab switcher is shown.
+ |
+
protected 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 |
+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,
+ boolean selectionChanged,
+ 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 |
+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 |
+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.
+ |
+
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.
+ |
+
protected 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.
+ |
+
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 |
+onGlobalLayout() |
+
void |
+onIconChanged(Tab tab)
+The method, which is invoked, when the tab's icon has been changed.
+ |
+
protected void |
+onInflateLayout(android.view.LayoutInflater inflater,
+ boolean tabsOnly)
+The method, which is invoked on implementing subclasses in order to inflate the layout.
+ |
+
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 |
+onSelectionChanged(int previousIndex,
+ int index,
+ Tab selectedTab,
+ boolean switcherHidden)
+The method, which is invoked, when the currently selected tab has been changed.
+ |
+
void |
+onSwitchingBetweenTabs(int selectedTabIndex,
+ float distance)
+The method, which is invoked, when switching between neighboring tabs.
+ |
+
void |
+onSwitchingBetweenTabsEnded(int selectedTabIndex,
+ int previousSelectedTabIndex,
+ boolean selectionChanged,
+ float velocity,
+ long animationDuration)
+The method, which is invoked, when switching between neighboring tabs ended.
+ |
+
void |
+onTabAdded(int index,
+ Tab tab,
+ int previousSelectedTabIndex,
+ int selectedTabIndex,
+ boolean selectionChanged,
+ 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 |
+onTabRemoved(int index,
+ Tab tab,
+ int previousSelectedTabIndex,
+ int selectedTabIndex,
+ boolean selectionChanged,
+ Animation animation)
+The method, which is invoked, when a tab has been removed from the model.
+ |
+
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.
+ |
+
protected void |
+secondLayoutPass(AbstractItemIterator.AbstractBuilder builder)
+The method, which is called when dragging after the positions and states of all tabs have
+ been calculated.
+ |
+
protected void |
+updateView(AbstractItem item,
+ boolean dragging)
+Updates the view, which is used to visualize a specific item.
+ |
+
calculateAttachedPosition, calculatePositionAndStateWhenStackedAtStart, clipPosition, clipPosition, detachLayout, getArithmetics, getContext, getFirstVisibleIndex, getItemCount, getLogger, getModel, getStackedTabSpacing, getStyle, getTabSwitcher, getToolbarMenu, inflateLayout, inflateOrRemoveView, inflateView, isAnimationRunning, isOvershootingAtEnd, isOvershootingAtStart, isStackedAtStart, onAddedEventHandler, onAddTabButtonColorChanged, onCancelFling, onClick, onDecoratorChanged, onDrag, onFling, onLogLevelChanged, onPressEnded, onPressStarted, onPulledDown, onRemovedEventHandler, onRevertEndOvershoot, onRevertStartOvershoot, onSwipe, onSwipeEnded, onSwitcherHidden, onSwitcherShown, onTabCloseButtonIconChanged, onTabContentBackgroundColorChanged, onTabIconChanged, onTabProgressBarColorChanged, onTabTitleColorChanged, onToolbarMenuInflated, onToolbarNavigationIconChanged, onToolbarTitleChanged, onToolbarVisibilityChanged, setCallback, setFirstVisibleIndex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public TabletTabSwitcherLayout(@NonNull + TabSwitcher tabSwitcher, + @NonNull + TabSwitcherModel model, + @NonNull + Arithmetics arithmetics, + @NonNull + TabSwitcherStyle style, + @NonNull + TouchEventDispatcher touchEventDispatcher)+
TabSwitcher
on
+ tablets.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 nullpublic final AbstractDragTabsEventHandler<?> getDragHandler()+
AbstractTabSwitcherLayout
getDragHandler
in class AbstractTabSwitcherLayout
AbstractDragTabsEventHandler
or null, if the drag handler has not been initialized yetprotected final void onInflateLayout(@NonNull + android.view.LayoutInflater inflater, + boolean tabsOnly)+
AbstractTabSwitcherLayout
onInflateLayout
in class AbstractTabSwitcherLayout
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 final android.support.v4.util.Pair<java.lang.Integer,java.lang.Float> onDetachLayout(boolean tabsOnly)+
AbstractTabSwitcherLayout
onDetachLayout
in class AbstractTabSwitcherLayout
tabsOnly
- True, if only the tabs should be detached, false otherwisepublic final de.mrapp.android.util.view.AbstractViewRecycler<Tab,java.lang.Void> getContentViewRecycler()+
AbstractTabSwitcherLayout
getContentViewRecycler
in class AbstractTabSwitcherLayout
protected final de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,java.lang.Integer> getTabViewRecycler()+
AbstractTabSwitcherLayout
getTabViewRecycler
in class AbstractTabSwitcherLayout
protected final AbstractTabRecyclerAdapter getTabRecyclerAdapter()+
AbstractTabSwitcherLayout
getTabRecyclerAdapter
in class AbstractTabSwitcherLayout
AbstractTabRecyclerAdapter
or
+ null, if the view recycler has not been initialized yetprotected final void inflateAndUpdateView(@NonNull + AbstractItem item, + boolean dragging, + @Nullable + android.view.ViewTreeObserver.OnGlobalLayoutListener listener)+
AbstractTabSwitcherLayout
inflateAndUpdateView
in class AbstractTabSwitcherLayout
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 final int getStackedTabCount()+
AbstractTabSwitcherLayout
getStackedTabCount
in class AbstractTabSwitcherLayout
Integer
value@NonNull +protected final android.support.v4.util.Pair<java.lang.Float,State> calculatePositionAndStateWhenStackedAtStart(int count, + int index, + @Nullable + State predecessorState)+
AbstractTabSwitcherLayout
calculatePositionAndStateWhenStackedAtStart
in class AbstractTabSwitcherLayout
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 final android.support.v4.util.Pair<java.lang.Float,State> calculatePositionAndStateWhenStackedAtEnd(int index)+
AbstractTabSwitcherLayout
calculatePositionAndStateWhenStackedAtEnd
in class AbstractTabSwitcherLayout
index
- The index of the item, whose position and state should be returned, as an Integer
valueprotected final float calculateMinStartPosition(int index)+
AbstractTabSwitcherLayout
calculateMinStartPosition
in class AbstractTabSwitcherLayout
index
- The index of the item, whose position should be calculated, as an Integer
+ valueFloat
value or -1, if no
+ minimum position is availableprotected final float calculateMaxEndPosition(int index)+
AbstractTabSwitcherLayout
calculateMaxEndPosition
in class AbstractTabSwitcherLayout
index
- The index of the item, whose position should be calculated, as an Integer
+ valueFloat
value or -1, if no
+ maximum position is availableprotected final float calculateSuccessorPosition(@NonNull + AbstractItem item, + @NonNull + AbstractItem predecessor)+
AbstractTabSwitcherLayout
calculateSuccessorPosition
in class AbstractTabSwitcherLayout
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 final float calculatePredecessorPosition(@NonNull + AbstractItem item, + @NonNull + AbstractItem successor)+
AbstractTabSwitcherLayout
calculatePredecessorPosition
in class AbstractTabSwitcherLayout
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 final void secondLayoutPass(@NonNull + AbstractItemIterator.AbstractBuilder builder)+
AbstractTabSwitcherLayout
secondLayoutPass
in class AbstractTabSwitcherLayout
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 final de.mrapp.android.util.view.AbstractViewRecycler.Adapter<Tab,java.lang.Void> onCreateContentRecyclerAdapter()+
AbstractTabSwitcherLayout
onCreateContentRecyclerAdapter
in class AbstractTabSwitcherLayout
public final void onGlobalLayout()+
onGlobalLayout
in interface android.view.ViewTreeObserver.OnGlobalLayoutListener
@Nullable +public final android.view.ViewGroup getTabContainer()+
TabSwitcherLayout
getTabContainer
in interface TabSwitcherLayout
ViewGroup
or null, if the view has not been laid out yet@Nullable +public final android.support.v7.widget.Toolbar[] getToolbars()+
TabSwitcherLayout
TabSwitcher.PRIMARY_TOOLBAR_INDEX
+ of the returned array corresponds to the primary toolbar and the index TabSwitcher.SECONDARY_TOOLBAR_INDEX
corresponds to the secondary toolbar.getToolbars
in interface TabSwitcherLayout
public final void onSelectionChanged(int previousIndex, + int index, + @Nullable + Tab selectedTab, + boolean switcherHidden)+
Model.Listener
onSelectionChanged
in interface Model.Listener
previousIndex
- 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 otherwiseprotected final void updateView(@NonNull + AbstractItem item, + boolean dragging)+
AbstractTabSwitcherLayout
updateView
in class AbstractTabSwitcherLayout
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 otherwisepublic final void onTabAdded(int index, + @NonNull + Tab tab, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + boolean switcherVisibilityChanged, + @NonNull + Animation animation)+
Model.Listener
onTabAdded
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection has changed, false otherwiseswitcherVisibilityChanged
- 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, + @NonNull + Tab[] tabs, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + @NonNull + Animation animation)+
Model.Listener
onAllTabsAdded
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection has changed, false otherwiseanimation
- 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, + @NonNull + Tab tab, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + @NonNull + Animation animation)+
Model.Listener
onTabRemoved
in interface Model.Listener
index
- 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 tabsselectionChanged
- True, if the selection changed, false otherwiseanimation
- 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(@NonNull + Tab[] tabs, + @NonNull + Animation animation)+
Model.Listener
onAllTabsRemoved
in interface Model.Listener
tabs
- 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.Listener
onPaddingChanged
in interface Model.Listener
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
applyPaddingToTabs
- True, if the padding of the tab switcher is applied to the content of its tabs,
+ false otherwisepublic void onTabBackgroundColorChanged(@Nullable + android.content.res.ColorStateList colorStateList)+
Model.Listener
onTabBackgroundColorChanged
in interface Model.Listener
onTabBackgroundColorChanged
in class AbstractTabSwitcherLayout
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 onAddTabButtonVisibilityChanged(boolean visible)+
Model.Listener
onAddTabButtonVisibilityChanged
in interface Model.Listener
onAddTabButtonVisibilityChanged
in class AbstractTabSwitcherLayout
visible
- True, if the button, which allows to add a new tab, should be shown, false
+ otherwisepublic final void onEmptyViewChanged(@Nullable + android.view.View view, + long animationDuration)+
Model.Listener
onEmptyViewChanged
in interface Model.Listener
view
- 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 usedpublic final void onSwitchingBetweenTabs(int selectedTabIndex, + float distance)+
SwipeGestureEventHandler.Callback
onSwitchingBetweenTabs
in interface SwipeGestureEventHandler.Callback
selectedTabIndex
- The index of the currently selected tab as an Integer
valuedistance
- The distance, the currently selected tab is swiped by, in pixels as a Float
valuepublic final void onSwitchingBetweenTabsEnded(int selectedTabIndex, + int previousSelectedTabIndex, + boolean selectionChanged, + float velocity, + long animationDuration)+
SwipeGestureEventHandler.Callback
onSwitchingBetweenTabsEnded
in interface SwipeGestureEventHandler.Callback
selectedTabIndex
- The index of the tab, which should become selected, as an Integer
valuepreviousSelectedTabIndex
- The index of the previously selected tab as an Integer
valueselectionChanged
- True, if the selection has changed, false otherwisevelocity
- The velocity of the swipe gesture in pixels per second as a Float
valueanimationDuration
- The duration of the swipe animation in milliseconds as a Long
valuepublic final void onTitleChanged(@NonNull + Tab tab)+
Tab.Callback
onTitleChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onIconChanged(@NonNull + Tab tab)+
Tab.Callback
onIconChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onCloseableChanged(@NonNull + Tab tab)+
Tab.Callback
onCloseableChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onCloseButtonIconChanged(@NonNull + Tab tab)+
Tab.Callback
onCloseButtonIconChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onBackgroundColorChanged(@NonNull + Tab tab)+
Tab.Callback
onBackgroundColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onContentBackgroundColorChanged(@NonNull + Tab tab)+
Tab.Callback
onContentBackgroundColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onTitleTextColorChanged(@NonNull + Tab tab)+
Tab.Callback
onTitleTextColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onProgressBarVisibilityChanged(@NonNull + Tab tab)+
Tab.Callback
onProgressBarVisibilityChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic final void onProgressBarColorChanged(@NonNull + Tab tab)+
Tab.Callback
onProgressBarColorChanged
in interface Tab.Callback
tab
- The observed tab as an instance of the class Tab
. The tab may not be
+ nullpublic class TabletTabViewHolder +extends AbstractTabViewHolder+
TabSwitcher
+ consists of, when using the tablet layout.closeButton, iconImageView, progressBar, titleContainer, titleTextView
Constructor and Description | +
---|
TabletTabViewHolder() |
+
Class | +Description | +
---|---|
TabletArithmetics | +
+ Provides methods, which allow to calculate the position, size and rotation of a
+TabSwitcher 's tabs, when using the tablet layout. |
+
TabletContentRecyclerAdapterWrapper | +
+ A 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 . |
+
TabletDragTabsEventHandler | +
+ A drag handler, which allows to calculate the position and state of tabs on touch events, when
+ using the tablet layout.
+ |
+
TabletTabRecyclerAdapter | +
+ A view recycler adapter, which allows to inflate the views, which are used to visualize the tabs
+ of a
+TabSwitcher , when using the tablet layout. |
+
TabletTabSwitcherLayout | +
+ A layout, which implements the functionality of a
+TabSwitcher on tablets. |
+
TabletTabViewHolder | +
+ A view holder, which allows to store references to the views, a tab of a
+TabSwitcher
+ consists of, when using the tablet layout. |
+
public abstract class AbstractItem
+extends java.lang.Object
+TabSwitcher
.Constructor and Description | +
---|
AbstractItem(int index)
+Creates a new item, which contains information about a child view of a
+TabSwitcher . |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+getIndex()
+Returns the index of the item.
+ |
+
Tag |
+getTag()
+Returns the tag, which is associated with the item.
+ |
+
android.view.View |
+getView()
+Returns the view, which is used to visualize the item.
+ |
+
boolean |
+isInflated()
+Returns, whether a view, which is used to visualize the item, is currently inflated, or not.
+ |
+
boolean |
+isVisible()
+Returns, whether the item is currently visible, or not.
+ |
+
void |
+setTag(Tag tag)
+Sets the tag, which is associated with the item.
+ |
+
void |
+setView(android.view.View view)
+Sets the view, which is used to visualize the item.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AbstractItem(int index)+
TabSwitcher
.index
- The index of the item as an Integer
value. The index must be at least 0public final int getIndex()+
Integer
value. The index must be at least 0public final android.view.View getView()+
View
or null, if no such view is currently inflatedpublic final void setView(@Nullable + android.view.View view)+
view
- The view, which should be set, as an instance of the class View
or null, if
+ no view should be set@NonNull +public final Tag getTag()+
Tag
. The tag may not be nullpublic final void setTag(@NonNull + Tag tag)+
tag
- The tag, which should be set, as an instance of the class Tag
. The tag may
+ not be nullpublic final boolean isVisible()+
@CallSuper +public boolean isInflated()+
public class AddTabItem +extends AbstractItem+
TabSwitcher
, which allows to add a
+ new tab.Modifier and Type | +Method and Description | +
---|---|
static AddTabItem |
+create(de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler)
+Creates a new item, which contains information about a button of a
+TabSwitcher , which
+ allows to add a new tab. |
+
boolean |
+equals(java.lang.Object obj) |
+
int |
+hashCode() |
+
java.lang.String |
+toString() |
+
getIndex, getTag, getView, isInflated, isVisible, setTag, setView
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
@NonNull +public static AddTabItem create(@NonNull + de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler)+
TabSwitcher
, which
+ allows to add a new tab.viewRecycler
- The view recycler, which is used to reuse the views, which are used to visualize
+ tabs, as an instance of the class AttachedViewRecycler. The view recycler may not be
+ nullAddTabItem
. The
+ item may not be nullpublic final java.lang.String toString()+
toString
in class java.lang.Object
public final int hashCode()+
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object obj)+
equals
in class java.lang.Object
public class ItemComparator +extends java.lang.Object +implements java.util.Comparator<AbstractItem>+
AbstractItem
.Constructor and Description | +
---|
ItemComparator(TabSwitcher tabSwitcher)
+Creates a new comparator, which allows to compare two instances of the class
+AbstractItem . |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+compare(AbstractItem o1,
+ AbstractItem o2) |
+
protected TabSwitcher |
+getTabSwitcher()
+Returns the tab switcher, the items, which are compared by the comparator, belong to.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public ItemComparator(@NonNull + TabSwitcher tabSwitcher)+
AbstractItem
.tabSwitcher
- The tab switcher, the tab items, which should be compared by the comparator, belong
+ to, as a instance of the class TabSwitcher
. The tab switcher may not be null@NonNull +protected final TabSwitcher getTabSwitcher()+
TabSwitcher
. The tab switcher may not be nullpublic int compare(AbstractItem o1, + AbstractItem o2)+
compare
in interface java.util.Comparator<AbstractItem>
public static interface Model.Listener
+Modifier and Type | +Method and Description | +
---|---|
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,
+ boolean selectionChanged,
+ 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 |
+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 |
+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 |
+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 |
+onSelectionChanged(int previousIndex,
+ int index,
+ Tab selectedTab,
+ boolean switcherHidden)
+The method, which is invoked, when the currently selected tab has been changed.
+ |
+
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 selectionChanged,
+ 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,
+ boolean selectionChanged,
+ 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 |
+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.
+ |
+
void onLogLevelChanged(@NonNull + de.mrapp.android.util.logging.LogLevel logLevel)+
logLevel
- The log level, which has been set, as a value of the enum LogLevel. The log level
+ may not be nullvoid onDecoratorChanged(@NonNull + TabSwitcherDecorator decorator)+
decorator
- The decorator, which has been set, as an instance of the class TabSwitcherDecorator
. The decorator may not be nullvoid onSwitcherShown()+
void onSwitcherHidden()+
void onSelectionChanged(int previousIndex, + int index, + @Nullable + Tab selectedTab, + boolean switcherHidden)+
previousIndex
- 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 otherwisevoid onTabAdded(int index, + @NonNull + Tab tab, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + boolean switcherVisibilityChanged, + @NonNull + Animation animation)+
index
- 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 tabsselectionChanged
- True, if the selection has changed, false otherwiseswitcherVisibilityChanged
- 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 nullvoid onAllTabsAdded(int index, + @NonNull + Tab[] tabs, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + @NonNull + Animation animation)+
index
- 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 selectedselectionChanged
- True, if the selection has changed, false otherwiseselectedTabIndex
- 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 nullvoid onTabRemoved(int index, + @NonNull + Tab tab, + int previousSelectedTabIndex, + int selectedTabIndex, + boolean selectionChanged, + @NonNull + Animation animation)+
index
- 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 tabsselectionChanged
- True, if the selection changed, false otherwiseanimation
- The animation, which has been used to remove the tab, as an instance of the class
+ Animation
. The animation may not be nullvoid onAllTabsRemoved(@NonNull + Tab[] tabs, + @NonNull + Animation animation)+
void onPaddingChanged(int left, + int top, + int right, + int bottom)+
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
valuevoid onApplyPaddingToTabsChanged(boolean applyPaddingToTabs)+
applyPaddingToTabs
- True, if the padding of the tab switcher is applied to the content of its tabs,
+ false otherwisevoid onTabIconChanged(@Nullable + android.graphics.drawable.Drawable icon)+
icon
- The icon, which has been set, as an instance of the class Drawable
or
+ null, if no icon is setvoid onTabBackgroundColorChanged(@Nullable + android.content.res.ColorStateList colorStateList)+
colorStateList
- The color state list, which has been set, as an instance of the class ColorStateList
or null, if the default color should be usedvoid onTabContentBackgroundColorChanged(int color)+
color
- The color, which has been set, as an Integer
value or -1, if the default
+ color should be usedvoid onTabTitleColorChanged(@Nullable + android.content.res.ColorStateList colorStateList)+
colorStateList
- The color state list, which has been set, as an instance of the class ColorStateList
or null, if the default color should be usedvoid onTabCloseButtonIconChanged(@Nullable + android.graphics.drawable.Drawable icon)+
icon
- The icon, which has been set, as an instance of the class Drawable
or
+ null, if the default icon should be usedvoid onTabProgressBarColorChanged(int color)+
color
- The color, which has been set, as an Integer
value or -1, if the default
+ color should be usedvoid onAddTabButtonVisibilityChanged(boolean visible)+
visible
- True, if the button, which allows to add a new tab, should be shown, false
+ otherwisevoid onAddTabButtonColorChanged(@Nullable + android.content.res.ColorStateList colorStateList)+
colorStateList
- The color, which has been set, as an instance of the class ColorStateList
+ or null, if the default color should be usedvoid onToolbarVisibilityChanged(boolean visible)+
visible
- True, if the toolbars should be shown, when the tab switcher is shown, false
+ otherwisevoid onToolbarTitleChanged(@Nullable + java.lang.CharSequence title)+
title
- The title, which has been set, as an instance of the type CharSequence
or
+ null, if no title is setvoid onToolbarNavigationIconChanged(@Nullable + android.graphics.drawable.Drawable icon, + @Nullable + android.view.View.OnClickListener 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 notifiedvoid onToolbarMenuInflated(@MenuRes + int resourceId, + @Nullable + android.support.v7.widget.Toolbar.OnMenuItemClickListener 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 notifiedvoid onEmptyViewChanged(@Nullable + android.view.View view, + long animationDuration)+
view
- 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 usedpublic interface Model +extends java.lang.Iterable<Tab>+
TabSwitcher
must
+ implement.Modifier and Type | +Interface and Description | +
---|---|
static interface |
+Model.Listener
+Defines the interface, a class, which should be notified about the model's events, must
+ implement.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addAllTabs(java.util.Collection<? extends Tab> tabs)
+Adds all tabs, which are contained by a collection, to the tab switcher.
+ |
+
void |
+addAllTabs(java.util.Collection<? extends Tab> tabs,
+ int index)
+Adds all tabs, which are contained by a collection, to the tab switcher, starting at a
+ specific index.
+ |
+
void |
+addAllTabs(java.util.Collection<? extends Tab> tabs,
+ int index,
+ Animation animation)
+Adds all tabs, which are contained by a collection, to the tab switcher, starting at a
+ specific index.
+ |
+
void |
+addAllTabs(Tab[] tabs)
+Adds all tabs, which are contained by an array, to the tab switcher.
+ |
+
void |
+addAllTabs(Tab[] tabs,
+ int index)
+Adds all tabs, which are contained by an array, to the tab switcher, starting at a specific
+ index.
+ |
+
void |
+addAllTabs(Tab[] tabs,
+ int index,
+ Animation animation)
+Adds all tabs, which are contained by an array, to the tab switcher, starting at a specific
+ index.
+ |
+
void |
+addCloseTabListener(TabCloseListener listener)
+Adds a new listener, which should be notified, when a tab is about to be closed by clicking
+ its close button.
+ |
+
void |
+addTab(Tab tab)
+Adds a new tab to the tab switcher.
+ |
+
void |
+addTab(Tab tab,
+ int index)
+Adds a new tab to the tab switcher at a specific index.
+ |
+
void |
+addTab(Tab tab,
+ int index,
+ Animation animation)
+Adds a new tab to the tab switcher at a specific index.
+ |
+
void |
+addTabPreviewListener(TabPreviewListener listener)
+Adds a new listener, which should be notified, when the preview of a tab is about to be
+ loaded.
+ |
+
void |
+applyPaddingToTabs(boolean applyPaddingToTabs)
+Sets, whether the padding of the tab switcher should be applied to the content of its tabs,
+ or not.
+ |
+
boolean |
+areSavedStatesClearedWhenRemovingTabs()
+Returns, whether saved states of tabs are cleared when the corresponding tabs are removed
+ from the tab switcher, or not.
+ |
+
boolean |
+areToolbarsShown()
+Returns, whether the toolbars are shown, when the tab switcher is shown, or not.
+ |
+
void |
+clear()
+Removes all tabs from the tab switcher.
+ |
+
void |
+clear(Animation animation)
+Removes all tabs from the tab switcher.
+ |
+
void |
+clearSavedStatesWhenRemovingTabs(boolean clear)
+Sets, whether saved states of tabs should be cleared when the corresponding tabs are removed,
+ or not.
+ |
+
android.content.res.ColorStateList |
+getAddTabButtonColor()
+Returns the color of the button, which allows to add a new tab.
+ |
+
android.content.Context |
+getContext()
+Returns the context, which is used by the tab switcher.
+ |
+
int |
+getCount()
+Returns the number of tabs, which are contained by the tab switcher.
+ |
+
TabSwitcherDecorator |
+getDecorator()
+Returns the decorator, which allows to inflate the views, which correspond to the tabs of the
+ tab switcher.
+ |
+
android.view.View |
+getEmptyView()
+Returns the view, which is shown, when the tab switcher is empty.
+ |
+
de.mrapp.android.util.logging.LogLevel |
+getLogLevel()
+Returns the log level, which is used for logging.
+ |
+
int |
+getPaddingBottom()
+Returns the bottom padding of the tab switcher.
+ |
+
int |
+getPaddingEnd()
+Returns the end padding of the tab switcher.
+ |
+
int |
+getPaddingLeft()
+Returns the left padding of the tab switcher.
+ |
+
int |
+getPaddingRight()
+Returns the right padding of the tab switcher.
+ |
+
int |
+getPaddingStart()
+Returns the start padding of the tab switcher.
+ |
+
int |
+getPaddingTop()
+Returns the top padding of the tab switcher.
+ |
+
Tab |
+getSelectedTab()
+Returns the currently selected tab.
+ |
+
int |
+getSelectedTabIndex()
+Returns the index of the currently selected tab.
+ |
+
Tab |
+getTab(int index)
+Returns the tab at a specific index.
+ |
+
android.content.res.ColorStateList |
+getTabBackgroundColor()
+Returns the default background color of a tab.
+ |
+
android.graphics.drawable.Drawable |
+getTabCloseButtonIcon()
+Returns the default icon of a tab's close button.
+ |
+
android.content.res.ColorStateList |
+getTabCloseButtonIconTintList()
+Returns the color state list, which is used to tint the close button of a tab.
+ |
+
android.graphics.PorterDuff.Mode |
+getTabCloseButtonIconTintMode()
+Returns the mode, which is used to tint the close button of a tab.
+ |
+
int |
+getTabContentBackgroundColor()
+Returns the default background color of a tab's content.
+ |
+
android.graphics.drawable.Drawable |
+getTabIcon()
+Returns the default icon of a tab.
+ |
+
android.content.res.ColorStateList |
+getTabIconTintList()
+Returns the color state list, which is used to tint the icon of a tab.
+ |
+
android.graphics.PorterDuff.Mode |
+getTabIconTintMode()
+Returns the mode, which is used to tint the icon of a tab.
+ |
+
long |
+getTabPreviewFadeDuration()
+Returns the duration of the fade animation, which is used to show the preview of tabs.
+ |
+
long |
+getTabPreviewFadeThreshold()
+Returns the duration, which must be reached when loading the preview of a tab to use a fade
+ animation.
+ |
+
int |
+getTabProgressBarColor()
+Returns the color of a tab's progress bar.
+ |
+
android.content.res.ColorStateList |
+getTabTitleTextColor()
+Returns the default text color of a tab's title.
+ |
+
android.graphics.drawable.Drawable |
+getToolbarNavigationIcon()
+Returns the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
android.content.res.ColorStateList |
+getToolbarNavigationIconTintList()
+Returns the color state list, which is used to tint the navigation icon of the toolbar, which
+ is shown, when the tab switcher is shown.
+ |
+
android.graphics.PorterDuff.Mode |
+getToolbarNavigationIconTintMode()
+Returns the mode, which is used to tint the navigation icon of the toolbar, which is shown,
+ when the tab switcher is shown.
+ |
+
java.lang.CharSequence |
+getToolbarTitle()
+Returns the title of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+hideSwitcher()
+Hides the tab switcher by using an animation, if it is currently shown.
+ |
+
int |
+indexOf(Tab tab)
+Returns the index of a specific tab.
+ |
+
void |
+inflateToolbarMenu(int resourceId,
+ android.support.v7.widget.Toolbar.OnMenuItemClickListener listener)
+Inflates the menu of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
boolean |
+isAddTabButtonShown()
+Returns, whether a button, which allows to add a new tab, is shown.
+ |
+
boolean |
+isEmpty()
+Returns, whether the tab switcher is empty, or not.
+ |
+
boolean |
+isPaddingAppliedToTabs()
+Returns, whether the padding of the tab switcher is applied to the content of its tabs, or
+ not.
+ |
+
boolean |
+isSwitcherShown()
+Returns, whether the tab switcher is currently shown.
+ |
+
void |
+removeCloseTabListener(TabCloseListener listener)
+Removes a specific listener, which should not be notified, when a tab is about to be closed
+ by clicking its close button, anymore.
+ |
+
void |
+removeTab(Tab tab)
+Removes a specific tab from the tab switcher.
+ |
+
void |
+removeTab(Tab tab,
+ Animation animation)
+Removes a specific tab from the tab switcher.
+ |
+
void |
+removeTabPreviewListener(TabPreviewListener listener)
+Removes a specific listener, which should not be notified, when the preview of a tab is about
+ to be loaded.
+ |
+
void |
+selectTab(int index)
+Selects the tab as a specific index.
+ |
+
void |
+selectTab(Tab tab)
+Selects a specific tab.
+ |
+
void |
+setAddTabButtonColor(android.content.res.ColorStateList colorStateList)
+Sets the color of the button, which allows to add a new tab.
+ |
+
void |
+setAddTabButtonColor(int color)
+Sets the color of the button, which allows to add a new tab.
+ |
+
void |
+setDecorator(TabSwitcherDecorator decorator)
+Sets the decorator, which allows to inflate the views, which correspond to the tabs of the
+ tab switcher.
+ |
+
void |
+setEmptyView(int resourceId)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setEmptyView(int resourceId,
+ long animationDuration)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setEmptyView(android.view.View view)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setEmptyView(android.view.View view,
+ long animationDuration)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setLogLevel(de.mrapp.android.util.logging.LogLevel logLevel)
+Sets the log level, which should be used for logging.
+ |
+
void |
+setPadding(int left,
+ int top,
+ int right,
+ int bottom)
+Sets the padding of the tab switcher.
+ |
+
void |
+setTabBackgroundColor(android.content.res.ColorStateList colorStateList)
+Sets the default background color of a tab.
+ |
+
void |
+setTabBackgroundColor(int color)
+Sets the default background color of a tab.
+ |
+
void |
+setTabCloseButtonIcon(android.graphics.Bitmap icon)
+Sets the default icon of a tab's close button.
+ |
+
void |
+setTabCloseButtonIcon(int resourceId)
+Sets the default icon of a tab's close button.
+ |
+
void |
+setTabCloseButtonIconTint(int color)
+Sets the color, which should be used to tint the close button of a tab.
+ |
+
void |
+setTabCloseButtonIconTintList(android.content.res.ColorStateList tintList)
+Sets the color state list, which should be used to tint the close button of a tab.
+ |
+
void |
+setTabCloseButtonIconTintMode(android.graphics.PorterDuff.Mode mode)
+Sets the mode, which should be used to tint the close button of a tab.
+ |
+
void |
+setTabContentBackgroundColor(int color)
+Sets the default background color of a tab's content.
+ |
+
void |
+setTabIcon(android.graphics.Bitmap icon)
+Sets the default icon of a tab.
+ |
+
void |
+setTabIcon(int resourceId)
+Sets the default icon of a tab.
+ |
+
void |
+setTabIconTint(int color)
+Sets the color, which should be used to tint the icon of a tab.
+ |
+
void |
+setTabIconTintList(android.content.res.ColorStateList tintList)
+Sets the color state list, which should be used to tint the icon of a tab.
+ |
+
void |
+setTabIconTintMode(android.graphics.PorterDuff.Mode mode)
+Sets the mode, which should be used to tint the icon of a tab.
+ |
+
void |
+setTabPreviewFadeDuration(long duration)
+Sets the duration of the fade animation, which is used to show the preview of tabs.
+ |
+
void |
+setTabPreviewFadeThreshold(long threshold)
+Sets the duration, which must be reached when loading the preview of a tab to use a fade
+ animation.
+ |
+
void |
+setTabProgressBarColor(int color)
+Sets the color of a tab's progress bar.
+ |
+
void |
+setTabTitleTextColor(android.content.res.ColorStateList colorStateList)
+Sets the default text color of a tab's title.
+ |
+
void |
+setTabTitleTextColor(int color)
+Sets the default text color of a tab's title.
+ |
+
void |
+setToolbarNavigationIcon(android.graphics.drawable.Drawable icon,
+ android.view.View.OnClickListener listener)
+Sets the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIcon(int resourceId,
+ android.view.View.OnClickListener listener)
+Sets the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIconTint(int color)
+Sets the color, which should be used to tint the navigation icon of the toolbar, which is
+ shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIconTintList(android.content.res.ColorStateList tintList)
+Sets the color state list, which should be used to tint the navigation icon of the toolbar,
+ which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIconTintMode(android.graphics.PorterDuff.Mode mode)
+Sets the mode, which should be used to tint the navigation icon of the toolbar, which is
+ shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarTitle(java.lang.CharSequence title)
+Sets the title of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarTitle(int resourceId)
+Sets the title of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+showAddTabButton(AddTabButtonListener listener)
+Sets, whether a button, which allows to add a new tab, should be shown.
+ |
+
void |
+showSwitcher()
+Shows the tab switcher by using an animation, if it is not already shown.
+ |
+
void |
+showToolbars(boolean show)
+Sets, whether the toolbars should be shown, when the tab switcher is shown, or not.
+ |
+
void |
+toggleSwitcherVisibility()
+Toggles the visibility of the tab switcher by using an animation, i.e.
+ |
+
forEach, iterator, spliterator
android.content.Context getContext()+
Context
. The context may not be nullvoid setDecorator(@NonNull + TabSwitcherDecorator decorator)+
decorator
- The decorator, which should be set, as an instance of the class TabSwitcherDecorator
. The decorator may not be nullTabSwitcherDecorator getDecorator()+
TabSwitcherDecorator
or null, if no
+ decorator has been set@NonNull +de.mrapp.android.util.logging.LogLevel getLogLevel()+
void setLogLevel(@NonNull + de.mrapp.android.util.logging.LogLevel logLevel)+
logLevel
- The log level, which should be set, as a value of the enum LogLevel. The log level
+ may not be nullboolean isEmpty()+
int getCount()+
Integer
+ value@NonNull +Tab getTab(int index)+
index
- The index of the tab, which should be returned, as an Integer
value. The
+ index must be at least 0 and at maximum getCount() - 1
, otherwise a
+ IndexOutOfBoundsException
will be thrownTab
. The tab may not be nullint indexOf(@NonNull + Tab tab)+
tab
- The tab, whose index should be returned, as an instance of the class Tab
. The
+ tab may not be nullInteger
value or -1, if the given tab is not
+ contained by the tab switchervoid addTab(@NonNull + Tab tab)+
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an
+ animation is currently running, the tab will be added once all previously started animations
+ have been finished.tab
- The tab, which should be added, as an instance of the class Tab
. The tab may
+ not be nullvoid addTab(@NonNull + Tab tab, + int index)+
SwipeAnimation
with direction
+ SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tab
+ will be added once all previously started animations have been finished.tab
- The tab, which should be added, as an instance of the class Tab
. The tab may
+ not be nullindex
- The index, the tab should be added at, as an Integer
value. The index must be
+ at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownvoid addTab(@NonNull + Tab tab, + int index, + @NonNull + Animation animation)+
tab
- The tab, which should be added, as an instance of the class Tab
. The tab may
+ not be nullindex
- The index, the tab should be added at, as an Integer
value. The index must be
+ at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tab, as an instance of the class
+ Animation
. The animation may not be nullvoid addAllTabs(@NonNull + java.util.Collection<? extends Tab> tabs)+
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
+ be added once all previously started animations have been finished.tabs
- A collection, which contains the tabs, which should be added, as an instance of the
+ type Collection
or an empty collection, if no tabs should be addedvoid addAllTabs(@NonNull + java.util.Collection<? extends Tab> tabs, + int index)+
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is
+ used. If an animation is currently running, the tabs will be added once all previously
+ started animations have been finished.tabs
- A collection, which contains the tabs, which should be added, as an instance of the
+ type Collection
or an empty collection, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownvoid addAllTabs(@NonNull + java.util.Collection<? extends Tab> tabs, + int index, + @NonNull + Animation animation)+
tabs
- A collection, which contains the tabs, which should be added, as an instance of the
+ type Collection
or an empty collection, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tabs, as an instance of the class
+ Animation
. The animation may not be nullvoid addAllTabs(@NonNull + Tab[] tabs)+
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
+ be added once all previously started animations have been finished.tabs
- An array, which contains the tabs, which should be added, as an array of the type
+ Tab
or an empty array, if no tabs should be addedvoid addAllTabs(@NonNull + Tab[] tabs, + int index)+
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is
+ used. If an animation is currently running, the tabs will be added once all previously
+ started animations have been finished.tabs
- An array, which contains the tabs, which should be added, as an array of the type
+ Tab
or an empty array, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownvoid addAllTabs(@NonNull + Tab[] tabs, + int index, + @NonNull + Animation animation)+
tabs
- An array, which contains the tabs, which should be added, as an array of the type
+ Tab
or an empty array, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tabs, as an instance of the class
+ Animation
. The animation may not be nullvoid removeTab(@NonNull + Tab tab)+
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tab will
+ be removed once all previously started animations have been finished.tab
- The tab, which should be removed, as an instance of the class Tab
. The tab
+ may not be nullvoid removeTab(@NonNull + Tab tab, + @NonNull + Animation animation)+
void clear()+
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
+ be removed once all previously started animations have been finished.void clear(@NonNull + Animation animation)+
animation
- The animation, which should be used to remove the tabs, as an instance of the class
+ Animation
. The animation may not be nullboolean isSwitcherShown()+
void showSwitcher()+
void hideSwitcher()+
void toggleSwitcherVisibility()+
@Nullable +Tab getSelectedTab()+
Tab
or null, if no tab
+ is currently selectedint getSelectedTabIndex()+
Integer
value or -1, if no tab
+ is currently selectedvoid selectTab(@NonNull + Tab tab)+
tab
- The tab, which should be selected, as an instance of the class Tab
. The tab
+ may not be null. If the tab is not contained by the tab switcher, a NoSuchElementException
will be thrownvoid selectTab(int index)+
index
- The index of the tab, which should be selected, as an Integer
value. The
+ index must be at least 0 and at maximum getCount() - 1
, otherwise a
+ IndexOutOfBoundsException
will be thrownvoid setPadding(int left, + int top, + int right, + int bottom)+
left
- The left padding, which should be set, in pixels as an Integer
valuetop
- The top padding, which should be set, in pixels as an Integer
valueright
- The right padding, which should be set, in pixels as an Integer
valuebottom
- The bottom padding, which should be set, in pixels as an Integer
valueint getPaddingLeft()+
Integer
valueint getPaddingTop()+
Integer
valueint getPaddingRight()+
Integer
valueint getPaddingBottom()+
Integer
valueint getPaddingStart()+
Integer
valueint getPaddingEnd()+
Integer
valuevoid applyPaddingToTabs(boolean applyPaddingToTabs)+
false
the padding is still taken into account for
+ positioning tabs and the tab switcher's toolbars.applyPaddingToTabs
- True, if the padding of the tab switcher should be applied to the content of its
+ tabs, false otherwiseboolean isPaddingAppliedToTabs()+
@Nullable +android.graphics.drawable.Drawable getTabIcon()+
Drawable
or null, if no
+ icon is setvoid setTabIcon(@DrawableRes + int resourceId)+
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
+ resource id must correspond to a valid drawable resourcevoid setTabIcon(@Nullable + android.graphics.Bitmap icon)+
icon
- The icon, which should be set, as an instance of the class Bitmap
or null, if
+ no icon should be setandroid.content.res.ColorStateList getTabIconTintList()+
ColorStateList
or null, if the icon is not tintedvoid setTabIconTint(int color)+
color
- The color, which should be set, as an Integer
valuevoid setTabIconTintList(@Nullable + android.content.res.ColorStateList tintList)+
tintList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the icon should not be tintedandroid.graphics.PorterDuff.Mode getTabIconTintMode()+
PorterDuff.Mode
or null, if the default mode is usedvoid setTabIconTintMode(@Nullable + android.graphics.PorterDuff.Mode mode)+
mode
- The mode, which should be set, as a value of enum PorterDuff.Mode
or null, if
+ the default mode should be usedandroid.content.res.ColorStateList getTabCloseButtonIconTintList()+
ColorStateList
or null, if the close button is not tintedvoid setTabCloseButtonIconTint(int color)+
color
- The color, which should be set, as an Integer
valuevoid setTabCloseButtonIconTintList(@Nullable + android.content.res.ColorStateList tintList)+
tintList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the close button should not be tintedandroid.graphics.PorterDuff.Mode getTabCloseButtonIconTintMode()+
PorterDuff.Mode
or null, if the default mode is usedvoid setTabCloseButtonIconTintMode(@Nullable + android.graphics.PorterDuff.Mode mode)+
mode
- The mode, which should be set, as a value of enum PorterDuff.Mode
or null, if
+ the default mode should be used@Nullable +android.content.res.ColorStateList getTabBackgroundColor()+
ColorStateList
or null, if the default color is usedvoid setTabBackgroundColor(int color)+
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedvoid setTabBackgroundColor(@Nullable + android.content.res.ColorStateList colorStateList)+
colorStateList
- The color, which should be set, as an instance of the class ColorStateList
or
+ null, if the default color should be usedint getTabContentBackgroundColor()+
Integer
valuevoid setTabContentBackgroundColor(int color)+
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be used@Nullable +android.content.res.ColorStateList getTabTitleTextColor()+
ColorStateList
or null, if the default color is usedvoid setTabTitleTextColor(int color)+
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedvoid setTabTitleTextColor(@Nullable + android.content.res.ColorStateList colorStateList)+
colorStateList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the default color should be used@Nullable +android.graphics.drawable.Drawable getTabCloseButtonIcon()+
Drawable
+ or null, if the default icon is usedint getTabProgressBarColor()+
Integer
value or -1, if the default
+ color is usedvoid setTabProgressBarColor(int color)+
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedvoid setTabCloseButtonIcon(@DrawableRes + int resourceId)+
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
+ resource id must correspond to a valid drawable resourcevoid setTabCloseButtonIcon(@Nullable + android.graphics.Bitmap icon)+
icon
- The icon, which should be set, as an instance of the class Bitmap
or null, if
+ the default icon should be usedboolean isAddTabButtonShown()+
void showAddTabButton(@Nullable + AddTabButtonListener listener)+
listener
- The listener, which should be notified, when the button has been clicked, as an
+ instance of the type AddTabButtonListener
or null, if the button should not
+ be shown@Nullable +android.content.res.ColorStateList getAddTabButtonColor()+
ColorStateList
or null, if the default color is usedvoid setAddTabButtonColor(int color)+
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedvoid setAddTabButtonColor(@Nullable + android.content.res.ColorStateList colorStateList)+
colorStateList
- The color, which should be set, as an instance of the class ColorStateList
or
+ null, if the default color should be usedboolean areToolbarsShown()+
void showToolbars(boolean show)+
show
- True, if the toolbars should be shown, false otherwise@Nullable +java.lang.CharSequence getToolbarTitle()+
CharSequence
or null, if no title is setvoid setToolbarTitle(@StringRes + int resourceId)+
resourceId
- The resource id of the title, which should be set, as an Integer
value. The
+ resource id must correspond to a valid string resourcevoid setToolbarTitle(@Nullable + java.lang.CharSequence title)+
title
- The title, which should be set, as an instance of the type CharSequence
or
+ null, if no title should be set@Nullable +android.graphics.drawable.Drawable getToolbarNavigationIcon()+
Drawable
or null, if no icon is setvoid setToolbarNavigationIcon(@DrawableRes + int resourceId, + @Nullable + android.view.View.OnClickListener listener)+
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
+ resource id must correspond to a valid drawable resourcelistener
- 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
+ notifiedvoid setToolbarNavigationIcon(@Nullable + android.graphics.drawable.Drawable icon, + @Nullable + android.view.View.OnClickListener listener)+
icon
- The icon, which should be set, as an instance of the class Drawable
or null,
+ if no icon should be 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
+ notifiedandroid.content.res.ColorStateList getToolbarNavigationIconTintList()+
ColorStateList
+ or null, if the navigation icon is not tintedvoid setToolbarNavigationIconTint(int color)+
color
- The color, which should be set, as an Integer
valuevoid setToolbarNavigationIconTintList(@Nullable + android.content.res.ColorStateList tintList)+
tintList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the navigation icon should not be tintedandroid.graphics.PorterDuff.Mode getToolbarNavigationIconTintMode()+
PorterDuff.Mode
or null, if
+ the default mode is usedvoid setToolbarNavigationIconTintMode(@Nullable + android.graphics.PorterDuff.Mode mode)+
mode
- The mode, which should be set, as a value of the enum PorterDuff.Mode
or
+ null, if the default mode should be usedvoid inflateToolbarMenu(@MenuRes + int resourceId, + @Nullable + android.support.v7.widget.Toolbar.OnMenuItemClickListener listener)+
resourceId
- The resource id of the menu, which should be inflated, as an Integer
value.
+ The resource id must correspond to a valid menu resourcelistener
- The listener, which should be notified, when an menu item has been clicked, as an
+ instance of the type OnMenuItemClickListener or null, if no listener should be
+ notifiedlong getTabPreviewFadeThreshold()+
Long
valuevoid setTabPreviewFadeThreshold(long threshold)+
threshold
- The duration, which should be set, in milliseconds as a Long
value. The
+ duration must be at least 0long getTabPreviewFadeDuration()+
Long
valuevoid setTabPreviewFadeDuration(long duration)+
duration
- The duration, which should be set, in milliseconds as a Long
value. The
+ duration must be at least 0@Nullable +android.view.View getEmptyView()+
View
or null, if no view is shownvoid setEmptyView(@Nullable + android.view.View view)+
view
- The view, which should be set, as an instance of the class View
or null, if
+ no view should be shown, when the tab switcher is emptyvoid setEmptyView(@Nullable + android.view.View view, + long animationDuration)+
view
- The view, which should be 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 usedvoid setEmptyView(@LayoutRes + int resourceId)+
resourceId
- The resource id of the view, which should be set, as an Integer
value. The
+ resource id must correspond to a valid layout resourcevoid setEmptyView(@LayoutRes + int resourceId, + long animationDuration)+
resourceId
- The resource id of the view, which should be set, as an Integer
value. The
+ resource id must correspond to a valid layout resourceanimationDuration
- 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 usedboolean areSavedStatesClearedWhenRemovingTabs()+
void clearSavedStatesWhenRemovingTabs(boolean clear)+
clear
- True, if the saved states of tabs should be cleared when the corresponding tabs are
+ removed, false otherwisevoid addCloseTabListener(@NonNull + TabCloseListener listener)+
listener
- The listener, which should be added, as an instance of the type TabCloseListener
. The listener may not be nullvoid removeCloseTabListener(@NonNull + TabCloseListener listener)+
listener
- The listener, which should be removed, as an instance of the type TabCloseListener
. The listener may not be nullvoid addTabPreviewListener(@NonNull + TabPreviewListener listener)+
listener
- The listener, which should be added, as an instance of the type TabPreviewListener
. The listener may not be nullvoid removeTabPreviewListener(@NonNull + TabPreviewListener listener)+
listener
- The listener, which should be removed, as an instance of the type TabPreviewListener
. The listener may not be nullpublic interface Restorable
+Modifier and Type | +Method and Description | +
---|---|
void |
+restoreInstanceState(android.os.Bundle savedInstanceState)
+Restores a previously saved state.
+ |
+
void |
+saveInstanceState(android.os.Bundle outState)
+Saves the current state.
+ |
+
void saveInstanceState(@NonNull + android.os.Bundle outState)+
outState
- The bundle, which should be used to store the saved state, as an instance of the
+ class Bundle
. The bundle may not be nullvoid restoreInstanceState(@Nullable + android.os.Bundle savedInstanceState)+
savedInstanceState
- The saved state as an instance of the class Bundle
or null, if no saved state
+ is availableEnum Constant and Description | +
---|
FLOATING
+When the tab is floating and freely movable.
+ |
+
HIDDEN
+When the tab is currently not visible, i.e.
+ |
+
STACKED_END
+When the tab is part of the stack, which is located at the end of the switcher.
+ |
+
STACKED_START
+When the tab is part of the stack, which is located at the start of the switcher.
+ |
+
STACKED_START_ATOP
+When the tab is displayed atop of the stack, which is located at the start of the switcher.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static State |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static State[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final State STACKED_START+
public static final State STACKED_START_ATOP+
public static final State FLOATING+
public static final State STACKED_END+
public static final State HIDDEN+
public static State[] values()+
+for (State c : State.values()) + System.out.println(c); +
public static State valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic class TabItem +extends AbstractItem+
TabSwitcher
.Modifier and Type | +Method and Description | +
---|---|
static TabItem |
+create(Model model,
+ de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler,
+ int index)
+Creates a new item, which contains information about a tab of a tab switcher.
+ |
+
static TabItem |
+create(Model model,
+ de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler,
+ int index,
+ Tab tab)
+Creates a new item, which contains information about a specific tab.
+ |
+
static TabItem |
+create(Model model,
+ int index,
+ Tab tab)
+Creates a new item, which contains information about a tab of a tab switcher.
+ |
+
boolean |
+equals(java.lang.Object obj) |
+
Tab |
+getTab()
+Returns the tab.
+ |
+
AbstractTabViewHolder |
+getViewHolder()
+Returns the view holder, which stores references to the views, which belong to the tab.
+ |
+
int |
+hashCode() |
+
boolean |
+isInflated()
+Returns, whether a view, which is used to visualize the item, is currently inflated, or not.
+ |
+
void |
+setViewHolder(AbstractTabViewHolder viewHolder)
+Sets the view holder, which stores references to the views, which belong to the tab.
+ |
+
java.lang.String |
+toString() |
+
getIndex, getTag, getView, isVisible, setTag, setView
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
@NonNull +public static TabItem create(@NonNull + Model model, + int index, + @NonNull + Tab tab)+
model
- The model, the tab belongs to, as an instance of the type Model
. The model
+ may not be nullindex
- The index of the tab as an Integer
value. The index must be at least 0tab
- The tab as an instance of the class Tab
. The tab may not be nullTabItem
. The
+ item may not be null@NonNull +public static TabItem create(@NonNull + Model model, + @NonNull + de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler, + int index)+
model
- The model, the tab belongs to, as an instance of the type Model
. The model
+ may not be nullviewRecycler
- The view recycler, which is used to reuse the views, which are used to visualize
+ tabs, as an instance of the class AttachedViewRecycler. The view recycler may not be
+ nullindex
- The index of the tab as an Integer
value. The index must be at least 0TabItem
. The
+ item may not be null@NonNull +public static TabItem create(@NonNull + Model model, + @NonNull + de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler, + int index, + @NonNull + Tab tab)+
model
- The model, the tab belongs to, as an instance of the type Model
. The model
+ may not be nullviewRecycler
- The view recycler, which is used to reuse the views, which are used to visualize
+ tabs, as an instance of the class AttachedViewRecycler. The view recycler may not be
+ nullindex
- The index of the tab as an Integer
value. The index must be at least 0tab
- The tab as an instance of the class Tab
. The tab may not be nullTabItem
. The
+ item may not be null@NonNull +public final Tab getTab()+
Tab
. The tab may not be nullpublic final AbstractTabViewHolder getViewHolder()+
AbstractTabViewHolder
or null, if
+ no view is is currently inflated to visualize the tabpublic final void setViewHolder(@Nullable + AbstractTabViewHolder viewHolder)+
viewHolder
- The view holder, which should be set, as an instance of the class AbstractTabViewHolder
or null, if no view holder should be setpublic final boolean isInflated()+
AbstractItem
isInflated
in class AbstractItem
public final java.lang.String toString()+
toString
in class java.lang.Object
public final int hashCode()+
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object obj)+
equals
in class java.lang.Object
public class TabSwitcherModel +extends java.lang.Object +implements Model, Restorable+
TabSwitcher
.Model.Listener
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+REFERENCE_TAB_INDEX_EXTRA
+The name of the extra, which is used to store the index of the tab, which is used as a
+ reference, when restoring the positions of tabs, within a bundle.
+ |
+
static java.lang.String |
+REFERENCE_TAB_POSITION_EXTRA
+The name of the extra, which is used to store the position of the tab, which is used as a
+ reference, when restoring the positions of tabs, within a bundle.
+ |
+
Constructor and Description | +
---|
TabSwitcherModel(TabSwitcher tabSwitcher)
+Creates a new model of a
+TabSwitcher . |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addAllTabs(java.util.Collection<? extends Tab> tabs)
+Adds all tabs, which are contained by a collection, to the tab switcher.
+ |
+
void |
+addAllTabs(java.util.Collection<? extends Tab> tabs,
+ int index)
+Adds all tabs, which are contained by a collection, to the tab switcher, starting at a
+ specific index.
+ |
+
void |
+addAllTabs(java.util.Collection<? extends Tab> tabs,
+ int index,
+ Animation animation)
+Adds all tabs, which are contained by a collection, to the tab switcher, starting at a
+ specific index.
+ |
+
void |
+addAllTabs(Tab[] tabs)
+Adds all tabs, which are contained by an array, to the tab switcher.
+ |
+
void |
+addAllTabs(Tab[] tabs,
+ int index)
+Adds all tabs, which are contained by an array, to the tab switcher, starting at a specific
+ index.
+ |
+
void |
+addAllTabs(Tab[] tabs,
+ int index,
+ Animation animation)
+Adds all tabs, which are contained by an array, to the tab switcher, starting at a specific
+ index.
+ |
+
void |
+addCloseTabListener(TabCloseListener listener)
+Adds a new listener, which should be notified, when a tab is about to be closed by clicking
+ its close button.
+ |
+
void |
+addListener(Model.Listener listener)
+Adds a new listener, which should be notified about the model's events.
+ |
+
void |
+addTab(Tab tab)
+Adds a new tab to the tab switcher.
+ |
+
void |
+addTab(Tab tab,
+ int index)
+Adds a new tab to the tab switcher at a specific index.
+ |
+
void |
+addTab(Tab tab,
+ int index,
+ Animation animation)
+Adds a new tab to the tab switcher at a specific index.
+ |
+
void |
+addTabPreviewListener(TabPreviewListener listener)
+Adds a new listener, which should be notified, when the preview of a tab is about to be
+ loaded.
+ |
+
void |
+applyPaddingToTabs(boolean applyPaddingToTabs)
+Sets, whether the padding of the tab switcher should be applied to the content of its tabs,
+ or not.
+ |
+
boolean |
+areSavedStatesClearedWhenRemovingTabs()
+Returns, whether saved states of tabs are cleared when the corresponding tabs are removed
+ from the tab switcher, or not.
+ |
+
boolean |
+areToolbarsShown()
+Returns, whether the toolbars are shown, when the tab switcher is shown, or not.
+ |
+
void |
+clear()
+Removes all tabs from the tab switcher.
+ |
+
void |
+clear(Animation animation)
+Removes all tabs from the tab switcher.
+ |
+
void |
+clearSavedStatesWhenRemovingTabs(boolean clear)
+Sets, whether saved states of tabs should be cleared when the corresponding tabs are removed,
+ or not.
+ |
+
android.content.res.ColorStateList |
+getAddTabButtonColor()
+Returns the color of the button, which allows to add a new tab.
+ |
+
AddTabButtonListener |
+getAddTabButtonListener()
+Returns the listener, which is notified, when the button, which allows to add a new tab, has
+ been clicked.
+ |
+
ContentRecyclerAdapter |
+getContentRecyclerAdapter()
+Returns the adapter, which allows to inflate the views, which are associated with tabs.
+ |
+
android.content.Context |
+getContext()
+Returns the context, which is used by the tab switcher.
+ |
+
int |
+getCount()
+Returns the number of tabs, which are contained by the tab switcher.
+ |
+
TabSwitcherDecorator |
+getDecorator()
+Returns the decorator, which allows to inflate the views, which correspond to the tabs of the
+ tab switcher.
+ |
+
android.view.View |
+getEmptyView()
+Returns the view, which is shown, when the tab switcher is empty.
+ |
+
long |
+getEmptyViewAnimationDuration()
+Returns the duration of the fade animation, which should be used to show or hide the view,
+ which is shown, when the tab switcher is empty.
+ |
+
de.mrapp.android.util.logging.LogLevel |
+getLogLevel()
+Returns the log level, which is used for logging.
+ |
+
int |
+getPaddingBottom()
+Returns the bottom padding of the tab switcher.
+ |
+
int |
+getPaddingEnd()
+Returns the end padding of the tab switcher.
+ |
+
int |
+getPaddingLeft()
+Returns the left padding of the tab switcher.
+ |
+
int |
+getPaddingRight()
+Returns the right padding of the tab switcher.
+ |
+
int |
+getPaddingStart()
+Returns the start padding of the tab switcher.
+ |
+
int |
+getPaddingTop()
+Returns the top padding of the tab switcher.
+ |
+
int |
+getReferenceTabIndex()
+Returns the index of the tab, which is used as a reference, when restoring the positions of
+ tabs.
+ |
+
float |
+getReferenceTabPosition()
+Returns the position of the tab, which is used as a reference, when restoring the positions
+ of tabs.
+ |
+
Tab |
+getSelectedTab()
+Returns the currently selected tab.
+ |
+
int |
+getSelectedTabIndex()
+Returns the index of the currently selected tab.
+ |
+
Tab |
+getTab(int index)
+Returns the tab at a specific index.
+ |
+
android.content.res.ColorStateList |
+getTabBackgroundColor()
+Returns the default background color of a tab.
+ |
+
android.graphics.drawable.Drawable |
+getTabCloseButtonIcon()
+Returns the default icon of a tab's close button.
+ |
+
android.content.res.ColorStateList |
+getTabCloseButtonIconTintList()
+Returns the color state list, which is used to tint the close button of a tab.
+ |
+
android.graphics.PorterDuff.Mode |
+getTabCloseButtonIconTintMode()
+Returns the mode, which is used to tint the close button of a tab.
+ |
+
de.mrapp.android.util.datastructure.ListenerList<TabCloseListener> |
+getTabCloseListeners()
+Returns the listeners, which should be notified, when a tab is about to be closed by clicking
+ its close button.
+ |
+
int |
+getTabContentBackgroundColor()
+Returns the default background color of a tab's content.
+ |
+
android.graphics.drawable.Drawable |
+getTabIcon()
+Returns the default icon of a tab.
+ |
+
android.content.res.ColorStateList |
+getTabIconTintList()
+Returns the color state list, which is used to tint the icon of a tab.
+ |
+
android.graphics.PorterDuff.Mode |
+getTabIconTintMode()
+Returns the mode, which is used to tint the icon of a tab.
+ |
+
long |
+getTabPreviewFadeDuration()
+Returns the duration of the fade animation, which is used to show the preview of tabs.
+ |
+
long |
+getTabPreviewFadeThreshold()
+Returns the duration, which must be reached when loading the preview of a tab to use a fade
+ animation.
+ |
+
de.mrapp.android.util.datastructure.ListenerList<TabPreviewListener> |
+getTabPreviewListeners()
+Returns the listeners, which should be notified, when the previews of tabs are about to be
+ loaded.
+ |
+
int |
+getTabProgressBarColor()
+Returns the color of a tab's progress bar.
+ |
+
android.content.res.ColorStateList |
+getTabTitleTextColor()
+Returns the default text color of a tab's title.
+ |
+
int |
+getToolbarMenuId()
+Returns the resource id of the menu of the toolbar, which is shown, when the tab switcher is
+ shown.
+ |
+
android.support.v7.widget.Toolbar.OnMenuItemClickListener |
+getToolbarMenuItemListener()
+Returns the listener, which is notified, when an item of the menu of the toolbar, which is
+ shown, when the tab switcher is shown, has been clicked.
+ |
+
android.graphics.drawable.Drawable |
+getToolbarNavigationIcon()
+Returns the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
android.view.View.OnClickListener |
+getToolbarNavigationIconListener()
+Returns the listener, which is notified, when the navigation icon of the toolbar, which is
+ shown, when the tab switcher is shown, has been clicked.
+ |
+
android.content.res.ColorStateList |
+getToolbarNavigationIconTintList()
+Returns the color state list, which is used to tint the navigation icon of the toolbar, which
+ is shown, when the tab switcher is shown.
+ |
+
android.graphics.PorterDuff.Mode |
+getToolbarNavigationIconTintMode()
+Returns the mode, which is used to tint the navigation icon of the toolbar, which is shown,
+ when the tab switcher is shown.
+ |
+
java.lang.CharSequence |
+getToolbarTitle()
+Returns the title of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+hideSwitcher()
+Hides the tab switcher by using an animation, if it is currently shown.
+ |
+
int |
+indexOf(Tab tab)
+Returns the index of a specific tab.
+ |
+
void |
+inflateToolbarMenu(int resourceId,
+ android.support.v7.widget.Toolbar.OnMenuItemClickListener listener)
+Inflates the menu of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
boolean |
+isAddTabButtonShown()
+Returns, whether a button, which allows to add a new tab, is shown.
+ |
+
boolean |
+isEmpty()
+Returns, whether the tab switcher is empty, or not.
+ |
+
boolean |
+isPaddingAppliedToTabs()
+Returns, whether the padding of the tab switcher is applied to the content of its tabs, or
+ not.
+ |
+
boolean |
+isSwitcherShown()
+Returns, whether the tab switcher is currently shown.
+ |
+
java.util.Iterator<Tab> |
+iterator() |
+
void |
+removeCloseTabListener(TabCloseListener listener)
+Removes a specific listener, which should not be notified, when a tab is about to be closed
+ by clicking its close button, anymore.
+ |
+
void |
+removeListener(Model.Listener listener)
+Removes a specific listener, which should not be notified about the model's events, anymore.
+ |
+
void |
+removeTab(Tab tab)
+Removes a specific tab from the tab switcher.
+ |
+
void |
+removeTab(Tab tab,
+ Animation animation)
+Removes a specific tab from the tab switcher.
+ |
+
void |
+removeTabPreviewListener(TabPreviewListener listener)
+Removes a specific listener, which should not be notified, when the preview of a tab is about
+ to be loaded.
+ |
+
void |
+restoreInstanceState(android.os.Bundle savedInstanceState)
+Restores a previously saved state.
+ |
+
void |
+saveInstanceState(android.os.Bundle outState)
+Saves the current state.
+ |
+
void |
+selectTab(int index)
+Selects the tab as a specific index.
+ |
+
void |
+selectTab(Tab tab)
+Selects a specific tab.
+ |
+
void |
+setAddTabButtonColor(android.content.res.ColorStateList colorStateList)
+Sets the color of the button, which allows to add a new tab.
+ |
+
void |
+setAddTabButtonColor(int color)
+Sets the color of the button, which allows to add a new tab.
+ |
+
void |
+setDecorator(TabSwitcherDecorator decorator)
+Sets the decorator, which allows to inflate the views, which correspond to the tabs of the
+ tab switcher.
+ |
+
void |
+setEmptyView(int resourceId)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setEmptyView(int resourceId,
+ long animationDuration)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setEmptyView(android.view.View view)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setEmptyView(android.view.View view,
+ long animationDuration)
+Sets the view, which should be shown, when the tab switcher is empty.
+ |
+
void |
+setLogLevel(de.mrapp.android.util.logging.LogLevel logLevel)
+Sets the log level, which should be used for logging.
+ |
+
void |
+setPadding(int left,
+ int top,
+ int right,
+ int bottom)
+Sets the padding of the tab switcher.
+ |
+
void |
+setReferenceTabIndex(int referenceTabIndex)
+Sets the index of the tab, which should be used as a reference, when restoring the positions
+ of tabs.
+ |
+
void |
+setReferenceTabPosition(float referenceTabPosition)
+Sets the position of the tab, which should be used as a reference, when restoring the
+ positions of tabs.
+ |
+
void |
+setTabBackgroundColor(android.content.res.ColorStateList colorStateList)
+Sets the default background color of a tab.
+ |
+
void |
+setTabBackgroundColor(int color)
+Sets the default background color of a tab.
+ |
+
void |
+setTabCloseButtonIcon(android.graphics.Bitmap icon)
+Sets the default icon of a tab's close button.
+ |
+
void |
+setTabCloseButtonIcon(int resourceId)
+Sets the default icon of a tab's close button.
+ |
+
void |
+setTabCloseButtonIconTint(int color)
+Sets the color, which should be used to tint the close button of a tab.
+ |
+
void |
+setTabCloseButtonIconTintList(android.content.res.ColorStateList tintList)
+Sets the color state list, which should be used to tint the close button of a tab.
+ |
+
void |
+setTabCloseButtonIconTintMode(android.graphics.PorterDuff.Mode mode)
+Sets the mode, which should be used to tint the close button of a tab.
+ |
+
void |
+setTabContentBackgroundColor(int color)
+Sets the default background color of a tab's content.
+ |
+
void |
+setTabIcon(android.graphics.Bitmap icon)
+Sets the default icon of a tab.
+ |
+
void |
+setTabIcon(int resourceId)
+Sets the default icon of a tab.
+ |
+
void |
+setTabIconTint(int color)
+Sets the color, which should be used to tint the icon of a tab.
+ |
+
void |
+setTabIconTintList(android.content.res.ColorStateList tintList)
+Sets the color state list, which should be used to tint the icon of a tab.
+ |
+
void |
+setTabIconTintMode(android.graphics.PorterDuff.Mode mode)
+Sets the mode, which should be used to tint the icon of a tab.
+ |
+
void |
+setTabPreviewFadeDuration(long duration)
+Sets the duration of the fade animation, which is used to show the preview of tabs.
+ |
+
void |
+setTabPreviewFadeThreshold(long threshold)
+Sets the duration, which must be reached when loading the preview of a tab to use a fade
+ animation.
+ |
+
void |
+setTabProgressBarColor(int color)
+Sets the color of a tab's progress bar.
+ |
+
void |
+setTabTitleTextColor(android.content.res.ColorStateList colorStateList)
+Sets the default text color of a tab's title.
+ |
+
void |
+setTabTitleTextColor(int color)
+Sets the default text color of a tab's title.
+ |
+
void |
+setToolbarNavigationIcon(android.graphics.drawable.Drawable icon,
+ android.view.View.OnClickListener listener)
+Sets the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIcon(int resourceId,
+ android.view.View.OnClickListener listener)
+Sets the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIconTint(int color)
+Sets the color, which should be used to tint the navigation icon of the toolbar, which is
+ shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIconTintList(android.content.res.ColorStateList tintList)
+Sets the color state list, which should be used to tint the navigation icon of the toolbar,
+ which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarNavigationIconTintMode(android.graphics.PorterDuff.Mode mode)
+Sets the mode, which should be used to tint the navigation icon of the toolbar, which is
+ shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarTitle(java.lang.CharSequence title)
+Sets the title of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+setToolbarTitle(int resourceId)
+Sets the title of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
void |
+showAddTabButton(AddTabButtonListener listener)
+Sets, whether a button, which allows to add a new tab, should be shown.
+ |
+
void |
+showSwitcher()
+Shows the tab switcher by using an animation, if it is not already shown.
+ |
+
void |
+showToolbars(boolean show)
+Sets, whether the toolbars should be shown, when the tab switcher is shown, or not.
+ |
+
void |
+toggleSwitcherVisibility()
+Toggles the visibility of the tab switcher by using an animation, i.e.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final java.lang.String REFERENCE_TAB_INDEX_EXTRA+
public static final java.lang.String REFERENCE_TAB_POSITION_EXTRA+
public TabSwitcherModel(@NonNull + TabSwitcher tabSwitcher)+
TabSwitcher
.tabSwitcher
- The tab switcher, the model belongs to, as an instance of the class ViewGroup
. The parent may not be nullpublic final void addListener(@NonNull + Model.Listener listener)+
listener
- The listener, which should be added, as an instance of the type Listener
. The
+ listener may not be nullpublic final void removeListener(@NonNull + Model.Listener listener)+
listener
- The listener, which should be removed, as an instance of the type Listener
.
+ The listener may not be nullpublic final int getReferenceTabIndex()+
Integer
value or -1, if the positions of tabs should not be restoredpublic final void setReferenceTabIndex(int referenceTabIndex)+
referenceTabIndex
- The index, which should be set, as an Integer
value or -1, if the positions
+ of tabs should not be restoredpublic final float getReferenceTabPosition()+
Float
value or -1, if the positions
+ of tabs should not be restoredpublic final void setReferenceTabPosition(float referenceTabPosition)+
referenceTabPosition
- The position, which should be set, in relation to the available space as a Float
value or -1, if the position of tabs should not be restored@Nullable +public final AddTabButtonListener getAddTabButtonListener()+
AddTabButtonListener
or null, if the button
+ is not shown@Nullable +public final android.view.View.OnClickListener getToolbarNavigationIconListener()+
View.OnClickListener
or null, if no listener should be notified@MenuRes +public final int getToolbarMenuId()+
Integer
value. The resource id must correspond to a valid menu resource@Nullable +public final android.support.v7.widget.Toolbar.OnMenuItemClickListener getToolbarMenuItemListener()+
public final long getEmptyViewAnimationDuration()+
Long
value@NonNull +public final de.mrapp.android.util.datastructure.ListenerList<TabCloseListener> getTabCloseListeners()+
@NonNull +public final de.mrapp.android.util.datastructure.ListenerList<TabPreviewListener> getTabPreviewListeners()+
public final ContentRecyclerAdapter getContentRecyclerAdapter()+
ContentRecyclerAdapter
@NonNull +public final android.content.Context getContext()+
Model
getContext
in interface Model
Context
. The context may not be nullpublic final void setDecorator(@NonNull + TabSwitcherDecorator decorator)+
Model
setDecorator
in interface Model
decorator
- The decorator, which should be set, as an instance of the class TabSwitcherDecorator
. The decorator may not be nullpublic final TabSwitcherDecorator getDecorator()+
Model
getDecorator
in interface Model
TabSwitcherDecorator
or null, if no
+ decorator has been set@NonNull +public final de.mrapp.android.util.logging.LogLevel getLogLevel()+
Model
getLogLevel
in interface Model
public final void setLogLevel(@NonNull + de.mrapp.android.util.logging.LogLevel logLevel)+
Model
setLogLevel
in interface Model
logLevel
- The log level, which should be set, as a value of the enum LogLevel. The log level
+ may not be nullpublic final boolean isEmpty()+
Model
public final int getCount()+
Model
@NonNull +public final Tab getTab(int index)+
Model
getTab
in interface Model
index
- The index of the tab, which should be returned, as an Integer
value. The
+ index must be at least 0 and at maximum getCount() - 1
, otherwise a
+ IndexOutOfBoundsException
will be thrownTab
. The tab may not be nullpublic final int indexOf(@NonNull + Tab tab)+
Model
public final void addTab(@NonNull + Tab tab)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an
+ animation is currently running, the tab will be added once all previously started animations
+ have been finished.public final void addTab(@NonNull + Tab tab, + int index)+
Model
SwipeAnimation
with direction
+ SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tab
+ will be added once all previously started animations have been finished.addTab
in interface Model
tab
- The tab, which should be added, as an instance of the class Tab
. The tab may
+ not be nullindex
- The index, the tab should be added at, as an Integer
value. The index must be
+ at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownpublic final void addTab(@NonNull + Tab tab, + int index, + @NonNull + Animation animation)+
Model
addTab
in interface Model
tab
- The tab, which should be added, as an instance of the class Tab
. The tab may
+ not be nullindex
- The index, the tab should be added at, as an Integer
value. The index must be
+ at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tab, as an instance of the class
+ Animation
. The animation may not be nullpublic final void addAllTabs(@NonNull + java.util.Collection<? extends Tab> tabs)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
+ be added once all previously started animations have been finished.addAllTabs
in interface Model
tabs
- A collection, which contains the tabs, which should be added, as an instance of the
+ type Collection
or an empty collection, if no tabs should be addedpublic final void addAllTabs(@NonNull + java.util.Collection<? extends Tab> tabs, + int index)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is
+ used. If an animation is currently running, the tabs will be added once all previously
+ started animations have been finished.addAllTabs
in interface Model
tabs
- A collection, which contains the tabs, which should be added, as an instance of the
+ type Collection
or an empty collection, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownpublic final void addAllTabs(@NonNull + java.util.Collection<? extends Tab> tabs, + int index, + @NonNull + Animation animation)+
Model
addAllTabs
in interface Model
tabs
- A collection, which contains the tabs, which should be added, as an instance of the
+ type Collection
or an empty collection, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tabs, as an instance of the class
+ Animation
. The animation may not be nullpublic final void addAllTabs(@NonNull + Tab[] tabs)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
+ be added once all previously started animations have been finished.addAllTabs
in interface Model
tabs
- An array, which contains the tabs, which should be added, as an array of the type
+ Tab
or an empty array, if no tabs should be addedpublic final void addAllTabs(@NonNull + Tab[] tabs, + int index)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is
+ used. If an animation is currently running, the tabs will be added once all previously
+ started animations have been finished.addAllTabs
in interface Model
tabs
- An array, which contains the tabs, which should be added, as an array of the type
+ Tab
or an empty array, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownpublic final void addAllTabs(@NonNull + Tab[] tabs, + int index, + @NonNull + Animation animation)+
Model
addAllTabs
in interface Model
tabs
- An array, which contains the tabs, which should be added, as an array of the type
+ Tab
or an empty array, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
+ must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tabs, as an instance of the class
+ Animation
. The animation may not be nullpublic final void removeTab(@NonNull + Tab tab)+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tab will
+ be removed once all previously started animations have been finished.public final void removeTab(@NonNull + Tab tab, + @NonNull + Animation animation)+
Model
public final void clear()+
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
+ be removed once all previously started animations have been finished.public final void clear(@NonNull + Animation animation)+
Model
public final boolean isSwitcherShown()+
Model
isSwitcherShown
in interface Model
public final void showSwitcher()+
Model
showSwitcher
in interface Model
public final void hideSwitcher()+
Model
hideSwitcher
in interface Model
public final void toggleSwitcherVisibility()+
Model
toggleSwitcherVisibility
in interface Model
@Nullable +public final Tab getSelectedTab()+
Model
getSelectedTab
in interface Model
Tab
or null, if no tab
+ is currently selectedpublic final int getSelectedTabIndex()+
Model
getSelectedTabIndex
in interface Model
Integer
value or -1, if no tab
+ is currently selectedpublic final void selectTab(@NonNull + Tab tab)+
Model
public final void selectTab(int index)+
Model
public final java.util.Iterator<Tab> iterator()+
iterator
in interface java.lang.Iterable<Tab>
public final void setPadding(int left, + int top, + int right, + int bottom)+
Model
setPadding
in interface Model
left
- The left padding, which should be set, in pixels as an Integer
valuetop
- The top padding, which should be set, in pixels as an Integer
valueright
- The right padding, which should be set, in pixels as an Integer
valuebottom
- The bottom padding, which should be set, in pixels as an Integer
valuepublic final int getPaddingLeft()+
Model
getPaddingLeft
in interface Model
Integer
valuepublic final int getPaddingTop()+
Model
getPaddingTop
in interface Model
Integer
valuepublic final int getPaddingRight()+
Model
getPaddingRight
in interface Model
Integer
valuepublic final int getPaddingBottom()+
Model
getPaddingBottom
in interface Model
Integer
valuepublic final int getPaddingStart()+
Model
getPaddingStart
in interface Model
Integer
valuepublic final int getPaddingEnd()+
Model
getPaddingEnd
in interface Model
Integer
valuepublic final void applyPaddingToTabs(boolean applyPaddingToTabs)+
Model
false
the padding is still taken into account for
+ positioning tabs and the tab switcher's toolbars.applyPaddingToTabs
in interface Model
applyPaddingToTabs
- True, if the padding of the tab switcher should be applied to the content of its
+ tabs, false otherwisepublic final boolean isPaddingAppliedToTabs()+
Model
isPaddingAppliedToTabs
in interface Model
@Nullable +public final android.graphics.drawable.Drawable getTabIcon()+
Model
getTabIcon
in interface Model
Drawable
or null, if no
+ icon is setpublic final void setTabIcon(@DrawableRes + int resourceId)+
Model
setTabIcon
in interface Model
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
+ resource id must correspond to a valid drawable resourcepublic final void setTabIcon(@Nullable + android.graphics.Bitmap icon)+
Model
setTabIcon
in interface Model
icon
- The icon, which should be set, as an instance of the class Bitmap
or null, if
+ no icon should be setpublic final android.content.res.ColorStateList getTabIconTintList()+
Model
getTabIconTintList
in interface Model
ColorStateList
or null, if the icon is not tintedpublic final void setTabIconTint(int color)+
Model
setTabIconTint
in interface Model
color
- The color, which should be set, as an Integer
valuepublic final void setTabIconTintList(@Nullable + android.content.res.ColorStateList tintList)+
Model
setTabIconTintList
in interface Model
tintList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the icon should not be tintedpublic final android.graphics.PorterDuff.Mode getTabIconTintMode()+
Model
getTabIconTintMode
in interface Model
PorterDuff.Mode
or null, if the default mode is usedpublic final void setTabIconTintMode(@Nullable + android.graphics.PorterDuff.Mode mode)+
Model
setTabIconTintMode
in interface Model
mode
- The mode, which should be set, as a value of enum PorterDuff.Mode
or null, if
+ the default mode should be used@Nullable +public final android.content.res.ColorStateList getTabBackgroundColor()+
Model
getTabBackgroundColor
in interface Model
ColorStateList
or null, if the default color is usedpublic final void setTabBackgroundColor(int color)+
Model
setTabBackgroundColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedpublic final void setTabBackgroundColor(@Nullable + android.content.res.ColorStateList colorStateList)+
Model
setTabBackgroundColor
in interface Model
colorStateList
- The color, which should be set, as an instance of the class ColorStateList
or
+ null, if the default color should be usedpublic final int getTabContentBackgroundColor()+
Model
getTabContentBackgroundColor
in interface Model
Integer
valuepublic final void setTabContentBackgroundColor(int color)+
Model
setTabContentBackgroundColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be used@Nullable +public final android.content.res.ColorStateList getTabTitleTextColor()+
Model
getTabTitleTextColor
in interface Model
ColorStateList
or null, if the default color is usedpublic final void setTabTitleTextColor(int color)+
Model
setTabTitleTextColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedpublic final void setTabTitleTextColor(@Nullable + android.content.res.ColorStateList colorStateList)+
Model
setTabTitleTextColor
in interface Model
colorStateList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the default color should be used@Nullable +public final android.graphics.drawable.Drawable getTabCloseButtonIcon()+
Model
getTabCloseButtonIcon
in interface Model
Drawable
+ or null, if the default icon is usedpublic final int getTabProgressBarColor()+
Model
getTabProgressBarColor
in interface Model
Integer
value or -1, if the default
+ color is usedpublic final void setTabProgressBarColor(int color)+
Model
setTabProgressBarColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedpublic final void setTabCloseButtonIcon(@DrawableRes + int resourceId)+
Model
setTabCloseButtonIcon
in interface Model
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
+ resource id must correspond to a valid drawable resourcepublic final void setTabCloseButtonIcon(@Nullable + android.graphics.Bitmap icon)+
Model
setTabCloseButtonIcon
in interface Model
icon
- The icon, which should be set, as an instance of the class Bitmap
or null, if
+ the default icon should be usedpublic final android.content.res.ColorStateList getTabCloseButtonIconTintList()+
Model
getTabCloseButtonIconTintList
in interface Model
ColorStateList
or null, if the close button is not tintedpublic final void setTabCloseButtonIconTint(int color)+
Model
setTabCloseButtonIconTint
in interface Model
color
- The color, which should be set, as an Integer
valuepublic final void setTabCloseButtonIconTintList(@Nullable + android.content.res.ColorStateList tintList)+
Model
setTabCloseButtonIconTintList
in interface Model
tintList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the close button should not be tintedpublic final android.graphics.PorterDuff.Mode getTabCloseButtonIconTintMode()+
Model
getTabCloseButtonIconTintMode
in interface Model
PorterDuff.Mode
or null, if the default mode is usedpublic final void setTabCloseButtonIconTintMode(@Nullable + android.graphics.PorterDuff.Mode mode)+
Model
setTabCloseButtonIconTintMode
in interface Model
mode
- The mode, which should be set, as a value of enum PorterDuff.Mode
or null, if
+ the default mode should be usedpublic final boolean isAddTabButtonShown()+
Model
isAddTabButtonShown
in interface Model
public final void showAddTabButton(@Nullable + AddTabButtonListener listener)+
Model
showAddTabButton
in interface Model
listener
- The listener, which should be notified, when the button has been clicked, as an
+ instance of the type AddTabButtonListener
or null, if the button should not
+ be shown@Nullable +public final android.content.res.ColorStateList getAddTabButtonColor()+
Model
getAddTabButtonColor
in interface Model
ColorStateList
or null, if the default color is usedpublic final void setAddTabButtonColor(int color)+
Model
setAddTabButtonColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
+ color should be usedpublic final void setAddTabButtonColor(@Nullable + android.content.res.ColorStateList colorStateList)+
Model
setAddTabButtonColor
in interface Model
colorStateList
- The color, which should be set, as an instance of the class ColorStateList
or
+ null, if the default color should be usedpublic final boolean areToolbarsShown()+
Model
areToolbarsShown
in interface Model
public final void showToolbars(boolean show)+
Model
showToolbars
in interface Model
show
- True, if the toolbars should be shown, false otherwise@Nullable +public final java.lang.CharSequence getToolbarTitle()+
Model
getToolbarTitle
in interface Model
CharSequence
or null, if no title is setpublic void setToolbarTitle(@StringRes + int resourceId)+
Model
setToolbarTitle
in interface Model
resourceId
- The resource id of the title, which should be set, as an Integer
value. The
+ resource id must correspond to a valid string resourcepublic final void setToolbarTitle(@Nullable + java.lang.CharSequence title)+
Model
setToolbarTitle
in interface Model
title
- The title, which should be set, as an instance of the type CharSequence
or
+ null, if no title should be set@Nullable +public final android.graphics.drawable.Drawable getToolbarNavigationIcon()+
Model
getToolbarNavigationIcon
in interface Model
Drawable
or null, if no icon is setpublic final void setToolbarNavigationIcon(@DrawableRes + int resourceId, + @Nullable + android.view.View.OnClickListener listener)+
Model
setToolbarNavigationIcon
in interface Model
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
+ resource id must correspond to a valid drawable resourcelistener
- 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 setToolbarNavigationIcon(@Nullable + android.graphics.drawable.Drawable icon, + @Nullable + android.view.View.OnClickListener listener)+
Model
setToolbarNavigationIcon
in interface Model
icon
- The icon, which should be set, as an instance of the class Drawable
or null,
+ if no icon should be 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 android.content.res.ColorStateList getToolbarNavigationIconTintList()+
Model
getToolbarNavigationIconTintList
in interface Model
ColorStateList
+ or null, if the navigation icon is not tintedpublic final void setToolbarNavigationIconTint(int color)+
Model
setToolbarNavigationIconTint
in interface Model
color
- The color, which should be set, as an Integer
valuepublic final void setToolbarNavigationIconTintList(@Nullable + android.content.res.ColorStateList tintList)+
Model
setToolbarNavigationIconTintList
in interface Model
tintList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the navigation icon should not be tintedpublic final android.graphics.PorterDuff.Mode getToolbarNavigationIconTintMode()+
Model
getToolbarNavigationIconTintMode
in interface Model
PorterDuff.Mode
or null, if
+ the default mode is usedpublic final void setToolbarNavigationIconTintMode(@Nullable + android.graphics.PorterDuff.Mode mode)+
Model
setToolbarNavigationIconTintMode
in interface Model
mode
- The mode, which should be set, as a value of the enum PorterDuff.Mode
or
+ null, if the default mode should be usedpublic final void inflateToolbarMenu(@MenuRes + int resourceId, + @Nullable + android.support.v7.widget.Toolbar.OnMenuItemClickListener listener)+
Model
inflateToolbarMenu
in interface Model
resourceId
- The resource id of the menu, which should be inflated, as an Integer
value.
+ The resource id must correspond to a valid menu resourcelistener
- The listener, which should be notified, when an menu item has been clicked, as an
+ instance of the type OnMenuItemClickListener or null, if no listener should be
+ notifiedpublic final long getTabPreviewFadeThreshold()+
Model
getTabPreviewFadeThreshold
in interface Model
Long
valuepublic final void setTabPreviewFadeThreshold(long threshold)+
Model
setTabPreviewFadeThreshold
in interface Model
threshold
- The duration, which should be set, in milliseconds as a Long
value. The
+ duration must be at least 0public final long getTabPreviewFadeDuration()+
Model
getTabPreviewFadeDuration
in interface Model
Long
valuepublic final void setTabPreviewFadeDuration(long duration)+
Model
setTabPreviewFadeDuration
in interface Model
duration
- The duration, which should be set, in milliseconds as a Long
value. The
+ duration must be at least 0@Nullable +public final android.view.View getEmptyView()+
Model
getEmptyView
in interface Model
View
or null, if no view is shownpublic final void setEmptyView(@Nullable + android.view.View view)+
Model
setEmptyView
in interface Model
view
- The view, which should be set, as an instance of the class View
or null, if
+ no view should be shown, when the tab switcher is emptypublic final void setEmptyView(@Nullable + android.view.View view, + long animationDuration)+
Model
setEmptyView
in interface Model
view
- The view, which should be 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 usedpublic final void setEmptyView(@LayoutRes + int resourceId)+
Model
setEmptyView
in interface Model
resourceId
- The resource id of the view, which should be set, as an Integer
value. The
+ resource id must correspond to a valid layout resourcepublic final void setEmptyView(@LayoutRes + int resourceId, + long animationDuration)+
Model
setEmptyView
in interface Model
resourceId
- The resource id of the view, which should be set, as an Integer
value. The
+ resource id must correspond to a valid layout resourceanimationDuration
- 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 usedpublic final boolean areSavedStatesClearedWhenRemovingTabs()+
Model
areSavedStatesClearedWhenRemovingTabs
in interface Model
public final void clearSavedStatesWhenRemovingTabs(boolean clear)+
Model
clearSavedStatesWhenRemovingTabs
in interface Model
clear
- True, if the saved states of tabs should be cleared when the corresponding tabs are
+ removed, false otherwisepublic final void addCloseTabListener(@NonNull + TabCloseListener listener)+
Model
addCloseTabListener
in interface Model
listener
- The listener, which should be added, as an instance of the type TabCloseListener
. The listener may not be nullpublic final void removeCloseTabListener(@NonNull + TabCloseListener listener)+
Model
removeCloseTabListener
in interface Model
listener
- The listener, which should be removed, as an instance of the type TabCloseListener
. The listener may not be nullpublic final void addTabPreviewListener(@NonNull + TabPreviewListener listener)+
Model
addTabPreviewListener
in interface Model
listener
- The listener, which should be added, as an instance of the type TabPreviewListener
. The listener may not be nullpublic final void removeTabPreviewListener(@NonNull + TabPreviewListener listener)+
Model
removeTabPreviewListener
in interface Model
listener
- The listener, which should be removed, as an instance of the type TabPreviewListener
. The listener may not be nullpublic final void saveInstanceState(@NonNull + android.os.Bundle outState)+
Restorable
saveInstanceState
in interface Restorable
outState
- 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(@Nullable + android.os.Bundle savedInstanceState)+
Restorable
restoreInstanceState
in interface Restorable
savedInstanceState
- The saved state as an instance of the class Bundle
or null, if no saved state
+ is availablepublic class TabSwitcherStyle
+extends java.lang.Object
+TabSwitcher
.Constructor and Description | +
---|
TabSwitcherStyle(TabSwitcher tabSwitcher,
+ Model model,
+ ThemeHelper themeHelper)
+Creates a new class, which allows to retrieve the style attributes of a
+TabSwitcher . |
+
Modifier and Type | +Method and Description | +
---|---|
android.content.res.ColorStateList |
+getAddTabButtonColor()
+Returns the color of the button, which allows to add a new tab.
+ |
+
android.content.res.ColorStateList |
+getTabBackgroundColor(Tab tab)
+Returns the background color of tabs.
+ |
+
android.graphics.drawable.Drawable |
+getTabCloseButtonIcon(Tab tab)
+Returns the close button icon of tabs.
+ |
+
int |
+getTabContentBackgroundColor(Tab tab)
+Returns the content background color of tabs.
+ |
+
android.graphics.drawable.Drawable |
+getTabIcon(Tab tab)
+Returns the icon of tabs.
+ |
+
int |
+getTabProgressBarColor(Tab tab)
+Returns the progress bar color of tabs.
+ |
+
android.content.res.ColorStateList |
+getTabTitleTextColor(Tab tab)
+Returns the title text color of tabs.
+ |
+
ThemeHelper |
+getThemeHelper()
+Returns the theme helper, which allows to retrieve resources, depending on the tab switcher's
+ theme.
+ |
+
android.graphics.drawable.Drawable |
+getToolbarNavigationIcon()
+Returns the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
java.lang.CharSequence |
+getToolbarTitle()
+Returns the title of the toolbar, which is shown, when the tab switcher is shown.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public TabSwitcherStyle(@NonNull + TabSwitcher tabSwitcher, + @NonNull + Model model, + @NonNull + ThemeHelper themeHelper)+
TabSwitcher
.tabSwitcher
- The tab switcher, whose style attributes are retrieved, as an instance of the type
+ TabSwitcher
. The tab switcher may not be nullmodel
- The model of the tab switcher, whose style attributes are retrieved, as an instance
+ of the class TabSwitcher
. The model may not be nullthemeHelper
- The theme helper, which allows to retrieve resources, depending on the tab switcher's
+ theme, as an instance of the class ThemeHelper
. The theme helper may not be
+ null@NonNull +public final ThemeHelper getThemeHelper()+
ThemeHelper
. The theme helper may not be null@Nullable +public final android.graphics.drawable.Drawable getTabIcon(@Nullable + Tab tab)+
tab
- The tab, the icon should be returned for, as an instance of the class Tab
or
+ null, if the icon should not be returned for a specific tabDrawable
or null, if no icon is
+ setpublic final android.content.res.ColorStateList getTabBackgroundColor(@Nullable + Tab tab)+
tab
- The tab, the background color should be returned for, as an instance of the class
+ Tab
or null, if the background color should not be returned for a specific
+ tabColorStateList
public final int getTabContentBackgroundColor(@Nullable + Tab tab)+
tab
- The tab, the background color should be returned for, as an instance of the class
+ Tab
or null, if the background color should not be returned for a specific
+ tabInteger
valuepublic final android.content.res.ColorStateList getTabTitleTextColor(@Nullable + Tab tab)+
tab
- The tab, the text color should be returned for, as an instance of the class Tab
or null, if the text color should not be returned for a specific tabColorStateList
public final android.graphics.drawable.Drawable getTabCloseButtonIcon(@Nullable + Tab tab)+
tab
- The tab, the icon should be returned for, as an instance of the class Tab
or
+ null, if the icon should not be returned for a specific tabDrawable
public final int getTabProgressBarColor(@Nullable + Tab tab)+
tab
- The tab, the color should be returned for, as an instance of the class Tab
or
+ null, if the color should not be returned for a specific tabInteger
valuepublic final android.content.res.ColorStateList getAddTabButtonColor()+
ColorStateList
or null, if the default color is used@Nullable +public final java.lang.CharSequence getToolbarTitle()+
CharSequence
or null, if no title is set@Nullable +public final android.graphics.drawable.Drawable getToolbarNavigationIcon()+
Drawable
or null, if no icon is setpublic class Tag
+extends java.lang.Object
+implements java.lang.Cloneable
+TabSwitcher
.Constructor and Description | +
---|
Tag()
+Creates a new tag, which allows to store the properties of the tabs of a
+TabSwitcher . |
+
Modifier and Type | +Method and Description | +
---|---|
Tag |
+clone() |
+
float |
+getPosition()
+Returns the position of the tab on the dragging axis.
+ |
+
State |
+getState()
+Returns the state of the tab.
+ |
+
boolean |
+isClosing()
+Returns, whether the tab is currently being closed, or not.
+ |
+
void |
+setClosing(boolean closing)
+Sets, whether the tab is currently being closed, or not.
+ |
+
void |
+setPosition(float position)
+Sets the position of the tab on the dragging axis.
+ |
+
void |
+setState(State state)
+Sets the state of the tab.
+ |
+
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Tag()+
TabSwitcher
.public final float getPosition()+
Float
valuepublic final void setPosition(float position)+
position
- The position, which should be set, as a Float
value@NonNull +public final State getState()+
State
. The state may not be nullpublic final void setState(@NonNull + State state)+
state
- The state, which should be set, as a value of the enum State
. The state may
+ not be nullpublic final boolean isClosing()+
public final void setClosing(boolean closing)+
closing
- True, if the tab is currently being closed, false otherwisepublic final Tag clone()+
clone
in class java.lang.Object
Interface | +Description | +
---|---|
Model | +
+ Defines the interface, a class, which implements the model of a
+TabSwitcher must
+ implement. |
+
Model.Listener | +
+ Defines the interface, a class, which should be notified about the model's events, must
+ implement.
+ |
+
Restorable | +
+ Defines the interface, a class, whose state should be stored and restored, must implement.
+ |
+
Class | +Description | +
---|---|
AbstractItem | +
+ An item, which contains information about a child view of a
+TabSwitcher . |
+
AddTabItem | +
+ An item, which contains information about a button a
+TabSwitcher , which allows to add a
+ new tab. |
+
ItemComparator | +
+ A comparator, which allows to compare two instances of the class
+AbstractItem . |
+
TabItem | +
+ An item, which contains information about a tab of a
+TabSwitcher . |
+
TabSwitcherModel | +
+ The model of a
+TabSwitcher . |
+
TabSwitcherStyle | +
+ Allows to retrieve the style attributes of a
+TabSwitcher . |
+
Tag | +
+ A tag, which allows to store the properties of the tabs of a
+TabSwitcher . |
+
Enum | +Description | +
---|---|
State | +
+ Contains all possible states of a tab, while the switcher is shown.
+ |
+
Interface | +Description | +
---|---|
AddTabButtonListener | +
+ Defines the interface of a listener, which should be notified, when a button, which allows to add
+ a tab to a
+TabSwitcher , has been clicked. |
+
Tab.Callback | +
+ Defines the interface, a class, which should be notified, when a tab's properties have been
+ changed, must implement.
+ |
+
TabCloseListener | +
+ Defines the interface, a class, which should be notified, when a tab is about to be closed by
+ clicking its close button, must implement.
+ |
+
TabPreviewListener | +
+ Defines the interface, a class, which should be notified, when the preview of a tab is about to
+ be loaded, must implement.
+ |
+
TabSwitcherListener | +
+ Defines the interface, a class, which should be notified about a tab switcher's events, must
+ implement.
+ |
+
Class | +Description | +
---|---|
AbstractState | +
+ An abstract base class for the states of tabs, which can be used together with a
+StatefulTabSwitcherDecorator . |
+
Animation | +
+ An animation, which can be used to add or remove tabs to/from a
+TabSwitcher . |
+
Animation.Builder<AnimationType,BuilderType> | +
+ An abstract base class for all builders, which allow to configure and create instances of the
+ class
+Animation . |
+
DragGesture | +
+ A drag gesture, which can be used to perform certain actions when dragging in a particular
+ direction.
+ |
+
DragGesture.Builder<GestureType,BuilderType> | +
+ A builder, which allows to configure and create instances of the class
+DragGesture . |
+
PeekAnimation | +
+ A peek animation, which animates the size of a tab starting at a specific position in order to
+ show the tab for a short time at the end of a
+TabSwitcher . |
+
PeekAnimation.Builder | +
+ A builder, which allows to configure and create instances of the class
+PeekAnimation . |
+
PullDownGesture | +
+ A drag gesture, which can be used to show the tab switcher by pulling down the currently selected
+ tab, when using the smartphone layout.
+ |
+
PullDownGesture.Builder | +
+ A builder, which allows to configure and create instances of the class
+PullDownGesture . |
+
RevealAnimation | +
+ A reveal animation, which animates the size of a tab starting at a specific position.
+ |
+
RevealAnimation.Builder | +
+ A builder, which allows to configure and create instances of the class
+RevealAnimation . |
+
StatefulTabSwitcherDecorator<StateType> | +
+ A
+TabSwitcherDecorator , which allows to store any arbitrary state for each tab of the
+ associated TabSwitcher . |
+
SwipeAnimation | +
+ A swipe animation, which moves tabs on the orthogonal axis.
+ |
+
SwipeAnimation.Builder | +
+ A builder, which allows to configure and create instances of the class
+SwipeAnimation . |
+
SwipeGesture | +
+ A drag gesture, which allows to switch between tabs, when swiping horizontally.
+ |
+
SwipeGesture.Builder | +
+ A builder, which allows to configure and create instances of the class
+SwipeGesture . |
+
Tab | +
+ A tab, which can be added to a
+TabSwitcher widget. |
+
TabSwitcher | +
+ A tab switcher, which allows to switch between multiple tabs.
+ |
+
TabSwitcherDecorator | +
+ An abstract base class for all decorators, which are responsible for inflating views, which
+ should be used to visualize the tabs of a
+TabSwitcher . |
+
Enum | +Description | +
---|---|
Layout | +
+ Contains all possible layouts of a
+TabSwitcher . |
+
LayoutPolicy | +
+ Contains all possible layout policies of a
+TabSwitcher . |
+
SwipeAnimation.SwipeDirection | +
+ Contains all possible directions of a swipe animation.
+ |
+
public class ThemeHelper
+extends java.lang.Object
+Constructor and Description | +
---|
ThemeHelper(android.content.Context context,
+ int globalTheme,
+ int phoneTheme,
+ int tabletTheme)
+Creates a new helper class, which allows to retrieve resources, depending on a tab switcher's
+ theme.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+getColor(Layout layout,
+ int resourceId)
+Returns the color, which corresponds to a specific theme attribute, regarding the theme,
+ which is used when using a specific layout.
+ |
+
android.content.res.ColorStateList |
+getColorStateList(Layout layout,
+ int resourceId)
+Returns the color state list, which corresponds to a specific theme attribute, regarding the
+ theme, which is used when using a specific layout.
+ |
+
android.graphics.drawable.Drawable |
+getDrawable(Layout layout,
+ int resourceId)
+Returns the drawable, which corresponds to a specific theme attribute, regarding the
+ theme, which is used when using a specific layout.
+ |
+
int |
+getInteger(Layout layout,
+ int resourceId,
+ int defaultValue)
+Returns the integer value, which corresponds to a specific theme attribute, regarding the
+ theme, which is used when using a specific layout.
+ |
+
int |
+getResourceId(Layout layout,
+ int resourceId,
+ int defaultValue)
+Returns the resource id, which corresponds to a specific theme attribute, regarding the
+ theme, which is used when using a specific layout.
+ |
+
java.lang.CharSequence |
+getText(Layout layout,
+ int resourceId)
+Returns the text, which corresponds to a specific theme attribute, regarding the theme, which
+ is used when using a specific layout.
+ |
+
int |
+getThemeResourceId(Layout layout)
+Returns the resource id of the theme, which is used when using a specific layout.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public ThemeHelper(@NonNull + android.content.Context context, + int globalTheme, + int phoneTheme, + int tabletTheme)+
context
- The context, which is used by the tab switcher, as an instance of the class Context
. The context may not be nullglobalTheme
- The resource id of the theme, which should be used regardless of the used layout, as
+ an Integer
value or 0, if the theme is not specifiedphoneTheme
- The resource id of the theme, which should be used, when using the smartphone layout,
+ as an Integer
value or 0, if the theme is not specifiedtabletTheme
- The resource id of the theme, which should be used, when using the tablet layout, as
+ an Integer
value or 0, if the theme is not specifiedpublic final int getThemeResourceId(@NonNull + Layout layout)+
layout
- The layout as a value of the enum Layout
. The layout may not be nullInteger
valuepublic int getColor(@NonNull + Layout layout, + @AttrRes + int resourceId)+
layout
- The layout as a value of the enum Layout
. The layout may not be nullresourceId
- The resource id of the theme attribute, the color should be obtained from, as an
+ Integer
value. The resource id must correspond to a valid theme attributeInteger
valuepublic android.content.res.ColorStateList getColorStateList(@NonNull + Layout layout, + @AttrRes + int resourceId)+
layout
- The layout as a value of the enum Layout
. The layout may not be nullresourceId
- The resource id of the theme attribute, the color state list should be obtained from,
+ as an Integer
value. The resource id must correspond to a valid theme
+ attributeColorStateList
public android.graphics.drawable.Drawable getDrawable(@NonNull + Layout layout, + @AttrRes + int resourceId)+
layout
- The layout as a value of the enum Layout
. The layout may not be nullresourceId
- The resource id of the theme attribute, the drawable should be obtained from, as an
+ Integer
value. The resource id must correspond to a valid theme attributeColorStateList
public java.lang.CharSequence getText(@NonNull + Layout layout, + @AttrRes + int resourceId)+
layout
- The layout as a value of the enum Layout
. The layout may not be nullresourceId
- The resource id of the theme attribute, the text should be obtained from, as an
+ Integer
value. The resource id must correspond to a valid theme attributeCharSequence
public int getResourceId(@NonNull + Layout layout, + @AttrRes + int resourceId, + int defaultValue)+
layout
- The layout as a value of the enum Layout
. The layout may not be nullresourceId
- The resource id of the theme attribute, the resource id should be obtained from, as
+ an Integer
value. The resource id must correspond to a valid theme attributedefaultValue
- The default value, which should be returned, if the given resource id is invalid, as
+ an Integer
valueInteger
valuepublic int getInteger(@NonNull + Layout layout, + @AttrRes + int resourceId, + int defaultValue)+
layout
- The layout as a value of the enum Layout
. The layout may not be nullresourceId
- The resource id of the theme attribute, the integer value should be obtained from, as
+ an Integer
value. The resource id must correspond to a valid theme attributedefaultValue
- The default value, which should be returned, if the given resource id is invalid, as
+ an Integer
valueInteger
valueClass | +Description | +
---|---|
ThemeHelper | +
+ A helper class, which allows to retrieve resources, depending on a tab switcher's theme.
+ |
+
public class TabSwitcherButton +extends android.support.v7.widget.AppCompatImageButton +implements TabSwitcherListener+
TabSwitcher
by using a TabSwitcherDrawable
. It must be registered at a TabSwitcher
instance in order to keep the displayed count up to date. It therefore implements
+ the interface TabSwitcherListener
.android.widget.ImageView.ScaleType
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnCapturedPointerListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnScrollChangeListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener, android.view.View.OnUnhandledKeyEventListener
ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR, AUTOFILL_HINT_CREDIT_CARD_NUMBER, AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE, AUTOFILL_HINT_EMAIL_ADDRESS, AUTOFILL_HINT_NAME, AUTOFILL_HINT_PASSWORD, AUTOFILL_HINT_PHONE, AUTOFILL_HINT_POSTAL_ADDRESS, AUTOFILL_HINT_POSTAL_CODE, AUTOFILL_HINT_USERNAME, AUTOFILL_TYPE_DATE, AUTOFILL_TYPE_LIST, AUTOFILL_TYPE_NONE, AUTOFILL_TYPE_TEXT, AUTOFILL_TYPE_TOGGLE, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, IMPORTANT_FOR_AUTOFILL_AUTO, IMPORTANT_FOR_AUTOFILL_NO, IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_AUTOFILL_YES, IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, NOT_FOCUSABLE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z
Constructor and Description | +
---|
TabSwitcherButton(android.content.Context context)
+Creates a new image button, which allows to display the number of tabs, which are currently
+ contained by a
+TabSwitcher . |
+
TabSwitcherButton(android.content.Context context,
+ android.util.AttributeSet attributeSet)
+Creates a new image button, which allows to display the number of tabs, which are currently
+ contained by a
+TabSwitcher . |
+
TabSwitcherButton(android.content.Context context,
+ android.util.AttributeSet attributeSet,
+ int defaultStyle)
+Creates a new image button, which allows to display the number of tabs, which are currently
+ contained by a
+TabSwitcher . |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+onAllTabsRemoved(TabSwitcher tabSwitcher,
+ Tab[] tabs,
+ Animation animation)
+The method, which is invoked, when all tabs have been removed from the tab switcher.
+ |
+
void |
+onSelectionChanged(TabSwitcher tabSwitcher,
+ int selectedTabIndex,
+ Tab selectedTab)
+The method, which is invoked, when the currently selected tab has been changed.
+ |
+
void |
+onSwitcherHidden(TabSwitcher tabSwitcher)
+The method, which is invoked, when the tab switcher has been hidden.
+ |
+
void |
+onSwitcherShown(TabSwitcher tabSwitcher)
+The method, which is invoked, when the tab switcher has been shown.
+ |
+
void |
+onTabAdded(TabSwitcher tabSwitcher,
+ int index,
+ Tab tab,
+ Animation animation)
+The method, which is invoked, when a tab has been added to the tab switcher.
+ |
+
void |
+onTabRemoved(TabSwitcher tabSwitcher,
+ int index,
+ Tab tab,
+ Animation animation)
+The method, which is invoked, when a tab has been removed from the tab switcher.
+ |
+
void |
+setCount(int count)
+Updates the image button to display a specific value.
+ |
+
drawableStateChanged, getSupportBackgroundTintList, getSupportBackgroundTintMode, getSupportImageTintList, getSupportImageTintMode, hasOverlappingRendering, setBackgroundDrawable, setBackgroundResource, setImageBitmap, setImageDrawable, setImageResource, setImageURI, setSupportBackgroundTintList, setSupportBackgroundTintMode, setSupportImageTintList, setSupportImageTintMode
getAccessibilityClassName, onResolvePointerIcon, onSetAlpha
clearColorFilter, drawableHotspotChanged, getAdjustViewBounds, getBaseline, getBaselineAlignBottom, getColorFilter, getCropToPadding, getDrawable, getImageAlpha, getImageMatrix, getImageTintList, getImageTintMode, getMaxHeight, getMaxWidth, getScaleType, invalidateDrawable, isOpaque, jumpDrawablesToCurrentState, onAttachedToWindow, onCreateDrawableState, onDetachedFromWindow, onDraw, onMeasure, onRtlPropertiesChanged, onVisibilityAggregated, setAdjustViewBounds, setAlpha, setBaseline, setBaselineAlignBottom, setColorFilter, setColorFilter, setColorFilter, setCropToPadding, setFrame, setImageAlpha, setImageIcon, setImageLevel, setImageMatrix, setImageState, setImageTintList, setImageTintMode, setMaxHeight, setMaxWidth, setScaleType, setSelected, setVisibility, verifyDrawable
addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addFocusables, addFocusables, addKeyboardNavigationClusters, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, addTouchables, animate, announceForAccessibility, autofill, autofill, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, clearFocus, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchGenericFocusedEvent, dispatchGenericMotionEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPointerCaptureChanged, dispatchPopulateAccessibilityEvent, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, findFocus, findViewById, findViewsWithText, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintList, getBackgroundTintMode, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getImportantForAutofill, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverlay, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocus, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasPointerCapture, hasTransientState, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isPaddingOffsetRequired, isPaddingRelative, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onLayout, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onRestoreInstanceState, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreDefaultFocus, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForeground, setForegroundGravity, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public TabSwitcherButton(@NonNull + android.content.Context context)+
TabSwitcher
.context
- The context, which should be used by the view, as an instance of the class Context
. The context may not be nullpublic TabSwitcherButton(@NonNull + android.content.Context context, + @Nullable + android.util.AttributeSet attributeSet)+
TabSwitcher
.context
- The context, which should be used by the view, as an instance of the class Context
. The context may not be nullattributeSet
- The attribute set, the view's attributes should be obtained from, as an instance of
+ the type AttributeSet
or null, if no attributes should be obtainedpublic TabSwitcherButton(@NonNull + android.content.Context context, + @Nullable + android.util.AttributeSet attributeSet, + @AttrRes + int defaultStyle)+
TabSwitcher
.context
- The context, which should be used by the view, as an instance of the class Context
. The context may not be nullattributeSet
- The attribute set, the view's attributes should be obtained from, as an instance of
+ the type AttributeSet
or null, if no attributes should be obtaineddefaultStyle
- The default style to apply to this view. If 0, no style will be applied (beyond what
+ is included in the theme). This may either be an attribute resource, whose value will
+ be retrieved from the current theme, or an explicit style resourcepublic final void setCount(int count)+
count
- The value, which should be displayed, as an Integer
value. The value must be
+ at least 0public final void onSwitcherShown(@NonNull + TabSwitcher tabSwitcher)+
TabSwitcherListener
onSwitcherShown
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullpublic final void onSwitcherHidden(@NonNull + TabSwitcher tabSwitcher)+
TabSwitcherListener
onSwitcherHidden
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullpublic final void onSelectionChanged(@NonNull + TabSwitcher tabSwitcher, + int selectedTabIndex, + @Nullable + Tab selectedTab)+
TabSwitcherListener
onSelectionChanged
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullselectedTabIndex
- 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 tabspublic final void onTabAdded(@NonNull + TabSwitcher tabSwitcher, + int index, + @NonNull + Tab tab, + @NonNull + Animation animation)+
TabSwitcherListener
onTabAdded
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullindex
- 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 nullanimation
- 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 onTabRemoved(@NonNull + TabSwitcher tabSwitcher, + int index, + @NonNull + Tab tab, + @NonNull + Animation animation)+
TabSwitcherListener
onTabRemoved
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nullindex
- 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 nullanimation
- 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(@NonNull + TabSwitcher tabSwitcher, + @NonNull + Tab[] tabs, + @NonNull + Animation animation)+
TabSwitcherListener
onAllTabsRemoved
in interface TabSwitcherListener
tabSwitcher
- The observed tab switcher as an instance of the class TabSwitcher
. The tab
+ switcher may not be nulltabs
- 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 nullClass | +Description | +
---|---|
TabSwitcherButton | +
+ An image button, which allows to display the number of tabs, which are currently contained by a
+
+TabSwitcher by using a TabSwitcherDrawable . |
+
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+Each annotation type has its own separate page with the following sections:
+Each enum has its own separate page with the following sections:
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+These links take you to the next or previous class, interface, package, or related page.
+These links show and hide the HTML frames. All pages are available with or without frames.
+The All Classes link shows all classes and interfaces except non-static nested types.
+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+The Constant Field Values page lists the static final fields and their values.
+TabSwitcher
's tabs.TabSwitcher
's tabs.AbstractItemIterator
.TouchEventDispatcher
in order to
+ dispatch touch events to it.TabSwitcher
.TabSwitcher
.TabSwitcher
.AbstractItem
.AbstractItemIterator
.StatefulTabSwitcherDecorator
.TabSwitcher
.TabSwitcher
.TabSwitcher
.TabSwitcher
.TabSwitcher
.AbstractTabSwitcherLayout.InitialItemIterator
.TabSwitcher
consists of.TouchEventDispatcher
in order to dispatch touch events to them.TouchEventDispatcher
in order to
+ dispatch touch events to it.TabSwitcher
, has been clicked.TabSwitcher
, which allows to add a
+ new tab.TabSwitcher
.Animation
.TabSwitcher
to apply the decorator.TabSwitcher
's children, must implement.TabSwitcher
can be moved.ArrayItemIterator
.TabSwitcher
.TabSwitcher
.TabSwitcher
must
+ implement.StatefulTabSwitcherDecorator.clearState(Tab)
or StatefulTabSwitcherDecorator.clearAllStates()
method.TabSwitcher
.PeekAnimation
.TabSwitcher
's tabs, when using the smartphone layout.TabSwitcher
's tabs, when using the smartphone layout.TabSwitcher
, when using the smartphone layout.TabSwitcher
.TabSwitcher
on smartphones.TabSwitcher
on
+ smartphones.TabSwitcher
+ consists of, when using the smartphone layout.TabSwitcher.getToolbars()
.PullDownGesture
.PullDownGestureEventHandler
, must implement.RevealAnimation
.TabSwitcher
to save the current state of a tab.TabSwitcher.getToolbars()
.TabSwitcherButton
as their action view.TabSwitcherButton
as their action view.TabSwitcherDecorator
, which allows to store any arbitrary state for each tab of the
+ associated TabSwitcher
.SwipeAnimation
.SwipeGesture
.SwipeGestureEventHandler
, must implement.TabSwitcher
widget.TabSwitcher
widget.TabSwitcher
widget.TabSwitcher
.TabSwitcher
's tabs, when using the tablet layout.TabSwitcher
's tabs, when using the tablet layout.ContentRecyclerAdapter
, which allows to inflate the
+ views, which are used to visualize the content views of the tabs of a TabSwitcher
.ContentRecyclerAdapter
, which allows to
+ inflate the views, which are used to visualize the content views of the tabs of a TabSwitcher
.TabSwitcher
, when using the tablet layout.TabSwitcher
.TabSwitcher
on tablets.TabSwitcher
on
+ tablets.TabSwitcher
+ consists of, when using the tablet layout.TabSwitcher
by using a TabSwitcherDrawable
.TabSwitcher
.TabSwitcher
.TabSwitcher
.TabSwitcher
.TabSwitcher
.TabSwitcher
.TabSwitcher
,
+ must implement.TabSwitcher
.TabSwitcher
.TabSwitcher
.TabSwitcher
.TabSwitcher
.TabSwitcher
.TouchEventDispatcher
, must implement.Animation
.DragGesture
.ArrayItemIterator
.ItemIterator
.PeekAnimation
.RevealAnimation
.SwipeAnimation
.SwipeGesture
.TabSwitcher
, or not.TabSwitcher
, by encapsulating a TabSwitcherDecorator
.TabSwitcher
, by encapsulating a TabSwitcherDecorator
.TabSwitcher
, which
+ allows to add a new tab.Tab
from parcels.DragGesture
.AbstractDragGestureEventHandler
.AbstractDragGestureEventHandler
.IllegalStateException
, if no view recycler has been set.TabSwitcher
to inflate the view, which should be
+ used to visualize a specific tab.AbstractTabSwitcherLayout.InitialItemIterator
.AbstractItem
.AbstractItem
.TabSwitcher
.ItemIterator
.+ + diff --git a/doc/javadoc/overview-summary.html b/doc/javadoc/overview-summary.html new file mode 100644 index 00000000..922fe048 --- /dev/null +++ b/doc/javadoc/overview-summary.html @@ -0,0 +1,169 @@ + + + + + +
Package | +Description | +
---|---|
de.mrapp.android.tabswitcher | ++ |
de.mrapp.android.tabswitcher.drawable | ++ |
de.mrapp.android.tabswitcher.gesture | ++ |
de.mrapp.android.tabswitcher.iterator | ++ |
de.mrapp.android.tabswitcher.layout | ++ |
de.mrapp.android.tabswitcher.layout.phone | ++ |
de.mrapp.android.tabswitcher.layout.tablet | ++ |
de.mrapp.android.tabswitcher.model | ++ |
de.mrapp.android.tabswitcher.util | ++ |
de.mrapp.android.tabswitcher.view | ++ |